Professional Documents
Culture Documents
pwd Current directory cmd >> file Append stdout of cmd to file
mkdir dir Create directory dir cmd 2> file Error output of cmd to file
cd dir Change directory to dir cmd &> file Every output of cmd to file
cd .. Go up a directory
Search files
cd Got to home directory
grep pattern file Search for pattern in file
ls List files
grep -i Case insensitive search
-a Show all (incl. hidden) find /dir/ -name Find files starting with name in
name dir
-l Long listing format
whereis cmd Find binary/source for
-1 One file per line command
CTRL+a Jump to start of line vi file View file using vim editor
!! (or arrow up) Repeat last command mv file1 file2 Move (rename) file1 to file2
Pipes
Bash variables
cmd1 | cmd2 stdout of cmd1 to cmd2
env Show environment variables
cmd1 |& cmd2 stderr of cmd1 to cmd2
echo $NAME Output value of $NAME variable