50 Basic Linux Commands You Should Know

linux commands
Spread the love

Linux is a fast growing OS and several coders/programmers prefer to work in the underlying interface of Linux. Agreed that it isn’t one of the most user-friendly Operating Systems around but it sure does have its perks.

Here is a list of 50 basic LINUX commands that any coder should know about:

1. vmstat

This command gives a detailed information about all the system statistics and helps users in determining the bottlenecks of the computer/system. It provides an overall layout of processes, memory, paging, block IO, traps, and cpu activity.


  • vmstat[parameters]

Note: Parameters range from switch display, switch slabinfo, etc.

2. chmod

This command is used to administer file permissions.


  • chmod options permissions file name

3. chown

This command sets tabs on file ownership and their ownership changes.


  • chown [-c|–changes] [-v|–verbose] [-f|–silent|–quiet] [–dereference] [-h|–no-dereference] [–preserve-root] [–from=currentowner:currentgroup] [–no-preserve-root] [-R|–recursive] [–preserve-root] [-H] [-L] [-P] {new-owner|–reference=ref-file} file …
  • chown –help
  • chown –version

4. find

The ‘find’ command searches the directory for files dependending on certain parameters until each and every parameter is satisfied. The significance of each parameter is judged on the basis of the rules of precedence. Once the parameters are satisfied, find moves on to the next file in directory.


  • find options starting/path expression

5. cp

This command is used to copy files into a directory.


  • $ cp [options] source dest

6. vi

Enables an editor.


  • vi [ -| -s ] [-l] [-L] [-R] [ -r [ filename ] ] [-S] [-t tag] [-v] [-V] [-x] [-w] [-n ] [-C] [+command | -c command ] filename

7. enable

Enables or disables a printer.


  • enable printer

8. cd

Administers the user’s working path and directory.


  • CD [/D] [drive:][path]

9. sudo

Enables certain user or group of users to access all or some of the functions on a given system.


  • sudo -V | -h | -l | -L | -v | -k | -K | -s | [ -H ] [-P ] [-S ] [ -b ] | [ -p prompt ] [ -c class|- ] [ -a auth_type ] [-r role ] [-t type ] [ -u username|#uid ] command

10. netstat

Displays all of the data structure constraints in symbolic manner.


  • NETSTAT [-a] [-b] [-e] [-f] [-n] [-o] [-p proto] [-r] [-s] [-x] [-t] [interval]

11. cron

Scheduling of tasks.

12. traceroute

Identifies network/router problems and also sets a route to the remote host.

13. rsync

Syncs data from one disk location to another.


  • rsync [OPTION…] SRC… [DEST]

14. df

Determines the system usage of disk space and displays available space.


  • df [OPTION]… [FILE]…

15. pwd

Shows the name of the directory on which the user is currently working.


  • pwd [OPTION]…

16. rpm

Red Hat Package Manager (RPM) is used for installing, uninstalling, verifying, querying and updating computer software packages.


  • rpm {-q|–query} [select-options] [query-options]
  • rpm {-V|–verify} [select-options] [verify-options]
  • rpm –import PUBKEY
  • rpm {-K|–checksig} [–nosignature] [–nodigest] PACKAGE_FILE

17. grep

Searches for a certain number of files by setting tabs on a particular character string or pattern.


  • grep [options] pattern [files]

18. ls

Displays information of all the files in a certain directory.

19. man

This command displays keywords on commands and also the list of all commands.

20. neat

It is a GNOME GUI admin tool.

21. cat

Assembles or concatenates two or more strings together.


  • cat [s1] [s2]…

22. mv

Moves file from one directory to another. Users can also rename their files before moving them.

23. cpio

This command lets users to back their void files up.

24. ping

Ping command is used to establish whether the connection between multiple systems is stable or not and displays the average round trip time and the percent packet loss.

25. ifconfig

Checks the inner configuration table of a system to outstand any possible errors.

26. ssh

Used to ensure a secure connection on a server.


  • ssh sample.ssh.com

27. tar

Tar provides a wider option of manipulation among system archives by creating certain tar archives. Tar can be used on previously created archives to extract files, store additional files, or update or list files.


  • tar [-] A –catenate –concatenate | c –create | d –diff –compare | –delete | r –append | t –list | –test-label | u –update | x –extract –get [options] [pathname …]
  • tar –create –file=archive.tar file1 file2
  • tar -c -f archive.tar file1 file2
  • tar -cf archive.tar file1 file2
  • tar cf archive.tar file1 file2

28. alias

Allows to set a “nickname” for longer terms of strings which can be later used as substitutions.

29. apt-get

A program that searches for and installs software packages on Debian-based systems.

30. Aspell

It checks for misspelled words and replaces them.

31. awk

Enables substitution of small piece of codes by setting them as patterns and embling them into statements.

32. bzip2

Compresses file size of backed up files into directories.

33. cmp

Compares files in a directory and lets users know when two or more files are identical.


  • cmp [file1] [file2] …

34. comm

This command is used for sorted files to identify the identical lines in two or more files and delete them.


  • comm [OPTION]… FILE1 FILE2

35. declare

Initialises variables and assign certain attributes.


  • DECLARE { @local_variable [AS] data_type [ = value ] }

36. echo

It allows users to personalise the output to their taste.


  • type echo

37. eval

This command is used when you have a certain value assigned to a variable and you want to execute the command stored in the variable.


  • $ COMMAND=”ls -lrt”

$ eval $COMMAND

38. exec

Exec is used to execute certain commands instead of the current working command.

39. exit

Exits a program.


Export is used when the value of a certain asset is to be used across various sub-processes in a single shell.

41. free

Frees up space by integrating files occuping unnecessary space.

42. gzip

Compresses data into files.

43. ifup

Starts up a network interface.

44. ifdown

Shuts down network interface.

45. less

Administers through log file errors and configuration troubles.

46. netconfig

Determines overall configuration statistics of a system.

47. screen

Enables the use of a single terminal window to run multiple terminal applications.

48. sed

Filters text.

49. shutdown

Shuts the system.


  • shutdown [OPTION] …

50. snort

Determines the system utilization.


Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe to our Newsletter

Stay updated with our weekly newsletter

Subscribe to our newsletter