Searching
Search phrase inside PDF files
Search for<phrase> in all PDF files (case insensitive, e.g.: .pdf, .PDF) in the current directory (.).
find . -iname "*.pdf" -exec pdfgrep "<phrase>" {} +Check open port on given IP address
Check if on IP145.23.12.30 there is open port 8080
nmap -p 8080 145.23.12.30Listing
Show all directories and their real sizes (with sort)
du -sh */ | sort -hrCopying
Copy all files of a given type to specific directory
Take allmp4 files from current directory (.) and paste into ~/Music.
find . -name '*.mp4' -type f | xargs -I '{}' mv '{}' ~/MusicUpdating
TBDTesting
Benchmark server effectiveness
Spawn 12 threads with 400 simultaneous connections for 10s tohttp://127.0.0.1:9000
wrk -t12 -c400 -d10s http://127.0.0.1:9000Generating
Random passwords
-
Option 1: Using
openssland generate random 12 characters password.openssl rand -base64 12 -
Option 2: Generate chars
[a-z0-9](no special chars)LC_ALL=C bash -c 'head /dev/urandom | tr -dc a-z0-9 | head -c30'
Secure password file for users
-
Option 3: Using
htpasswdand generate given sample password123and save toauthfile withjohnkey name.$ htpasswd -c auth john $ cat auth john:$apr1$VqXa9gLG$pAIL.jm6Ts48QH4RKlX6k0