Hello Sunil
Linux Commands Cheatsheet

Linux Commands Cheatsheet: Basic Linux Commands

12# sudo

It stands for SuperUser Do. sudo command is widely used command for administrative access in Linux environment.

13# apt & apt-get

apt stands for Advanced packaging tool, which is a command line tool to interact with the packaging system in Linux. Whereas, you can use apt-get command to install or remove a package in Linux environment.

Let’s do practice of sudo and apt-get command, which is demonstrated as follows:

If you want to update all the installed packages in your Linux system then use the command sudo apt-get update.

Linux-basic-command-sudo apt-get update-22

Let’s try one more example by installing a text editor such as jed then type the command sudo apt-get install jed.

Linux-basic-command-sudo apt-get install jed-23

14# nano, vi, jed

nano and vi are installed text editors in the Linux environment, however you can use other text editor such as jed too.

For example, if you need to make a new file named helloworld.txt, you can create it by using the command jed helloworld.txt.

Linux-basic-command-nano, vi, jed-24

15# df

The df command stands for disk file system, it is used to get a full summary of available and used disk space usage in Linux environment.

You can just type df in the command line and you can see each mounted partition and their used or available space in % and in KBs.

Linux-basic-command-df-25

But by using df -h command, it will show the file system disk space statistics in human readable format, means it gives the details in bytes(B), megabytes(MB), and gigabyte(GB) and so.

Linux-basic-command-df -h-26

16# du

The du command stands for disk usage, it is used to check the information of disk usage of files and directories in Linux environment.

For example, if you want to know the disk space used by the Asia directory in Linux, you can use the command du Asia.

Linux-basic-command-du-28

17# uname

uname is the short name for Unix name and it prints information about the current system.

But by using the command uname -a prints most of the information about the system. This prints the kernel release date, version, processor type, etc.

Linux-basic-command-uname -a-29

Also Read: How to display Linux distro ASCII logo art in terminal

18# chmod

The chmod command stands for change mode. It is used to change permissions of a given file according to a certain mode which might be a set of octal characters or a set of alphabetical characters.

Each file has a certain set of permissions associated with it. There are three types of permissions that can be associated with a file and they are:

  • Read permissions denoted by ‘r’
  • Write permission denoted by ‘w’
  • Execute permissions denoted by ‘x’

19# hostname

By using hostname command, you can view your system name or assign a new name to your system. Basically, it displays your hostname and IP address.

By typing hostname gives the output name of your system. Whereas, typing in hostname -i gives you your IP address in your network.

Linux-basic-command-hostname-30

20# ping

Ping stand for Packet Internet Groper and is a network administration utility used to check the connectivity status between a source and a destination computer over an IP network.

It also helps you assess the time it takes to send and receive a response from the network. For example, ping google.com, it checks if it can connect to the server and come back.

Linux-basic-command-ping-31

The use of this command for simple users like us is to check your internet connection. If it pings the Google server (in this case), you can confirm that your internet connection is active.

Sunil Pradhan

Hi there 👋 I am a front-end developer passionate about cutting-edge, semantic, pixel-perfect design. Writing helps me to understand things better.

Add comment

Stay Updated

Want to be notified when our article is published? Enter your email address below to be the first to know.

Sunil Pradhan

Hi there 👋 I am a front-end developer passionate about cutting-edge, semantic, pixel-perfect design. Writing helps me to understand things better.