Command Description
whoami who you are logged in as
pwd print working directory
ls list items in current directory
ls -F list all items in current directory and show directories with a slash and executables with a star
ls -a list all items in current directory, including hidden files
cd dir change directory to dir
cd .. go up one directory
cd go to your home directory
cd ~ go to your home directory
cd / go to your root directory
nano open a text editor. See ribbon at bottom for help. ^ means CTRL
nano new.txt open nano to edit a file called new.txt
touch newfile create or updates newfile
mkdir newdir make directory newdir
rm file remove file
rmdir dir remove directory dir if it is empty
rm -r dir remove directory dir recursively
mv file newname rename file to newname. If a file called newname exists, this will overwrite it!
mv file newlocdir move file into the destination directory newlocdir
command > file redirect the output of command writing it to file
wc file count lines, words and characters in file
wc -l file count lines in file
wc -w file count words in file
wc -c file count characters in file
cat file displays the content of file
command1 | command2 "pipe" the output of command1 to command2
grep pattern files search for pattern in files
wget file download file
sort file print the lines of its input or concatenation of all files listed in its argument list in sorted order
man command show the manual for command
less file view file with page navigation
head file output the first 10 lines of file
tail file output the last 10 lines of file