Sysadmin Notes 20250115 08:20:00 BASH if [ -n "$1" ] && [ -n "$2" ] # test if params exist if [ -z "$1" ] && [ -z "$2" ] # test if params do not exist if [ $# -eq 0 ] # number of parameters array=(one two three); # Array variable array+=('foo') # Array add element ${#array[@]} # Array length if [ ${#array[@]} -eq 0 ]; then echo empty array; fi for i in "${arrayName[@]}"; do echo $i; done # Array loop for addr in `ufws | grep DENY | awk '{print $4}'| sed 's/\/8//1'`; do whois -r $addr | grep country; done # Whois lookup for multiple addresses ${array[*]} # Array all items ${!array[*]} # Array All indexes ${#array[*]} # Array length ${#array[0]} # Array length item zero blkid # Show disks cat file | cut -d "#" -f1 # Cut from char to EOL cat file | cut -d ' ' -f2- # Cut first word declare -f # Show all functions and source declare -F # Show all functions grep "cat\|dog" file # grep or grep ^[^#] file # Remove comments ls ./.??* # List dot files ls -h # Human readable format ls -i # show inode ls -r # reverse order ls -R # recursive ls -S # Sort by file size ls -t # sort by modification time ls -X # group files by extension # ls -l output format -rw-r--r--@ 1 pi staff 21411 Jul 16 17:34 unix.txt | | | | | | | | | | | own group size date mod name | | links | @ extended attributes | + access control | % dataless type - Regular file b Block special file c Character special file d Directory l Symbolic link p FIFO s Socket w Whiteout BASH IMPORT BOOKMARKS ./favorites | sed 's/,/ /g' | awk -F 'T' '{print $1}' rsync -a --progress --delete --include-from=/web/rsync-include.txt /web/ piz:/var/www/html/ scp id@host:/home/\* . # SCP wildcards use \* sed -i "s/replace/replacement/g" file # File search replace sed -e '/^$/d' # Remove blank lines sed 's/^ *//g' # Remove leading spaces sed 's/ *$//g' # Remove trailing spaces sed 's/\.com.*/.com/' # Delete from string to end of line tr -d '\000' # Strip nulls tr '[A-Z]' '[a-z]' # Lower Case type function # Show function source while [ ${#ip} -lt 15 ]; do ip="$ip"" "; done; # Pad spaces awk '{$1=$2=""; print $0}' file # Delete first 2 fields in line # Delete last 2 fields in line cat a.a | rev | awk 'BEGIN{FS=" "}{print $(1)="",$2="",$0}' | rev BASH READ A FILE LINE BY LINE #!/usr/bin/env bash while IFS='' read -r line || [[ -n "$line" ]] ; do echo "Text read from file: $line" done < "file.txt" BASH READ FROM ARGUMENTS OR A PIPE #!/bin/bash # Process pipe or arguments show_parameters () { echo "$1"; } # # Process data from a pipe if [ -p /dev/stdin ]; then # Read pipe line by line while IFS= read line; do # echo "${line}" string="${line}" # read each word for word in $string; do #echo "$word" show_parameters "$word" done done fi # process parameters $1 $2 ... for parameter in "$@" do #echo "$parameter"; show_parameters "$parameter" done BASH SUBSTRING SEARCH !/usr/bin/env bash STRING='some text My Long' SEARCH='My Long' if [[ $STRING = *$SEARCH* ]] ; then echo true fi EMACS EDITOR ^ = Control key ALT = OPTION Start emacs Exit ^x ^c Word ALT-ARROW Color ESC+x customize-themes Parenthesis ESC+x show-paren-mode Search ESC+% Newline ^q ^j Close window ^x 1 Save file ^x ^s IOS PAIR HEARING AIDS There is a trick to pair hearing aids. Settings: Turn on bluetooth. Settings: Look for accessibility. Hearing devices Take the hearing aids out of the charging case It will display both hearing aids Pair to the left and right hearing aid Then use the thrive app to adjust the volume. IOS SIRI CUSTOM QUESTION AND ANSWER Shortcuts app Touch + Touch the blue circle with three dots Type the question into the shortcut name Touch done Touch blue + add action Type speak into the search box at the top Scroll down and Touch Speak Text Touch text and type in the answer text Touch Done Then run Siri and ask the question LINUX blkid # show disks chkconfig # services on/off dmidecode # show BIOS hdparm -t /dev/hda # disk performance tar -cf - . | (cd /export/data/public; tar xpvf -) #backtoback LINUX COMMAND LINE EDIT KEYS Beginning of line ^A End of line ^E Beginning of word ALT+B End of Word ALT+F Delete cursor to beginning of line ^U Delete cursor to end of line ^K Delete cursor one word back ^W Delete cursor one word forward ALT+D Paste back deleted ^Y Search next char ^] Search previous char ^ALT+] LINUX DIG dig -x cnn.com # Show the IP address dig -x 190.202.93.10 # Show the domain name dig +short cnn.com # Show only the IP Address dig +answer cnn.com # Show only the answer section LINUX DUMP RESTORE FILE SYSTEM dump -0 -f - / | ssh -c blowfish root@target_machine "cd /; restore -rf -" cd targetdir; dump 0f - / | restore xvf - LINUX LS COMMAND ls -t # sort by modification time ls -S # Sort by file size ls -r # reverse order ls -h # Human readable format ls -i # show inode ls -X # group files by extension # Show ls display format info coreutils 'ls invocation' (then go to "what information is listed") -rwxrwxr-x. 1 daf None 480 Feb 2 15:30 test* -rwxrwxr-x+ 1 daf None 480 Feb 2 15:30 test* + = File ACL . = SElinux context information included T = only owner of file can modify it LINUX NETSTAT (OBSOLETE) netstat -lptn netstat -antup | grep -i 389 netstat -antup -a all -l listening -n numeric -p program -t tcp -u udp LINUX SS ss -a # show network connections ss -ar # Show network connections resolve IP addresses ss -al # Show listening ports LINUX RSYNC OVER SSH # rsync over SSH 1 hop rsync -a --progress -e "ssh -i $HOME/.ssh/id_rsa" from_dirctory user@remote.domain.com:/to_directory/ # rsync over SSH 2 hops rsync -a --progress -e "ssh sysadmin@wwwapp.net ssh" remotehost:/file.txt . LINUX SSH DIFF 2 REMOTE FILES # Diff 2 remote files diff <(ssh myServer1 'cat foo') <(ssh myServer2 'cat foo') ssh user@host cat /path/to/remotefile | diff /path/to/localfile -# SSH two hops ssh -t reachable_host ssh unreachable_host LINUX SSH KEYS # SSH keys # Generate a key # ssh-keygen will prompt for a filename and location # Use rsa if ed25519 is not supported. ssh-keygen -t ed25519 ssh-keygen -t rsa -b 4096 ssh-copy-ip metaldog@pi5 #copy keys to remote system # Keyfiles id_ed25519 (ed25519 Private key) id_ed25519.pub (ed25519 Public key) rsa_id (RSA Private key) rsa_id.pub (RSA Public key) # Cut and paste public key to remote system ~/.ssh/authorized-keys LINUX TCPDUMP tcpdump -D # Show network interfaces tcpdump -i eth0 # Dump all packets tcpdump -n eth0 # Show IP@ instead of names tcpdump host 192.168.1.100 # Specific host tcpdump port 80 # Specific Port tcpdump net 192.168.1.0/24 # Specific Network LINUX JOURNALCTL [SYSLOG] journalctl # ascending journalctl -r # descending journalctl -f # tail -f journalctl -k # kernel journalctl -u ssh # service ssh journalctl --no-pager # no less journalctl --list-boots # show boots journalectl --disk-usage # show log disk usage LINUX LESS COMMAND Key Description --------------------------- Arrow Move by one line Space Move down one page b Move up one page g Go to the first line G Go to the last line 100g Go to the 100th line /string Search for the string from current position n/N Go to the next or previous search match q Exit the logs MACOS COMMAND LINE mdls image.jpg # macos exif COMMAND-J # finder image size F11 # minize all windows security find-internet-password -s "https://example.com" # search keychain open file.txt # open a file from the command line echo "Hello, world!" | pbcopy # fill paste buffer pbpaste # echo the paste buffer networkQuality # internet speed test caffeinate # keep macOS awake (control-c exit) say # speak text screencapture # screen shot sudo launchctl list # List services launchctl print system # List services started for root sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist # disable sshd sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist # restart sshd MACOS SAFARI COMMANDS Back Command+[ Bookmarks Add Drag URL to favorites bar Bookmarks Delete Control Click Bookmarks Open All Command Click Bookmarks Open Selected Space Bookmarks Select Command Click Bookmarks Sidebar Control+Command+1 Clear Cache Command+Alt+E Close Safari Alt+F4 Copy Selection Command+C Download Linked File Option Click Link Forward Command+] Full Screen Exit ESC Home Page Shift+Command+H Next Field Tab Next Link Option+Tab Open File Command+O Open in New Tab Command Click Paste Selection Command+V Preferences Command+, Print Command+P Reading List Add Link Shift Click Link Reading List Add Page Shift+Command+D Reading List Remove Control Click in Summary Reading List Show Control+Command+2 Reading Open Shift+Command+R Reading Close Esc Recent Pages Names Hold back/forward button Recent Pages URL Option+Hold back/forward button Refresh Control+Command+R Refresh Command+Option+R Refresh Command+R Refresh Command Click Refresh Restore address bar Esc Screen Size (iphone) Control+Command+R Scroll down 1 screen Spacebar Scroll up 1 screen Shift+Spacebar Scroll top-left Control+Up Arrow Scroll bottom-left Control+Down Arrow Scroll larger increments Option+Arrow Keys Search Command+F Select address bar Command+L Tab Close Command+W Tab Close all except one Option Click Tab Close Button Tab Next Control+Tab Tab Next Shift+Command+] Tab Previous Control+Shift+Tab Tab Overview Shift+Command+\ Tab Reopen Shift+Command+T Tab Select Command+1/9 Window next Command+` Window Reopen Last closed Shift+Command+T Zoom Default Command+0 Zoom Website Contents Command +/- Zoom Website Text Option View Text Big/Small MACOS SCREENSHOT SHIFT-COMMAND-3 Entire Screen SHIFT-COMMAND-4 Portion of screen SHIFT-COMMAND-4-SPACE Window with drop down shadow SHIFT-COMMAND-4-SPACE Hold ALT and click Window for no drop down shadow MACOS TERMINAL NANO EDITOR DISPLAY UNICODE # Nano displays unicode characters as ?^W^` # Nano ALT-V does not show verbatim mode # Terminal-preferences-profiles-keyboard check "use option as meta key." # Alt-V shows verbatim input but will not present unicode input mode # Nano .configure displays error: UTF-8 not supported by ncurses # Install homebrew brew install ncurses # Add these lines to .bash_profile for new ncurses environment variables export PATH="/usr/local/opt/ncurses/bin:$PATH" # newer ncurses export LDFLAGS="-L/usr/local/opt/ncurses/lib" # newer ncurses export CPPFLAGS="-I/usr/local/opt/ncurses/include" # newer ncurses # Show version of ncurses pi@mb:~> tic -V ncurses 6.4.20221231 # nano .configure does not display UTF-8 support errors # nano shows --enable-utf8 pi@mb:~> nano -V GNU nano, version 7.2 (C) 2023 the Free Software Foundation and various contributors Compiled options: --disable-libmagic --disable-nls --enable-utf8 # Add these lines to .bash_profile to set locale to UTF8 export LANG="en_US.UTF-8" # locale utf-8 export LC_ALL="en_US.UTF-8" # locale utf-8 # To Enter Unicode in nano: ALT-V # Should display Verbatim Input Type 2665 # Should display Unicode Input ¥ # 2665 is a Unicode heart NANO EDITOR COMMANDS ^ = Control key Anchor place/remove ESC+INS Anchor back ESC+PGUP Anchor next ESC+PGDN Buffer multiple nano -F Buffer new ^R or ^U Buffer next ESC+. Buffer last ESC+, Center line at cursor ^L Comment line ESC+3 Complete word ^] Copy line or select ESC+^ Count words lines chars ESC+D Cursor Position ^C F11 Cursor Position Constant ESC+C Cut to end on/off ESC+K Delete char left cursor ^H (BACKSPACE) Delete char under cursor ^D (DEL) Delete cursor to eof ESC+T Delete line ^K (F9) (ESC+DEL) Delete word back ESC+BACKSPACE (SHIFT+^DEL) Delete word forward ^DEL Edit a file nano filename Format Javascript ESC+F Goto Line Number ^_ or ESC+G Help ^G (F1) Help mode ena/dis ESC+X Indent auto on/off ESC+I Indent selection right Alt+} Indent selection left Alt+{ Insert ASCII Code ESC ESC 000-255 Insert file at cursor ^R (INS) Insert tab ^I (TAB) Justify paragraph ^J (F4) Justify file ESC+J (F4) Line numbers on/off ESC+N Linter ESC+B Lower case selection ^K ^L Macro start ESC+: Macro stop ESC+; Matching Bracket ESC+] Mouse support on/off ESC+M Move block text back ALT+{ Move block text forward ALT+} Move char back ^B (â—€) Move char forward ^F (â–¶) Move cursor â—€ â–² â–¼ â–¶ Move file buffer prev ESC+â—€ (ESC-+) Move file buffer next ESC+â–¶ (ESC-+) Move line up ^P (â–²) Move line beginning ^A (HOME) Move line end ^E (END) Move line first ESC+\ (^HOME) Move line down ^N (â–¼) Move line last ESC+/ (^END) Move to line # ^_ (ESC+G) Move paragraph beginning ESC+( (ESC+9) Move paragraph forward ESC+) (ESC+0) Move word back ESC+SPACE Move word forward ^SPACE Multiple buffer nano -F Page down ^V Page up ^Y Paste ^U (F10) Redo ESC+E Refresh screen ^L Save file ^O (F3) Save file and exit ^X (F2) Save file no prompt ^S Search ^W (F6) Search and replace ^\ (ESC+R) Search backward ^Q Search next backward ESC+Q Search next forward ALT+W Select/Deselect text ALT+A Smart home key on/off ESC+H Spell checker F12 Suspend ^Z Suspension on/off ESC+Z Syntax highlight on/off ESC+Y Tabs to spaces on/off ESC+O Undo ESC+U Unicode ALT+V 2665 #heart Whitespace disp on-off ESC+P Wrap lines soft on-off ESC+S Wrap lines hard on-off ESC+L NMAP nmap -sn 10.0.1.* # SYN Scan RPI COMMANDS # OS Version cat /etc/issue cat /etc/os-release # apt sudo apt update # Update sudo apt full-upgrade # Upgrade (shows disk space needed before Y) sudo apt clean # Clean up package files apt list --installed # Installed packages apt-cache search # Search packages sudo raspi-config # Configuration netstat -lptn # Open ports ss -aO # Open ports /usr/bin/vcgencmd measure_temp # CPU temperature uptime -s # Uptime # Lets Encrypt Certificates sudo certbot certificates # Letsencrypt certs sudo certbot renew --dry-run # Renew all certs sudo certbot renew # Renew all certs certbot certonly --force-renew -d example.com #renew one cert # Shutdown commands sudo halt sudo poweroff sudo shutdown -h now sudo shutdown -h 10 # in 10 minutes sudo init 0 sudo reboot sudo shutdown -r now sudo shutdown -r 10 # in 10 minutes sudo init 6 ## show all apache current network connections webstatus # shows connections # # enable apache server-status sudo a2enmod status #Enable mod_status: edit /etc/apache2/mods-enabled/status.conf #Grant yourself access. # Set ExtendedStatus to On (Optional slower but comprehensive) # Allow from 127.0.0.1 ::1 10.0.1.7 # allow your address webrestart #Restart Apache sudo service apache2 restart # Restart Apache browse http://pizedit/server-status RPI INSTALL SANDISK MICROSDXC ULTRA 64GB # Download and install RaspberryPi imaging tool # https://www.raspberrypi.org/downloads/ # # Delete all partitions start - windows administration tools - computer management - run as administrator - disk management - right click on each partition - delete volume. # # Format the Drive to FAT32 # Run the imaging tool, select erase, select the SDXC, and write. # # Install Raspbian # Choose the OS, select the SDXC, and write. # # Add SSH file # In File explorer, there will be a volume called boot (F:) # Create a file in the top level directory called SSH # # Boot the pi with new SDXC card # The new PI will get an IP address from DHCP # Check the address on your router # ssh pi@IPADDRESS # password is raspberry # sudo raspi-config to change the host name and password RPI UFW sudo apt install ufw sudo ufw allow 22 # Allow SSH sudo ufw allow 80 # Allow HTTP sudo ufw allow 443 # Allow HTTPS sudo ufw show added # Show rules when disabled sudo ufw show numbered # Show rule numbers sudo ufw enable sudo ufw status sudo ufw status verbose sudo ufw status numbered # show rule numbers sudo ufw disable sudo ufw deny 80 # HTTP sudo ufw deny 443 # HTTPS sudo ufw prepend deny from 45.166.0.0/16 "Block Class B at top of rules" sudo ufw insert 1 deny from 216.21.13.0/24 to any port 80 # Add to top of list sudo ufw deny from 192.168.0.2 # Block one IP Address sudo ufw deny from 192.168.0.2/8 # Block Class A range 255.0.0.0 sudo ufw deny from 192.168.0.2/16 # Block Class B range 255.255.0.0 sudo ufw deny from 192.168.0.2/24 # Block Class C range 255.255.255.0 sudo ufw deny from 192.168.0.2 to any port 443 # Block IP Address to a port [any protocol] sudo ufw limit 443 # rate limit 6 connections/30 seconds sudo ufw delete limit 443 # Delete rule sudo ufs delete # UFW does not log anything by default # A log rule is needed to log anything sudo ufw allow log 22/tcp # Allow SSH and log the connections sudo ufw logging on # Turn logging on sudo ufw logging off # Turn logging off RPI UFW LOGGING https://pimylifeup.com/raspberry-pi-syslog-server/ https://linuxhandbook.com/ufw-logs/ # Install and configure rsyslog sudo apt update sudo apt full-upgrade sudo apt install rsyslog # edit /etc/rsyslog.conf uncomment module and input lines sudo nano -w /etc/rsyslog.conf #module(load="imudp") #input(type="imudp" port="514") #module(load="imtcp") #input(type="imtcp" port="514") # Add file 20-ufw.conf to /etc/rsyslog.d/ 20-ufw.conf: # Log kernel generated UFW log messages to file #---- Log from localhost :msg,contains,"[UFW " /var/log/ufw.log #---- Log fomr localhost #---- Uncomment to log fomr a remote server #$template ufwlog, "/var/log/router.log" #if $fromhost-ip startswith "10.0.1.2" then -?ufwlog #& stop #---- Uncomment to log from remote server # Uncomment the following to stop logging anything that matches the last rule. # Doing this will stop logging kernel generated UFW log messages to the file # normally containing kern.* messages (eg, /var/log/kern.log) #& stop sudo systemctl restart rsyslog # Start rsyslog service sudo systemctl enable rsyslog # enable rsyslog at startup RPI IPTABLES # install sudo apt-get install iptables-persistent # # iptables show rules brief iptables -L # # iptables show rules detail iptables -L -v # # iptables rules test file /etc/iptables.rules.test # # iptables load test rules sudo iptables-restore < /etc/iptables.rules.test # # iptables rules persistent file /etc/network/iptables # # iptables save rules to persistent file sudo sh -c 'iptables-save > /etc/iptables.up.rules' # # iptable nano persistent file sudo nano /etc/network/if-pre-up.d/ipwtables # # boot script startup iptables RPI IPTABLES FIREWALL RULES # Firewall rules are processed from top to bottom. # Once a rule is matched, no more rule checking occurs. # So if my first rule allows all traffic and my last rule allows none, then all traffic is allowed. # Don't block yourself by creating a bad first rule. # # Create file /etc/iptables.test.rules *filter # Block inbound traffic unless another rule allows it. :INPUT DROP [0:0] # # Allow forward traffic :FORWARD ACCEPT [0:0] # # Allow outbound traffic :OUTPUT ACCEPT [0:0] # # Allow outbound traffic # You could modify this to only allow certain traffic #-A OUTPUT -j ACCEPT # # Allow all loopback traffic # Block traffic to 127.0.0.1 not on lo0 -A INPUT -i lo -j ACCEPT -A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT # # Allow all traffic from internal network #-A INPUT -s 10.0.1.0/24 -j ACCEPT # # Allow SSH connections from internal network # Allow SSH connections from EAO # The --dport number is the same as in /etc/ssh/sshd_config -A INPUT -p tcp -s 10.0.1.0/24 -m state --state NEW --dport 22 -j ACCEPT # # Allow http/https -A INPUT -i eth0 -p tcp -m tcp -s 10.0.1.0/24 --dport 80 -j ACCEPT -A INPUT -i eth0 -p tcp -m tcp -s 10.0.1.0/24 --dport 443 -j ACCEPT -A INPUT -i eth0 -p tcp -m state --state NEW -s 128.171.90.0/24 --dport 80 -j ACCEPT -A INPUT -i eth0 -p tcp -m state --state NEW -s 128.171.90.0/24 --dport 443 -j ACCEPT # SMBD on internal network only -A INPUT -i eth0 -p tcp -m tcp -s 10.0.1.0/24 --dport 139 -j ACCEPT -A INPUT -i eth0 -p tcp -m tcp -s 10.0.1.0/24 --dport 445 -j ACCEPT # RSYNC #-A INPUT -i eth0 -p tcp -m tcp -s 10.0.1.0/24 --dport 873 -j ACCEPT # # Block SSH from the default gateway #-A INPUT -s YOUR ROUTER IP/32 -i tcp -p tcp -m tcp --dport 22 -j DROP # # Allow established inbound connections -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT # # Limit SSH abuse # The first rule records the IP address of each new attempt to access # port 22 using the recent module. The second rule checks to see if that # IP address has attempted to connect 4 or more times within the last # 60 seconds, and if not then the packet is accepted. #-A INPUT -p tcp -m state --state NEW -m recent --dport 22 --set --name ssh --rsource #-A INPUT -p tcp -m state --state NEW -m recent --dport 22 ! --rcheck --seconds 60 --hitcount 4 --name ssh --rsource -j ACCEPT # # Allows vncserver connections. Uncomment this to allow VNC. Again, this is # best restricted to certain IPs #-A INPUT -p tcp -m state --state NEW --dport 5901 -j ACCEPT # Allows RDP connections. Uncomment this to allow RDP. #-A INPUT -p tcp -m state --state NEW --dport 3389 -j ACCEPT # Allow Zeroconf connections. (Bonjour and Avahi) # -A INPUT -p udp -m state --state NEW --dport 5353 -j ACCEPT # Allow ping # note that blocking other types of icmp packets is considered a bad idea # by some # remove -m icmp --icmp-type 8 from this line to allow all kinds of icmp: # https://security.stackexchange.com/questions/22711 -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT # log iptables denied calls (access via 'dmesg' command) #-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7 # Reject all other inbound - default deny unless explicitly allowed policy: #-A INPUT -j DROP #-A FORWARD -j DROP COMMIT VI EDITOR " .vimrc file set encoding=utf-8 set fileencoding=utf-8 set background=dark " Set dark mode for Solarized set ruler " Show status line set showcmd " Show (partial) command in status line. set showmatch " Show matching brackets. set ignorecase " Do case insensitive matching syntax enable " Syntax Highlighting colorscheme default " Set colorscheme " Remember last position autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif # Create PDF vim states.txt -c "hardcopy > states.ps | q" && ps2pdf states.ps # Cheatsheet Append File :w>>file Delete Character x Colorscheme List :colorscheme ^d Syntax Highlight :syntax on Copy Line yy Delete Line dd Delete Word dW Display Line Numbers :set nu :set nonu Edit File vi filename Insert mode i ESC Insert New Line Above O Insert New Line Below o Move Beginning of Line ^ Move End of Line $ Move First Line :0 Move Last Line G Move Screen Forward ^f Move Screen Backward ^b Move Word Back b Move Word Forward w Overwrite Text R Paste Above P Paste Below p Replace Character r Quit :q! Search /word Search Next n Search Replace :line1,line2s/old/new/gc Search Replace :.,$s/old/new/gc #cur line to end Undo Last Change u Write :w Write Quit ZZ Write quit :wq WEB COLORS Pantone 2021 colors of the year Pantone 13-0647 TCX Illuminating #F5DF4D Pantone 17-5104 TCX Ultimate Gray #939597 YOUTUBE KEYBOARD SHORTCUTS Spacebar Stop/Play k Stop/Play m Mute/Unmute ^ V Volume up/down < > Forward/Backward 5 sec j/l Forward/Backward 10 sec , Next Frame . Previous Frame 0 Beginning of video 1-9 10%-90% of video / Search f Full screen toggle ESC Exit Full screen c Closed captions Shift+N Next Video Shift+P Previous Video i Mini Player