Linux is a powerful operating system that become much more manageable when you know your way around the terminal. This cheat sheet will make your day-to-day easier.
Files & Dir Navigation:-
pwd - prints current working directory
ls - list all files and directories
cd - change directory
mkdir - create directory
rmdir - remove directory
File Operations:-
touch filename - create empty file
cp file1 file2 - copy file.
mv old new - move or rename.
rm file - delete file
cat file - view the content of file
less file - view file one page at a time
head -n 10 file - show first 10 lines. modify 10 in command to get required number of lines.
tail -n 10 file - show last 10 lines.
Search & Filter:-
find . -name ".txt" - find files by name
grep "Word" filename - search for the key word in a file
grep -r "word" dir/ - search recursively for a word in directory
System Info and Monitoring:-
uname -a - kernel and system info
df -h - disk space usage
- *du -sh * * - directory size summary
top - live process
free -h - memory usage
uptime - system running time
Networking commands:-
ip -a - show ip address
ping 0.0.0.0 - pings the ip address
curl https://sample.com - make http requests
wget URL - downloads files
netstat -tunlp - show open ports and services
ss -tunl - display listening ports
This linux cheat sheet is a starting point, but real understanding comes from practice. bookmark this page or print out and stick at your desk. stay tuned for more information.
SOCIAL SHARE CARD GENERATOR