25 Basic Linux Commands For Beginners.

25 Basic Linux Commands For Beginners.

It is not that easy getting used to and learning Linux commands. There’s no secret code to learning Linux in a single day or two simple but to exercise, fail, stand up and exercise again and acquire from your mistakes. The simplest method to learn Linux is not to quit it if you don’t know how it works. In this article, we will examine some of the basic Linux commands for beginners.

This Linux terminal commands list contains all the common commands. Treat it as a Linux command cheat code as it includes nearly all the basic commands to get you ignited.

Basic Linux Commands For Beginners

1. mkdir

The command “mkdir” in Linux is practiced to generate a new directory or if you’re coming from Windows, a Folder. For example,

mkdir folder_name

2. echo

The command “echo” is applied to display text that is established after the space in the command.

[email protected]:~$ echo techdashy

techdashy

This command might resemble inefficient, but it is practiced in debugging code and discovering the program’s state.

3. pwd

The command PWD aka, Print Working Directory that delivers a quick way of finding out the working directory path.

[email protected]:~$ pwd

/home/techdashy

4. cd

Cd stands for change directory as the name recommends, it is practiced to briefly modify the directory you’re operating in.

[email protected]:~$ cd /Desktop
[email protected]:~/Desktop$

5. cp

The command cp is used to copy and paste a file to a directory specified as the second argument.

[email protected]:~/Desktop$ cp 1.txt /home/techdashy/documents

In the above command, “1.txt” is the file that we copy to the directory “/home/techdashy/documents”

6. mv

The command named “mv” in Linux stands for “Move” is practiced to move files or directories from one place to another. Consider a file “abc” and to move it to the Documents folder, all we need to do is:

[email protected]:~/Desktop$ mv abc/home/techdashy/Downloads

7. man

The command named “manual page (man)” is similar to software documentation utilizing which you can know what a particular command does and how it works:

[email protected]:~$ man cp

CP(1)                            User Commands                           CP(1)

NAME
       cp - copy files and directories

SYNOPSIS
       cp [OPTION]... [-T] SOURCE DEST
       cp [OPTION]... SOURCE... DIRECTORY
       cp [OPTION]... -t DIRECTORY SOURCE...

DESCRIPTION
       Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

       Mandatory  arguments  to  long  options are mandatory for short options too.

       -a, --archive
              same as -dR --preserve=all

       --attributes-only
              don't copy the file data, just the attributes

       --backup[=CONTROL]
 Manual page cp(1) line 1 (press h for help or q to quit)

8. ls

The ls command is practiced for listing the contents of a directory.

[email protected]:~$ ls

Downloads      Public   Documents
snap          Templates  Videos
Music        Pictures    VMs

9. cat

The cat command is practiced to print or consolidate the content from the line where the first file ends. This command merges two files and create a new file or merge them into any two files would be.

cat fileA fileB > fileC

10. rm

One of the basic Linux commands for beginners “rm” is used to remove files and directories. You’ll need both rm and -r (recursive) to remove a directory.

rm abc.txt #removes the file named abc.txt
sudo rm -rf directory_name #removes the directory

11. apt

One of the basic Linux commands for beginners, Apt, Advanced Packaging Tool is one of the most popular and powerful package managers for Ubuntu/Debian. A package manager essentially automates the process of installing and removing applications.

For instance, the command written below installs the flameshot application, which is one of the most popular screenshot tools on Linux.

sudo apt install flameshot

12. chown

One of the basic Linux commands for beginners, “chown” is used to transfer the ownership of files. Let’s imagine there’s a file named fileA and you’re a userA. Now you want to transfer the ownership to userB.

[email protected]:~$ chown userA fileA.txt

13. passwd

As the name suggests the command named “passwd” command is practiced to change the password of the user account. To practice it, type passwd followed by the username.

[email protected]:~$ passwd techdashy

14. clear

Yes, you guessed it right. The command “clear” is practiced to clear the terminal screen.

[email protected]:~$ clear

15. wc

The “wc” command is practiced to compute the number of lines (-l), words (-w), bytes (-c), and characters (m).

[email protected]:~$ wc -l abc.txt
23 abc.txt

16. history

The history command is practiced to display the commands that you’ve entered.

[email protected]:~$ history

17. weget

The command wget is a convenient command that can assist you to download files from the internet. Here’s how to use it:

wget "download link"

18. zip/ unzip

Zip is practiced to generate a new zip file, whereas Unzip is practiced to unzip zipped files. Here’s how you Zip and Unzip commands.

[email protected]:~$ zip newzipfile.zip fileA.txt fileB.txt
[email protected]:~$ unzip newzipfile.zip

19. reboot

As the name says it, the reboot command is practiced to reboot, shut down, or halt the system.

reboot

20. netstat

The netstat command can be used to check the network statistics, interface statistics, routing table information, and much more.

$ netstat

21. chmod

One of the basic Linux commands for beginners, the command chmod is practiced to change the read (-r), write (-w), and execute (-x) instructions of a file. For instance,

chmod 742 program.sh

Here’s what the numbers mean.

NumberPermissionRepresentation
0No Permissions
1Execute Permission–x
2Write Permission-w-
3Write and Execute-wx
4Read Permissionr–
5Read and Executer-x
6Read and Writerw-
7Read, Write, and Executerwx

22. locate

Similar to the search command in Windows OS, the command locate is practiced to locate files in Linux.

$ locate fileA.txt
/home/focusblast/Desktop/fileA.txt

23. sudo

One of the basic Linux commands for beginners that you will use the most is Sudo which means SuperUser Do, using which you can play with the files that need root permissions.

24. nano

One of the basic Linux commands for beginners, Nano is everyone’s beloved text editor in Linux. If you want to open up a text file, you can typewrite “nano” and then “filename” if you’re in the directory where the file is present to present it up.

Once you do that, editing the text file, press the key sequence “Ctrl+O” to write the changes and “Ctrl+X” to exit. To learn more about Nano, you can also move to the help section by pressing “Ctrl+G.”

25. exit

The command exit can be practiced to close the terminal quickly.

exit

The above commands are just the teaser of the whole film. There’s a lot more to learn in Linux than what reaches the eye. To gain in-depth knowledge of Linux and make a career out of it, we recommend reading this free book.

Here, we have provided you an overview of the 25 Basic Linux Commands For Beginners. Now, it is up to you to take the next step. If you have any queries regarding the following topics, please feel free to ask us in the comment section down below. Don’t forget to share it with your friends if you find it helpful.

You may also want to read: 16 Useful Windows Command Prompt Tricks You Might Not Know

Leave a Reply

Your email address will not be published. Required fields are marked *