Moving Around CLI: Job Management: – List contents (ls –ltra) ./.sh & - & forces to run in bkgrnd directory jobs – Lists jobs running – Remove directory fg – Will bring job to foreground /directory (cp –a) bg – Forces job to background – Remove file/directory (rm –rf) process & - Process will run post logout files/dirs or rename Ctrl-z – Suspends task – Create empty file, update stamp Saving Sessions: Working with Text: screen / – Allows a user to have multiple shells – Echoes back text to terminal or file on one connection, can disconnect and re-attach to – Concatenate, a file out, down it later tac – Print a file out, bottom up – Print the top xx lines out (–n 100) Network Essentials: – Print the last xx lines out (–f) – Lists network adapters/IP – Print text, page per page – Lists network adapters/IP info – Like more, ability to go line by line ping ip/dnsname – See if you can reach IP – Compare contents of files/directories /tracepath – Show hops to IP google.com – Lookup IP address Text Parsing Tools: : Show ports (netstat -nap), processes – Searches for text listening on ports, (netstat –nr) shows default – Will sort text output gateway – Condenses text to unique instances systemd-resolve –status – Shows DNS servers – Word count (or line count) – Extract data from delimited output Process Elevation: command – Elevates a single command More Advanced Text Tools: – Super user, change to root (su -) – Manipulates data and generates reports su – username – Switch user to specified user – Stream editor, text transformation id – Shows current user and group membership

File System/Disk Information: Bash Management: – Disk Free (-h) history – Lists last 1000 commands – Disk Usage (--max-depth=1 –h) cat ~/.bash_history - Same as history lsblk – List block devices (-f) !### - Runs command number from history – Find files (find / -name search*) Ctrl-r – Reverse search in history – Where is the binary – Optional package (updatedb) : man – Manual pages File/Directory Permissions: command –help – Shows available flags – Change owner/group of file/ info – Bash manual – Change file/dir modes Permissions for chmod: IO Redirection: 4 – (R)ead > - Redirect output to file 2 – ()rite >> - Add redirected output to file 1 – E(x)ecute | - Out one program into another . 7 = RWX 5 = R-X 4 = R-- Bash Envionment: Process Management: – List all environmental variables - Process list (ps fax) set – Set a variable top - System monitor, Sort by (M)em, C(P)U export – Export variable xxx - Kill process PID, get from ps or top process_name - Kill process name

Bash Shortcuts (Pico/Nano): Ubuntu (Debian) Package Management: Ctrl-a – Beginning of line apt – Pull dependencies/packages from Internet Ctrl-c - Cancel dpkg – Debian Package manager, more local Ctrl-e – End of line To upgrade: Ctrl-k - Cut from cursor forward apt update Ctrl-y – the cut apt upgrade Ctrl-p – Back (up arrow) Other useful commands: Ctrl-n – Next in CLI history (down arrow) apt search packagename Ctrl-l – screen apt packagename Ctrl-s – Freezes the screen apt remove packagename Ctrl-q – Will unlock your screen apt list –installed Ctrl-h – Backspace replacement dpkg –i localpackage.deb Ctrl-d – Delete or logout (on empty line) Tab – Command line completion Redhat/CentOS/Fedora RPM Package Mgmt: Shift Insert - Highlight paste yum – YellowDog Update Manager, like apt Shift -Up – Scroll up in terminal dnf – New version of Yum Shift Pg-Down – Scroll down in term rpm – Redhat package manager To upgrade: /vim Text Editor Shortcuts: yum update Command Mode (Escape key): Other useful commands: Arrow keys to move (may not work with vi) yum install packagename h – Back (left arrow) yum whatprovides somelibrary j – Next line (down arrow) yum search packagename k – Previous line (up arrow) yum remove packagename l – Forward (right arrow) rpm –Uvh package.rpm – Updates/installs pkg – Delete line ( 10 before will 10 lines) rpm –e package – Removes package yy – Yank line (also accepts a number before) rpm –qa – List all packages p – Paste line rpm –qif /some/file – Tells you what pkg file u – Undo rpm –qil package – List files in package / - Search, n for next, p for previous :1 – First line, xx number to that line number :$ - End of File :w – :wq – Write & quit :w filename.txt – Write to a specific name :q! – Quit without writing vi/vim Edit Mode ((a)ppend or (i)nsert): Works much like notepad, escape to return to command mode.