Basic Linux Commands ls List directory contents. ls -l long listing with dates and permissions ls -a list all, including hidden files (hidden files start with a period) cd Change directory. cd - change to previous directory cd ~ change to home directory cd .. change to parent directory pwd Print current (working) directory. cp Copy file(s). cp -r somedir somedest Copy recursively (directory and all contents) mv Move (or rename) a file (or directory) rm Delete (remove) a file. rm -r somedir Delete recursively (directory and all contents) rm -ri somedir Delete recursively, but prompt before each removal rm -rf somedir Delete recursively, never prompt mkdir Create directory. rmdir Remove (empty) directory. cat Print file contents (to console). less Scroll through file contents, one page at a time. SPACEBAR to advance a page, B to go back a page, Q to quit, /pattern to search for pattern exit Close shell. If this is your login shell, you will log out.