From 06b7c53756bf80bd00bd3aec4e7b1375e2c7e2ae Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Mon, 5 Aug 2024 00:16:08 +0000 Subject: [PATCH] Update cheatsheets --- tldr/doppler | 2 +- tldr/mv | 4 ++++ tldr/nmap | 4 ++-- tldr/read | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tldr/doppler b/tldr/doppler index 23a572ad..8596065c 100644 --- a/tldr/doppler +++ b/tldr/doppler @@ -29,6 +29,6 @@ source: https://github.com/tldr-pages/tldr.git `doppler secrets` -- Open doppler dashboard in browser: +- Open Doppler dashboard in browser: `doppler open` diff --git a/tldr/mv b/tldr/mv index 41e4c63c..d455255c 100644 --- a/tldr/mv +++ b/tldr/mv @@ -35,3 +35,7 @@ source: https://github.com/tldr-pages/tldr.git - Move files in verbose mode, showing files after they are moved: `mv -v {{path/to/source}} {{path/to/target}}` + +- Specify target directory (convenient in situations when the target directory has to be the first argument): + +`ls | {{parallel|xargs}} mv -t {{path/to/target_directory}}` diff --git a/tldr/nmap b/tldr/nmap index c454d88f..2cad2458 100644 --- a/tldr/nmap +++ b/tldr/nmap @@ -17,9 +17,9 @@ source: https://github.com/tldr-pages/tldr.git `nmap -T5 -sn {{192.168.0.0/24|ip_or_hostname1,ip_or_hostname2,...}}` -- Enable OS detection, version detection, script scanning, and traceroute: +- Enable OS detection, version detection, script scanning, and traceroute of hosts from a file: -`sudo nmap -A {{ip_or_hostname1,ip_or_hostname2,...}}` +`sudo nmap -A -iL {{path/to/file.txt}}` - Scan a specific list of ports (use `-p-` for all ports from 1 to 65535): diff --git a/tldr/read b/tldr/read index 459b6403..9b853ecd 100644 --- a/tldr/read +++ b/tldr/read @@ -16,6 +16,6 @@ source: https://github.com/tldr-pages/tldr.git `read -r {{variable}}` -- Read `stdin` and perform an action on every line: +- Read `stdin` or file and perform an action on every line: -`while read line; do echo "$line"; done` +`while read line; do {{echo|ls|rm|...}} "$line"; done < {{/dev/stdin|path/to/file|...}}`