Linux/Shell Command Reference

Linux Common command Quick Reference, and

ls -la ()
cd /path/to/dir
pwd
mkdir -p dir/sub
cp -r src/ dest/ Copy
mv old new /
rm -rf dir/ ()
ln -s target link
find . -name "*.log"
tree -L 2

cat file.txt
head -20 file.txt 20
tail -f log.txt
less file.txt ()
grep -rn "pattern" .
wc -l file.txt
sort file.txt | uniq
diff file1 file2

chmod 755 script.sh
chmod +x script.sh
chown user:group file
whoami
sudo command root
su - username

ps aux
ps aux | grep name
kill PID ()
kill -9 PID
top / htop
nohup cmd & ()
jobs / fg / bg

curl -s url HTTP
curl -X POST -d 'data' url POST
wget url
ping host
ss -tlnp
netstat -tlnp ()
ip addr IP
ssh user@host

df -h
du -sh dir/
du -sh * | sort -rh | head /
mount /dev/sdb1 /mnt
lsblk

tar -czf file.tar.gz dir/ .tar.gz
tar -xzf file.tar.gz .tar.gz
tar -xzf file.tar.gz -C /dest/
zip -r file.zip dir/ .zip
unzip file.zip .zip

uname -a
cat /etc/os-release
free -h
uptime and
date
env

cmd > file ()
cmd >> file
cmd 2>&1
cmd1 | cmd2 :
cmd < file
cmd > /dev/null 2>&1