DEV Community

Cover image for Linux cheat sheet for day-to-day actions...!!!
Shiva Krishna beepeta
Shiva Krishna beepeta

Posted on

Linux cheat sheet for day-to-day actions...!!!

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:-

  1. pwd - prints current working directory
  2. ls - list all files and directories
  3. cd - change directory
  4. mkdir - create directory
  5. rmdir - remove directory

File Operations:-

  1. touch filename - create empty file
  2. cp file1 file2 - copy file.
  3. mv old new - move or rename.
  4. rm file - delete file
  5. cat file - view the content of file
  6. less file - view file one page at a time
  7. head -n 10 file - show first 10 lines. modify 10 in command to get required number of lines.
  8. tail -n 10 file - show last 10 lines.

Search & Filter:-

  1. find . -name ".txt" - find files by name
  2. grep "Word" filename - search for the key word in a file
  3. grep -r "word" dir/ - search recursively for a word in directory

System Info and Monitoring:-

  1. uname -a - kernel and system info
  2. df -h - disk space usage
  3. *du -sh * * - directory size summary
  4. top - live process
  5. free -h - memory usage
  6. uptime - system running time

Networking commands:-

  1. ip -a - show ip address
  2. ping 0.0.0.0 - pings the ip address
  3. curl https://sample.com - make http requests
  4. wget URL - downloads files
  5. netstat -tunlp - show open ports and services
  6. 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.

Top comments (2)

Collapse
 
darshan_rathod profile image
Darshan Rathod

Nice blog.
Try this one:

history

Enter fullscreen mode Exit fullscreen mode

It will list down all your commands that you've used.

Collapse
 
shiva_beepeta profile image
Shiva Krishna beepeta

Sure thanks for your suggestion. will create a new blog for some advanced linux utils