linux_commands

General

  • cd
Examine directories and their contents:
  • pwd
  • ls
  • tree
Find files:
  • find
Modify file permissions:
  • chmod e.g. chmod a+x myscript.sh, chmod u+rw,go-rwx private.txt
Create files and directories:
  • touch
  • mkdir
Copy, move or delete files and directories:
  • cp
  • mv
  • rm
Examine files and their contents:
  • file
  • cat
  • less
  • head
  • tail
  • wc
  • sort
Search within a file:
  • grep e.g. grep “juice” shopping-list.txt, grep “error” /var/log/*
Printing text or variables:
  • echo
Work with variables and aliases:
  • alias
  • export
  • source
Redirection:
  • <, >, >>
Pipes:
  • |

Process

View information about processes:
  • ps
  • top
  • pidof
Start a process in the background:
  • &
Terminate a process:
  • CTRL + C
  • kill
  • kill -9
Redirection:
  • 2>, 2>&1