| Command | Description | 
|---|---|
| awk '/^END/ { x = 0; } x { print $0; } /^BEGIN/ { x = 1; } ' | Print text between BEGINandENDlines
(exclusive). | 
| create table t01_tmp as select distinct * from t01; drop table t01; alter table t01_tmp rename to t01; | Filter duplicates from the SQLite table t01. | 
| cut -d ',' -f 3,4 | Grab columns 3 and 4 of a CSV input from stdin. | 
| date -d@$((0x$((perl -e'print"1B","0"x95' \| xxd -r -p; sleep 1) \| nc -u time.facebook.com 123 \| tail -c+41 \| head -c4 \| xxd -p)-64#23GDW0)) | Query the NTP server time.facebook.com(works on Rocky
Linux’s versions ofnetcat/xxd). | 
| find ~/mydir -name '*go' -exec go fmt {} \; | Execute a command recursively in ~/mydironly against
files with a certain file extension. | 
| fuser -mv /mnt/disk | Find all processes using the mount point /mnt/disk. | 
| # Get most recent commit ID of Branch 2, say it's 49a8338git fetch; git branch -v# Switch to Branch 1git checkout branch1git reset --hard 49a8338 | Reset Branch 1 to be identical to Branch 2 in Git. | 
| grep -rniI ~/mydir -e 'mysearch' | Search recursively in ~/mydirfor the textmysearch. The-Ioption excludes binary
files. | 
| ls -lart | Easy to remember, puts most recently changed files at the bottom of the screen. | 
| # Run on Host 1nc -lv 50000# Run on Host 2nc -v host1_hostname 50000 | Checks if communication is open on port 50000 between two Linux
hosts with Netcat installed. Another option: python3 -m httpserver -p 50000andcurl host1_hostname:50000. | 
| nslookup time.gov 1.1.1.1 | Does a DNS lookup of the domain time.govagainst the
public DNS server at1.1.1.1. Useful for comparing tonslookup time.gov, which uses its environment’s DNS
configuration. | 
| openssl s_client -connect npr.org:443 | Establish a TLS connection to npr.org:443. | 
| openssl verify -verbose -CAfile ~/cacert.pem  ~/mycert.pem | Determine if the CA certificate ~/cacert.pemsigned the
certificate~/mycert.pem. | 
| openssl x509 -in ~/mycert.pem -text | Print the contents of the X.509 certificate ~/mycert.pem. | 
| echo -e ".mode csv\n.import a.csv t01" \| sqlite data.sqlite3 | Import the CSV file a.csvinto the tablet01in the Sqlite databasedata.sqlite3. | 
| ssh -N -L 50000:192.168.1.25:60000 pi | Forward local port 50000to remote port60000on SSH hostpi. | 
| ssh -D 50000 -C -N pi | Set up a local SOCKS listener which is tunneled to SSH host pi. | 
| ssh-keygen -o -a 100 -t ed25519 | Generate an Ed25519 SSH key. | 
| tr -s ' ' | Squeeze successive spaces to a single space. |