Basic Linux Commands

Basic Linux Commands

Basic terminal commands everyone must know!

1. echo πŸ”Š

echo is the command used to print a line of text, the word you enter after the echo command will be printed on your screen.

2. ls πŸ“ƒ

ls command is used to list all the contents of a directory.

The photo below shows all of the files inside the ~ directory.

ls -a

a stands for all. The ls -a command lists all of the files inside the current directory, including hidden files.

3. cd πŸ“ ➑️ πŸ“

cd command stands for change directory and it is used to navigate to new directories in the system.

3. pwd πŸ—ΊοΈ

pwd command or the present working directory command is used to print the directory you are currently in.

4. mkdir πŸ“

mkdir or make directory used to create a new directory.

5. rm 🫑

rm command is used to delete files within a directory.

6. cp ©️

To copy one file to another file and their content use cp command.

cp [source] [destination]

7. touch πŸ“ƒ

touch command is used to create a new file.

8. cat πŸ“

To add some content to the file use cat command.

Press ctrl + d to exit from the prompt.

To read the contents of the file run cat command followed by the filename.

9. mv ↗️

To move a file which is similar to cutting and pasting a file to a different location using the mv command. You also rename a file in the same way, no separate command is present to rename.

10. man πŸ§”β€β™‚οΈ

man command is used to display the user manual of any command that we can run on the terminal.

11. sudo πŸ—οΈ

Finally, If you prefix sudo with any Linux command, it will run that command with elevated privileges. You'll be required to enter your password to execute these commands.

Thanks! for reading this blog :)

Hope this blog will help you!πŸ‘

Follow me on Hashnode, LinkedIn and Twitter.

Β