Linux One-line Commands
Revision as of 01:07, 30 January 2019 by imported>Jeremy-busk
List of Useful Linux One-line Commands
Common commands used in Linux environments to get shiz done.
Associated commands are indented bullets to master bullet.
Some of these may require root privileges.
- htop
- fping -A -d -a -q -g -a -i 1 -r 0 192.168.1.0/24
- nc -l 1234
- nc 127.0.0.1 1234
- sudo nmap -sS -n -p 22 192.168.0.0/24
- ngrep -d eth0 lo port 5432
- shopt -s expand_aliases
- sudo tcpdump -npi eth0 net 10 and port 80 and port 443
- nft list ruleset
- sar 1 100
- sed -i 's/bad-text/good-text/g'
- sudo python3 -m http.server 81
- lvextend -An -L+5G --resizefs /dev/mapper/fedora_gitlab--runner--shared--1-root
- tmp_dir=$(mktemp -d "mydir".XXXXXXXXXX) || { echo "Failed to create temp file"; exit 1; }
- ip=$(for mac in
virsh domiflist $vm_name |grep -o -E "([0-9a-f]{2}:){5}([0-9a-f]{2})"
; do ip neighbor | grep $mac |grep -o -P "^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}" ; done)