On this page I'm continously storing useful Linux (not only) commands collected for past decade :).
-
Disk space
du -akd1 | sort -nr | head
lsof
lsof /folder lsof -p 1112 lsof -u user lsof -i TCP:22 losf -i TCP@127.0.0.1
-
netcat
nc -vz[4,6] <ip> <port1-port100> nc -lk <ip> <port> echo "hello" > /dev/tcp/<ip>/<port>
-
Video convert
ffmpeg -nostdin -i input.mov -acodec copy -vcodec libx264 -f mp4 -preset faster output.mp4 requires libavcodec-freeworld package ffmpeg -i input.mp4 -c:v libx264 -crf 28 -vf "scale=1920:-1" -preset faster -movflags +faststart -c:a aac -b:a 128k output.mp4
-
Remove old naming of network cards (ethX)
grubby --update-kernel=ALL --remove-args="net.ifnames=0" grub2-mkconfig -o /boot/grub2/grub.cfg nmtui - edit connection and interface and reboot