Forrest logo
back to context overview

linux

List of commands for linux:

  • linux:alias:create:permanent Create an alias and persist it.
    $ echo 'alias ${alias_name}="${alias_command}"' >> ~/.bash_profile
    try on your machine
    explain this command
  • linux:directory:make Create a single directory
    $ mkdir ${directory_name}
    try on your machine
  • linux:directory:make:recursive Create a directory (recursive).
    $ mkdir -p ${directory_name}
    try on your machine
  • linux:file:length Return the number of lines of a given file.
    $ cat ${filename} | wc -l
    try on your machine
  • linux:files:count:directory Return the number of sub-directories in a given path
    $ find ${directory_to_count_in} -type d | wc -l
    try on your machine
  • linux:files:count:files Return the number of files in a given path
    $ find ${directory_to_count_in} -type f | wc -l
    try on your machine
  • linux:files:create Create or update a file.
    $ touch ${filename}
    try on your machine
    explain this command
  • linux:files:current-dir Show the current working directory.
    $ pwd
    try on your machine
    explain this command
  • linux:files:directory:size Return the size a of given directory.
    $ du -sh ${directory}
    try on your machine
  • linux:files:file:delete:line Delete a single line from a given file
    $ sed -i '${line_number}d' ${filename}
    try on your machine
    explain this command
  • linux:files:find:big Find all files that are larger than a given size.
    $ find ${path_to_check} -type f -size +${size_in_mega_byte}M
    try on your machine
    explain this command
  • linux:files:find:empty Find all empty files under a certain path
    $ find ${directory} -type f -empty
    try on your machine
  • linux:files:find:modified Find all files which are modified in a given timespan.
    $ find ${directory} -mmin -${time_in_minutes}
    try on your machine
  • linux:files:find:name Find all files with a given name.
    $ find ${dir_to_search_in} -name ${filename}
    try on your machine
  • linux:files:find:older Find all files that are older than a given period.
    $ find ${dir_to_search_in} -mtime +${number_on_days} -print
    try on your machine
  • linux:files:move:file Move a file to another destination (or just rename it).
    $ touch ${filename}
    try on your machine
    explain this command
  • linux:files:symlink:create Create a symlink.
    $ ln -s ${filename} ${link}
    try on your machine
  • linux:linux:file:show Show the content of a file.
    $ cat ${filename}
    try on your machine
  • linux:password:change Change the current users password
    $ passwd
    try on your machine
    explain this command
  • linux:process:check:running Check if a given process is running.
    $ ps aux | grep ${process_name}
    try on your machine
    explain this command
  • linux:system:ports:open Show all open ports
    $ lsof -i -P -n | grep LISTEN
    try on your machine
  • linux:tar:create:gzip [c]reate a g[z]ipped archive and write it to a [f]ile.
    $ tar czf ${path-to-target-tar-gz} ${filename1 filename2 ---}
    try on your machine
    explain this command
  • linux:tar:create:tar [c]reate an archive and write it to a [f]ile.
    $ tar cf ${path-to-target-tar} ${filename1 filename2 ---}
    try on your machine
    explain this command
  • linux:tar:decompress Decompress the given tar file
    $ tar -zxvf ${filename}
    try on your machine
  • linux:version:info Show information about the Linux version
    $ cat /etc/os-release
    try on your machine
  • linux:zip:compress Compress the given directory or file.
    $ zip -r ${output_zip_file} ${input_directory}
    try on your machine
  • linux:zip:compress:with-password Compress the given directory or file with a password
    $ zip --password ${password} -r ${output_zip_file} ${input_directory}
    try on your machine
  • linux:zip:decompress Decompress the given zip file.
    $ unzip ${filename}
    try on your machine
back to context overview