Voiced by Amazon Polly |
Linux commands are powerful tools that can help you manage your system efficiently. Whether you’re a beginner or an experienced user, these commands are essential for navigating and controlling your Linux environment. Here are the top 10 Linux commands with examples:
Customized Cloud Solutions to Drive your Business Success
- Cloud Migration
- Devops
- AIML & IoT
1. ls
The ls command lists the contents of a directory.
There are lots of options that are available with this command that can generate the output in a way we want it. Some of the important options are :
$ls -l
This command gives a long listing of the file and directory names including the type of file, size, number of links etc. This lists files in long format, showing permissions, owner, size, and modification date.
1 |
$ls -a |
Displays all files including hidden files ( files that start with a .(dot) for a file name )
1 2 3 |
$ls – R – list files and directories recursively including subdirectories $ls -I – list the inode number of each file and directory |
2. cd
The cd command changes the current directory.
Example:
1 |
cd test |
This changes the current directory to test
$cd – with no argument takes you to the home directory
$cd.. – takes you to the parent directory
$cd ../.. – takes you to the parent directory of the parent directory
3. pwd
The pwd command prints the current working directory.
Example:
1 |
$pwd |
This displays the full path of the current directory.
4. mkdir
The mkdir command creates a new directory.
Example:
1 |
$mkdir projects |
This creates a directory named projects.
Mkdir command can be used to create a tree like directory structure in a single command.
1 |
mkdir dirA dirA/dirB dirA/dirC |
In the above command a directory called dirA gets created and under it, directories dirB and dirC get created in a single command
5. rm
The rm command removes files or directories.
Example:
1 |
rm -r testdir |
This removes the directory testdir and its contents recursively
6. cp
The cp command copies files or directories.
Example:
1 |
cp file.txt backup |
This copies file.txt to the backup directory.
7. mv
The mv command moves or renames files or directories.
Example:
1 |
mv document.txt Documents |
This moves document.txt to the Documents directory.
8. touch
The touch command creates an empty file or updates the timestamp of an existing file.
Example:
This creates an empty file named newfile.txt.
1 |
touch newfile.txt |
9. cat
The cat command concatenates and displays file content.
Example:
1 |
cat file.txt |
This displays the content of file.txt.
10. echo
The echo command displays a line of text.
Example:
1 |
echo “Welcome to Linux” |
This prints “Welcome to Linux” to the terminal.
These are some of the useful linux commands. It gives greater power and efficiency to work with and get better results.
Get your new hires billable within 1-60 days. Experience our Capability Development Framework today.
- Cloud Training
- Customized Training
- Experiential Learning
About CloudThat
CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, and Google Cloud Platform Partner, CloudThat has empowered over 850,000 professionals through 600+ cloud certifications winning global recognition for its training excellence including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 12 awards in the last 8 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, IoT, and cutting-edge technologies like Gen AI & AI/ML. It has delivered over 500 consulting projects for 250+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.
WRITTEN BY Vani Chakraborty
Comments