Skip to main content

Basic Powerful Linux commands

Linux is a very powerful operating system which is can be used to perform any thing. From Office tesk to Cyber Security task and lots more. Today we are going to look at the core part of Linux operating system which is the command line. 

The command line is an interface that give us the ability to perform task and projects using command instead of GUI (graphical user interface). 

                      COMMANDS

1. ls := stands for list, it is use in listing contents of a directory(folder). it works like Windows view option. 


example let's we say want to see the content of our working directory.  

$ ls 

this will display all the contents of our directory.

 

2.  cd  := change  directory,  This command help to move around in the command line by changing our current working directory to the one placed after the command. 

example let's say we have four directories in home directory (Documents, Videos, photos, Downloads) and we want to go to Downloads 

$ cd Downloads

This will change our current directory to Downloads


3. pwd := print working directory, This command tells us were we are currently. 

example After going  though two or more directories and it seems that you have lost track of where you are just type pwd. 

$pwd

It will print out your current directory name


4. mkdir := make directory, Sometimes it's  good to  create a new directory for your practice. So to create new a directory the mkdir will help. 

$mkdir (directoryname) 

for our practice we are going to create called LA B

$mkdir LAB

use the $ls command to see it. 

Note : when writing directory name doesn't add space instead use underscore(_). 


5. touch := It is used to create files while $mkdir is used to create directory. 

example let's go into our LAB directory and create a new text then use the $ls  command to see it. 

$ cd LAB 

$touch Foo.txt 

$ls


6. less := less is a modern name for a package called more. It is used for viewing text file contents its more like a pdf reader for text files in Linux. 

example let's say we content of our Foo.txt file with less we can do that 

$less Foo.txt 

To quit it press q

Note : It can not be use to view. pdf files. 


7. cat := concatenation trate,  This command is unique is it can be used to perform many things but let's stick to the basic application of it. It is used to perform text concatenation. 

example we want to view two files at the same time. 

$cat Foo.txt Foo2.txt 

it will basically display the content of the two files. I  go deeper into it in my future posts. 


8.  rmdir := remove directory,  it is  used to delete directory.   

example let's say we want to delete LAB directory. 

$rmdir (directoryname) 

$rmdir LAB 

Note : you should be careful with the this command because it deletes directory permanently. 


9. rm - rf := remove,  This command is used for deleting files while rmdir is for directories. it can be used without the  (-rf) extention but it more effective with it. I talk more about in future posts. 

$rm - r(filename) 

or 

$rm (filename) 

$rm -rf Foo.txt 

 

10. man := manual page, It  a text page that Contain all methods and options available for a command. 

$man (commandname)


I hope this post was helpful please comment below for suggestions, thoughts and topics you will like me  to write about. 


Am I very passionate young man who believes that he can change the world with God and Technology

Comments

Post a Comment