
The Linux Commands With Example is meant to help you learn commands quickly and receive all of the most often used commands today. Linux commands are now used in almost all IT businesses.
Learning these commands will undoubtedly give you the confidence to operate on the Linux operating system.
Table of Contents
List of most widely used Linux Commands
- cat command in linux
- cd command in linux
- cp command in linux
- echo command in linux
- grep command in linux
- head command in linux
- history command in linux
- ls command in linux
- man command in linux
- mkdir command in linux
- mv command in linux
- pwd command in linux
- rm command in linux
- rmdir command in linux
- tail command in linux
- touch command in linux
- tree command in linux
- vi command in linux
- wc command in linux
- wget command in linux
Click here to learn the git commands
Linux Commands examples
The following is a definition of linux basic commands, along with its syntax and examples.
ls command in linux
The ls command is used to display the contents of a directory. The ls command displays a list of files and directories.
ls
cd command in linux
In Linux, the cd command is used to navigate between files and directories. You have the option of either the whole path or the directory name.
These are commands that can assist you in fast navigating.
cd ..(With two dots) To go one directory higher cd To get directly to the home folder cd- (with the hyphen) To return to your previous directory
cp command in linux
You can use the cp command to copy files from your current directory to another directory. The cp command will make a copy of file.txt in the documents directory in this example.
cp file.txt /home/geekcer/documents
rm command in linux
When you wish to delete a file in Linux, you use the rm command.
rm <name of file> rm file1.txt
grep command in linux
On a Linux system, Grep is the most powerful and widely used filter. “Global regular expression print” is abbreviated as grep. When looking for information within a file, this comes in helpful.
<command> | grep <wordToSearch> cat file.txt | grep 2
The grep is commonly associated with pipes.
find command in linux
The find command in Linux is used to identify files based on user-defined parameters.
find . -name "*.jpg"
You can use (.) to refer to the current directory and (/) to refer to the root directory.
cat command in linux
To multitask on Linux, we use the cat command. The cat command can be used to create a file, display its contents, and copy its contents from one file to another.
Aside from that, the cat command may be used to do a wide range of operations.
Create file cat > <name of file> Display file cat <name of file>
mkdir command in linux
To create a new empty file in Linux, we use the touch command. There will be no information in this file. This command may be used from the terminal to quickly create a file in your current working directory.
touch data.txt