Готовые команды под частые задачи — без разбора синтаксиса, только команда и что она делает.
kill -9 $(lsof -t -i:8080)
awk '{print $1}' access.log | sort | uniq -c | sort -rn | head -10
find /var/backups -type f -mtime +30 -delete
for f in *.jpeg; do mv "$f" "${f%.jpeg}.jpg"; done
tar czf backup-$(date +%F).tar.gz /etc /var/www
find . -type f -exec du -h {} + | sort -rh | head -10
python3 -m http.server 8000
ss -lnt | grep -q ':8080 ' && echo занят || echo свободен
grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' app.log | sort -u
curl -s https://api.example.com/data | python3 -m json.tool
tail -f app.log | grep --color=always -E 'ERROR|$'
for ip in 192.168.1.{1..254}; do
ping -c1 -W1 $ip &>/dev/null && echo "живой: $ip" &
done; wait
while read -r h; do ping -c1 -W1 "$h" &>/dev/null && echo "$h up"; done < hosts.txt
find . -type f -exec md5sum {} + | sort | uniq -w32 -d
openssl rand -base64 16
echo -n "text" | base64
echo "dGV4dA==" | base64 -d
git commit --amend --no-edit
du -h --max-depth=1 . | sort -rh
grep -rl "old_value" . | xargs sed -i 's/old_value/new_value/g'
watch -d -n1 'ls -la /var/www/uploads'
sudo lsof -i :443
curl -C - --retry 5 -O https://example.com/file.zip
docker image prune -af --filter "until=240h"
rsync -avz --exclude='.git' --exclude='node_modules' src/ dest/
kill -STOP pid # заморозить
kill -CONT pid # продолжить
flock -n /tmp/myscript.lock -c "./myscript.sh"
dd if=/dev/zero of=testfile bs=1M count=1024 oflag=direct
tail -n 1000 app.log > app.log.tmp && mv app.log.tmp app.log
diff /etc/hosts <(ssh remote-host cat /etc/hosts)
sort a.txt b.txt | uniq -d
sort a.txt b.txt b.txt | uniq -u
awk '{ x += $3 } END { print x }' access.log
egrep -o 'user_id=[0-9]+' access.log | cut -d= -f2 | sort | uniq -c | sort -rn | head
cat hosts.txt | xargs -I{} ssh root@{} uptime
export EDITOR=vim # в .bashrc, дальше ctrl-x ctrl-e в любой момент
openssl req -x509 -nodes -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -subj "/CN=localhost"
echo | openssl s_client -connect host:443 -servername host 2>/dev/null | openssl x509 -noout -enddate
sudo ss -tulpn
grep -oE '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}' file.txt | sort -u
docker system prune -af --volumes
find / -xdev \( -perm -4000 -o -perm -2000 \) -type f 2>/dev/null
git branch --merged main | grep -v '\*\|main' | xargs -r git branch -d
sudo iftop -i eth0
ps aux --sort=-%mem | head -11 | awk '{printf "%-10s %-6s %-6s %s\n", $1,$2,$4,$11}'
for u in $(cut -d: -f1 /etc/passwd); do echo -n "$u: "; sudo chage -l "$u" 2>/dev/null | grep "Password expires"; done
until command; do sleep 2; done
curl -s https://example.com | grep -oE 'href="[^"]+"' | cut -d'"' -f2
find . -type f -exec sha256sum {} + | sort > sums.txt && sha256sum -c sums.txt