Basic linux commands for beginners
linux

25 Basic Linux Commands For Beginners With Example

Basic linux commands for beginners tutorial is designed for beginners.If you are a beginner and want to learn and understand the basic linux commands easily then this tutorial is for you.
 
The linux is a flavor of Unix.So its offer all the feature that Unix has.There are various linux variants known as linux distributions.Ubuntu,Fedora,Open Suse,Linux mint are some of the examples.To learn how to use linux,the linux commands are very important.

Learning the basic commands for beginners are very important.So you can easily get the benefits of the features of linux.

Here are some of the best features of linux.

 
  • The best feature of linux is that it is open source operating system.
  • Linux is powerful,flexible and very light weight program.
  • It is very fast and can be used in low specifications
  • Several people can use a linux computer at the same time,hence linux is called a multiuser system.
  • A user can also run multiple programs at the same time,hence linux is a multitasking environment.
  • Linux has lots of distributions.So you can choose what suits your job best.
Linux is a wide area topic.Lot of things to know and lots of thing to learn.The linux command is very important for learning the use of linux.Here 25 basic linux commands that will help you to learn linux if you are a beginner.

Basic Linux Commands For Beginners With Example:

 
(1) ls- The ls commands helps to listing files and directory
 
ls command in linux

 

(2) cd-This command used for change directory
cd command in linux
 
 
(3) mkdir- To create a directory this is used.In unix a path of folder or single folder treat as a directory.
mkdir command in linux’

(4) cat-To create a file cat command with a > symbol is used.

The cat command create a file and opens the editor mode.We can write anything on this fie.Press clt+d to exit from the editor.
 
Ex- cat >abc.txt

cat  > command in linux
 
cat abc.txt where abc.txt is the file name used to show the context of the file.Note that here we do not use > symbol.Use space between cat and file name.

cat command in linux
cat command in linux
cat linux command to show data of a file
 
cat >> mnp.txt – This comand used for apend a file.
We can add any data but can’t modify any data.
 

"cat

cat linux command for add data in a file
 
(5) touch- This command just create a text file.
touch command in linux
touch command in linux
touch command in linux
 
(6) vi- To edit a file we need vi editor.

vi command in linux
vi command in linux
vi command in linux

To open a file and edit it we use vi command.

Use space between vi and filename.
Press i to insert any data.
 
vi command to edit a file in linux



(7) rm filename-This command used for delete a file.Use rm following with a space and put the filename you want to delete.
 
 
rm command in linux
rm command in linux
rm command in linux

 

(8) rmdir directory_name- To delete a directory use rmdir following with a space and put the directory name.

 

rmdir command in linux
rmdir command in linux
rmdir command in linux to create a directory
 
 
(9) wc file_name- To count the number of line,word,character of a file this comand used.The information will be used by following format
Line        Word        Character

 

wc command in linux
wc command in linux
wc command in linux
This are the advance option to use the wc command.
 

wc -l file_name –  To show the text

wc -l command in linux
wc -l command in linux
wc -l command in linux

wc -c file_name-  To show the character
 
wc -c command in linux
wc -c command in linux
wc -w command in linux

wc -w file_name- To show the word 
 
wc -w command in linux
wc -w command in linux
wc -w command in linux

Note:
Use spcae between wc and -l,-c,-w
 
(10) cal- To show the date as a calendar
 
cal command in linux
cal command in linux
cal command in linux


This are the advance option to use the cal command
cal yearTo show the current year calendar

cal year command in linux

cal command example in linux


cal month year-To show the particular month in calendar format of a particular year.

cal month year command in linux
cal month year command in linux
cal command example in linux


(11) who-This command will show how many users are logged in

who command in linux


(12) who ami i
-This command will show the current user


who am i command in linux


(13) chmod-this command use to set permission of a file for a user.There are three types of permission that is Read,Write,Execute.This permission set using o,w,x.
The syntax of chmod is [reference] [operator] [mode] file_name

Where references means

u-owner
g-group
o-others
a-all

Where operator means

operator 
      +                            add this modes
      –                             remove this mode
      =                            modes specified are to be made
                                    the exact modes for the specified
                                    classes

Where mode means

r –  read permission
w- write permission
x-  execute permission

You can also use this technique for set permission
4->Read
2->Wrire
1->Execute

Example- chmod o-w+x sample.txt

chmod example in linux


(14) sh-To run a shell program or scripts sh command we use sh command.To run a shell scripts place the sh command before the shell script.

Example-sh prog.sh

sh command in linux





(15) sudo- the sudo command stands for superuser do.This command used when you need to do a job in root level.

Example-sudo passwd root

sudo command in linux

this command will create a root user


(16) manThe man command known as a manual command.This command will show the inputted command.

 

man command in linux

Example- man cd

man command example in linux


(17) locate-The locate command kown as a find command in linux.To find a command in linux OS you can use the locate command.

Example- locate file_name

locate command in linux


(18)cp- This command used for copying a file from one directory to another

Example- cp xyz.txt abc.txt
This command will copy the xyz.txt file content to abc.txt

cp command in linux


(19)clear-The command exactly use does what is means.The clear command clears the screen when there are so many commands and readouts.Just type the clear on the screen and you will get a clear screen.

Example- clear

clear command in linux


(20)exit – This command exit a shell scripts.

exit command in linux
 

(21)ifconfig- This command used for configuring a linux system interface.

ifconfig command in linux

(22) iw- This command used to manage wireless device and their configuration.

iw command in linux

 

(23) last-This command shows the last logged in user
 
 
last command in linux
 
(24) login- login command is used to create a new session with the system.You will be asked a add a user name and password.Note that some OS need root user to use this command.So you have to log in as a root before this command.

 

login command in linux


(25) su- The su command is used to switch to another user or become root user during a session.You will be asked to add user name and password to log in.
 
su command in linux

All of this 25 basic linux commands are very useful for beginners.This commands used almost everyday.You can learn more about linux by simply bookmark us and visit us.

Do you want more useful command or have some suggestion for this command list.Let us know know by commenting below.Please support us by liking our Facebook page.

Sharing is caring!

Leave a Reply

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