Learn navigation commands, understand the Linux directory structure, create and delete files, and use tab completion and command history.
Every server, container, and CI environment is Linux. The terminal is the universal interface. GUI tools come and go. The terminal is everywhere.
pwd # print working directory ls # list directory contents ls -la # long format, show hidden files cd /home # change to absolute path cd ~ # home directory cd .. # parent directory cd - # previous directory # Autocomplete: press Tab # History: press ↑ arrow # Search history: Ctrl+R then type
/ ← root of the filesystem /home ← user home directories (/home/bo) /etc ← configuration files /var/log ← log files /tmp ← temporary files (cleared on reboot) /usr/bin ← user programs /usr/local ← locally installed software /proc ← virtual FS: running process info /dev ← device files
mkdir mydir # create directory mkdir -p a/b/c # create nested dirs touch file.txt # create empty file rm file.txt # delete file rm -rf mydir/ # delete directory (careful!) mv file.txt newname.txt # rename/move cp file.txt backup.txt # copy cp -r dir/ backup/ # copy directory
rm -rf / deletes your entire system with no confirmation and no recovery. rm -rf ./ (with the dot) does the same for your current directory. Always double-check paths before running rm -rf.Before moving on, make sure you can answer these without looking: