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 a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.
CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 850k+ professionals in 600+ cloud certifications and completed 500+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training Partner, AWS Migration Partner, AWS Data and Analytics Partner, AWS DevOps Competency Partner, AWS GenAI Competency Partner, Amazon QuickSight Service Delivery Partner, Amazon EKS Service Delivery Partner, AWS Microsoft Workload Partners, Amazon EC2 Service Delivery Partner, Amazon ECS Service Delivery Partner, AWS Glue Service Delivery Partner, Amazon Redshift Service Delivery Partner, AWS Control Tower Service Delivery Partner, AWS WAF Service Delivery Partner, Amazon CloudFront Service Delivery Partner, Amazon OpenSearch Service Delivery Partner, AWS DMS Service Delivery Partner, AWS Systems Manager Service Delivery Partner, Amazon RDS Service Delivery Partner, AWS CloudFormation Service Delivery Partner, AWS Config, Amazon EMR and many more.
WRITTEN BY Vani Chakraborty
Comments