Printable quick reference
Cheat sheet
A compact view of the canonical command library. Open the full library for context and multi-step examples.
Navigation & files
pwdSafeuname -srmoRead-onlylsSafetouch file1.txt file2.txt file3.txtSafecd ~Safecd ~/linux-practiceSafecd ~/linux-practiceRead-onlycd /etcRead-onlycd ~/linux-practiceSafecd ~/linux-practiceSafestat myfile.txtSafeecho 'Hello Ubuntu' > myfile.txtRead-onlycd ~/linux-practiceSafecat -n journal.txtSafels -la | tee listing.txtSafecd ~/linux-practiceSafehead -n 5 large.txtSafeless -N large.txtSafeText & pipelines
cd ~/linux-practiceSafels missing-file 2> error.logSafecat << 'EOF' > document.txtSafecd ~/linux-practiceSafeecho 'Hello World' | tr 'a-z' 'A-Z'Safeecho 'Name:Age:City' > people.txtSafecd ~/linux-practiceSafegrep '^A' fruits.txtSafemkdir -p projects/search-demoSafecd ~/linux-practiceSafesed -n '2p' text.txtSafesed -i.bak 's/Hello/Hi/g' text.txtCautioncd ~/linux-practiceSafeecho -e 'Product,Price,Quantity\nApple,1.50,100\nBanana,0.75,200' > inventory.csvSafeawk -F, 'NR>1 {total += $2 * $3} END {print total}' inventory.csvSafeSafety & control
cd ~/linux-practiceSafefind find-lab -name '*.txt'Safefind find-lab -name '*.txt' -exec ls -lh {} \;Safefind find-lab -name '*.log' -deleteCautioncd ~/linux-practiceSafeecho 'echo Hello' > scripts/hello.shSafechmod u+s /usr/bin/passwdExplanationcd ~/linux-practiceRead-onlytouch owned-by-me.txtRead-onlysudo chown username:groupname file.txtAdminpsRead-onlycd ~/linux-practiceCautionkillall sleepCautionprintenv | head -20Read-onlyexport MY_NAME='Linux Learner'Safemkdir -p ~/linux-practice/binSafecommand -v lsRead-onlyApplied workflows
alias ll='ls -la'Safeunalias llSafealias ls='ls --color=auto'Safehistory 10Read-onlyecho 'safe repeat demo'Cautionhistory -cCautionecho file_{1..5}.txtSafemkdir -p glob-labSaferm -rf glob-labCautioncd ~/linux-practiceSafeecho 'Target content' > target.txtSaferm target.txtCautioncd ~/linux-practiceSafemkdir -p backupsSafemkdir -p restoredSafecat ~/.bashrc | head -30Read-onlyOLD_PS1=$PS1Safeecho "alias showdate='date +%Y-%m-%d'" >> ~/linux-practice/my_aliasesSafeecho "alias la='ls -A'" >> ~/.bashrcExplanationcd ~/linux-practiceSafecd ~/linux-practice/final_projectSafecd ~/linux-practiceCautionSystem & network
cd ~/linux-practiceSafedf -h /Read-onlylsblkRead-onlyapt search 'text editor' | head -20Read-onlycommand -v apt || trueRead-onlydpkg -l | head -20Read-onlysudo apt updateAdminping -c 2 8.8.8.8Read-onlygetent hosts example.comRead-onlymkdir -p ~/linux-practice/downloadsSafeip addr show | head -30Read-onlyfree -hRead-onlytop -b -n 1 | head -20Read-onlyif command -v journalctl >/dev/null && [ "$(ps -p 1 -o comm=)" = systemd ]; thenRead-onlyAutomation
cd ~/linux-practice/scriptsSafecat << 'EOF' > args.shSafels /nonexistentRead-onlycd ~/linux-practice/scriptsSafecd ~/linux-practice/scriptsSafecd ~/linux-practice/scriptsSafeif ! command -v crontab >/dev/null; thenRead-onlycd ~/linux-practiceSafecrontab -rExplanationcommand -v lsRead-onlyman lsRead-onlysudo apt install plocate -yAdmin