find all large files in the root filesystem
find / -xdev -type f -size +100M
OR
find / -xdev -type f -size +100M -exec ls -la {} \; | sort -nk 5
OR
find / -xdev -type f -size +100M -exec du -sh {} ';' | sort -rh | head -n50
install netstat on centos 7
yum -y install net-tools
iptables --list -n
ip6tables --list -n
list open sockets of a pid
lsof -p {pid} | egrep 'TCP|UDP'
tcpdump of source / destination
tcpdump -i {interface_name} -vvv | grep {destination_host}
nc -4zv {ipv4_address} 22
nc -6zv {ipv6_address} 22
process with swap usage in decending order
for file in /proc/*/status ; do awk '/VmSwap|Name|\yPid\y/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 3 -n -r | less
lsblk
ls -l /dev /dev/mapper |grep '^b'
lshw -short
syntax check the script without running
bash -n {scriptname}
split -l 15000 file_name new_file_name -da 2
deleting file held by a process
lsof +L1; cd /proc/{pid}/fd; ls -l |grep deleted; >{file_descriptor}
screen -S my_screen
Ctrl+a d
screen -ls
screen -r my_screen