Linux Commands – Basic And Advanced

linux commands

In this modern world which is at the peak of technology and fast access work, we cannot depend upon outdated open-source software. Nowadays, many people are using windows many are using Mac, but we cannot forget the time we all use LINUX.

Linux is a family of free and open-source software operating system built around the LINUX KERNEL. Linux was originally developed for personal computers based on Intelx86 architecture but has since been ported to certain more platforms rather than any other operating system.

Linux development is one of the eminent examples of free and open-source software. The source code can be used, distributed commercially and non commercially by anyone under the terms of its respective license such as GNU, General Public License.

Today, the Linux system is used throughout computing from root computers to supercomputers. Linux was spreading and becoming popular in the netbook market, with customized Linux installed. Linux communities design and distribute the Linux Kernel, with additional package management as Linux distribution. A Linux based system is a Unix-like operating system obtaining much of its design from its principles designed in the 1970s and 1980s.

Also Read: How To Create Backdoor In Kali Linux

A GNU is a key part of the most system based on the Kernel version, Android being a noteworthy exception. The user interface is either a command-line interface, a graphical user interface or control attached to associated hardware which is common for basic systems. Although the CLI is available through terminal emulator windows or on a separate virtual console.

Several types of Window managers exist for X11, tiling, dynamic, stacking and composting.

There are so many Linux commands on which we can operate Linux. Each command has its specific function and the reason behind it. For Example – for searching, process management there are different commands.


  1. ls- Is used for Directory listing.
  2. ls –al- Is used for Formatted listing with hidden files.
  3. ls –lt- Is used for Sorting the Formatted listing by time modification.
  4. cd dir – It is used to Change directory to dir.
  5. cd- It is used to change to the home directory.
  6. pwd- It Shows the current working directory.
  7. mkdir dir-Is used for Creating a directory dir.
  8. cat >file- Places the standard input into the file.
  9. more file-Output the contents of the file.
  10. head file- Output the first 10 lines of the file.
  11. tail file -Output the last 10 lines of the file.
  12. tail -f -file Output the contents of the file as it grows, starting with the last 10 lines.
  13. touch file-It is used to Create or update file.
  14. rm file- It is used for Deleting the file.
  15. rm -r dir-It is used for Deleting the directory.
  16. rm -f file- Force to remove the file.
  17. rm -rf dir- Force to remove the directory dir.
  18. cp file1 file2- It is used to Copy the contents of file1 to file2.
  19. cp -r dir1 dir2- It is used Copy dir1 to dir2;create dir2 if not present .
  20. mv file1 file2- It is used to Rename or move file1 to file2 if file2 is an existing directory.
  21. ln –s file link- It Create a symbolic link to file.

Linux Commands For Process management:

  1. ps- It is used to display the current working processes.
  2. top- It Display all running process.
  3. kill pid- Kill the process with given pid.
  4. killall proc-Kill all the process named proc.
  5. pkill pattern-Will kill all processes matching the pattern.
  6. bg-List stopped or background jobs, resume a stopped job in the background.
  7. fg -Brings the most recent job to the foreground.
  8. fg n -Brings job n to the foreground.

Linux Commands For File permission:

  1. chmod octal file-Change the permission of file to octal, which can be found separately for the user, group, the world by adding,
  • 4-read(r) .
  • 2-write(w).
  • 1-execute(x).

Linux Commands For Searching:

  1. grep pattern file- Search for the pattern in the file.
  2. grep -r pattern dir- Search recursively for a pattern in dir.
  3. command | grep pattern- Search pattern in the output of a command.
  4. locate file- Find all instances of the file.
  5. find-name filename Searches in the current directory (represented by a period) and below it, for files and directories with names starting with the filename.
  6. pgrep pattern -Searches for all the named processes, that matches with the pattern and, by default, returns their ID.

Linux Commands For System Info:

  1. date- Show the current date and time.
  2. cal- Show this month’s calendar.
  3. uptime -Show current uptime.
  4. w Display -who is online.
  5. whoami -Who you are logged in as.
  6. finger user Display information about the user.

7. uname -a Show kernel information

  1. cat /proc/cpuinfo -Cpu information.
  2. cat proc/meminfo- Memory information.
  3. man -command Show the manual for a command.
  4. df -Show the disk usage.
  5. du -Show directory space usage.
  6. free -Show memory and swap usage.
  7. whereis app -Show possible locations of the app.
  8. which app- Show which applications will be run by default.


Also Read: How To Do Man in the Middle Attack in Kali Linux

Linux Commands For Compression:

  1. tar cf file.tar file -Create tar named file.tar containing the file.
  2. tar xf file.tar- Extract the files from file.tar.
  3. tar czf file.tar.gz files- Create a tar with Gzip compression.
  4. tar xzf file.tar.gz -Extract a tar using Gzip.
  5. tar cjf file.tar.bz2 -Create tar with Bzip2 compression.
  6. tar xjf file.tar.bz2- Extract a tar using Bzip2.
  7. gzip- file Compresses file and renames it to file.gz.
  8. gzip -d file.gz Decompresses file.gz back to file.

Linux Commands For Network:

  1. ping host- Ping host and output results.
  2. whois domain- Get whois information for domains.
  3. dig domain Get DNS information for the domain.
  4. dig -x host- Reverse lookup host.
  5. wget file -Download file.
  6. wget –c file- Continue a stopped download.


  1. ctrl+c -Halts the current command.
  2. ctrl+z -Stops the current command, resume with fg in the foreground or bg in the background.
  3. ctrl+d -Logout the current session, similar to exit. 4. ctrl+w -Erases one word in the current line.
  4. ctrl+u -Erases the whole line.
  5. ctrl+r- Type to bring up a recent command.
  6. !! -Repeats the last command.
  7. exit- Logout the current session.


  1. Basic and detailed information. Thank you for the list of Linux commands. I will bookmark this article incase if I forget any of the command or its function.


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.