Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
Categories of Linux Commands
3.
Explanation of Commands
4.
pwd
4.1.
mkdir Command
4.2.
rmdir Command
4.3.
ls Command
4.4.
cd Command
4.5.
touch Command
4.6.
rm Command
4.7.
cp Command
4.8.
tac Command
4.9.
more command
4.10.
id Command
4.11.
cat Command
4.12.
date Command
4.13.
cal Command
4.14.
sleep Command
4.15.
time Command
4.16.
exit Command
4.17.
clear Command
4.18.
ip Command
4.19.
ping Command
4.20.
host Command
5.
Frequently Asked Questions
5.1.
How to write in a file in a Linux terminal?
5.2.
How do you insert text in a file in Linux?
5.3.
Is Linux a kernel or OS?
5.4.
What kind of software is Linux?
5.5.
Is Linux written in C or C++?
6.
Conclusion
Last Updated: Mar 27, 2024
Easy

Linux Utilities

Author Yashi Agarwal
0 upvote
Master Python: Predicting weather forecasts
Speaker
Ashwin Goyal
Product Manager @

Introduction

A utility of the Linux OS is the Linux Command. All primary and advanced tasks can be done by executing commands. The commands are performed on the Linux terminal. The terminal is a command line similar to the command prompt in Windows OS. Commands in Linux are case-sensitive.

It provides a powerful command-line interface compared to other OS like macOS and Windows. We can do basic and advanced work by using its terminal. We can do tasks such as creating, deleting, moving a file, etc. Also, we can do advanced tasks like administrative tasks (including package installation and user management), networking tasks (ssh connection), and many more.

Categories of Linux Commands

  • Linux Basic Commands
  • Commands for Working with Files
  • Commands for Working with Directories
  • Commands for Working with User Permissions
  • Commands for Working with Zipped Files
  • Working with Secure Shell For Remote Machine Access

Linux provides a CLI (Command Line Interface) to communicate with the OS. Here are the most used Linux Commands.

Also see, gzip command in linux

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Explanation of Commands

pwd

This command displays the current working directory.

Syntax:

pwd 
pwd

mkdir Command

The above command is used to create a directory under any directory.

Syntax:

mkdir<directory name>
mkdir

rmdir Command

The above command is used to delete a directory.

Syntax:

rmdir <directory name>
rmdir

ls Command

The ls command displays a list of the content of a directory.

Syntax:

ls
is

cd Command

The above command is used to change the current directory.

Syntax:

cd <directory name> 
cd

touch Command

The above command is used to create empty files. We can create multiple empty files by running it only one time.

Syntax:

touch <file name>  
touch <file1>  <file2> ....  
touch

rm Command

The above command is used to remove a file.

Syntax:

rm <file name>
rm

cp Command

The above command is used to copy a file or directory.

Syntax:

To copy in the same directory:

cp <existing file name> <new file name>  

To copy in a different directory:

cp

tac Command

The above command is the reverse of the cat command. It displays the content of a file in reverse order (bottom to top).

Syntax:

tac <file name>
tac

more command

The above command displays the file content like the cat command. The difference is that, in the case of larger files, more command displays screenful output at a time.

Syntax:

more <file name> 
more

id Command

The above command displays the user ID and group ID (GID)

Syntax:

id
id

cat Command

The above command is also used as a filter. To filter a file, it should be used inside pipes.

Syntax:

Enter file content  
To Save click Ctrl+D

cat <file name> 
cat

date Command

The above command displays the date, time, time zone, and more

Syntax:

date  
date

cal Command

The above command is used to display the current month's calendar and date

Syntax:

cal
cal

sleep Command

The above command holds the terminal for a specified amount of time. By default, it takes time in seconds.

Syntax:

sleep <time>
sleep

time Command

The above command is used to display the time.

Syntax:

time
time

exit Command

Linux above command is used to exit from the current shell. 

After executing the command, the terminal will get excited.

Syntax:

exit 
exit

clear Command

Linux above command is used to clear the terminal screen.

Syntax:

clear
clear

After this terminal’s screen will get cleared.

ip Command

Linux above command is an updated version of the ipconfig command. It is used to assign an IP address, initialize an interface, and disable an interface.

Syntax:

ip a or addr
ip

ping Command

The above command checks the connectivity between two nodes and whether the server is connected.

Syntax:

ping <destination>
ping

host Command

The above command returns the IP address of a given domain's name and vice versa. 

Syntax:

host <domain name> or <ip address>
host

We have covered almost every Linux Utilities or command with their implementation

Frequently Asked Questions

How to write in a file in a Linux terminal?

In a Linux terminal, to write text in a file, use the >> and > operators.

How do you insert text in a file in Linux?

 The >> to append text to the end of the file is used. It is also helpful to redirect and append/add lines to the end of files on Linux or Unix-like systems.

Is Linux a kernel or OS?

Linux is an open-source OS that is made of a kernel.

What kind of software is Linux?

Open-source operating system

Is Linux written in C or C++?

Linux is also written mainly in C, with some parts in an assembly. About 97 percent of the world's 500 most powerful supercomputers run the Linux kernel.

Conclusion

In this article, we have learned about some basic Linux utilities. We have discuss why to use it and how we can use it. We have discussed some very used commands. To learn more about Linux Utilities, check the link below:

Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. Enroll in our courses and refer to the mock test and problems available. Take a look at the interview experiences and interview bundle for placement preparations.

Keep Coding!

Previous article
Linux Environment
Next article
Linux Security
Live masterclass