| Command | Means/Stems From | Purpose | Syntax | Example |
cd | change directory | move from dir to dir | cd DIR | cd /home/melissa |
ls | list | list the contents of a directory | ls DIR (if no DIR is given, assumes current directory) | ls /usr/local/src |
mv | move | move something to somewhere else, rename something | mv FROM TO | mv john.txt mary.txt
mv /home/melissa/john.txt /home/sarah/john.txt |
cat | concatenate | the intended purpose is to concatenate two files together, but I usually just use it to display short files | cat FILE | cat jilly.txt |
less | | display, and be able to navigate through and search, a file; hit q to quit; hit / and then type something and hit enter to search | less FILE | less missy.txt |
grep | | search for something in file(s) | grep QUERY FILE(S) | grep "ugly man" *.txt
grep -rI 'frogger' . (searches recursively for 'frogger' in all files and directories starting at the current one) |
man | manual | display a manual for a given command; hit q to quit; acts like less | man COMMAND | man less |
rm | remove | delete something | rm FILE_OR_DIR | rm pinky.jpg
rm -r directory/ |
which | | determine where a program is located, if you even have it | which COMMAND | which mozilla-firefox |
whoami | | display which user you are | whoami | whoami |
chmod | change mode | change permissions on a file/dir | chmod PERMISSION FILE_OR_DIR | chmod 755 jim.sh |
locate | | locate instances of a word on your system; good for finding config files, executables, etc. | locate FILE | locate firefox |