Header Ads Widget

Responsive Advertisement

Ticker

10/recent/ticker-posts

Linux Commands for files and directories

Commands 

A Linux command is a series of characters that you type. These characters consist of words separated by white spaces. This first word is the command itself and the rest are the command's arguments. The arguments provide information that the command may need for its execution. Linux commands are case-sensitive. 

Commands are issued to the shell at the command line. A command line comprises of commands, the line of instructions,options and any command line arguments that you may provide.

For example the following is a command line.

$ man cp

File Handling in Linux 

Each directory or file in Linux is referred to, by using its path-name beginning form the root directory.

/ ( root ) - It represents parent/ Admin directory.

Fig :- Present / admin directory

~ ( user ) - It represents user / child directory. 

Fig :- Child / user directory

 Basic Linux commands 

$ pwd :- 

 pwd stand for " Print Working Directory". It prints the path of the working directory or current working directory , stating form the root. 

Fig :- pwd command
$ ls :-   

The ls is the List command in Linux. It will show the full list or content of your directory. just type ls and press the enter key. The whole content will be shown. 

Below, you can see, after entering ls command,

Fig :- ls Commands

 $ cd :- ( Moving to a different directory ) 

cd command in Linux known as change directory command. It is used to change current working directory into another working directory. 

Syntax :- 

$ cd [ directory ]

To move inside a sub-directory : to move inside a sub-directory in Linux we use

 $ cd [ directory_name ]

go to another directory using command cd [ directory_name ]. directory_name where you want to go write this directory_name. 

Example :- cd Desktop ( Desktop is sub-directory ).  

Fig :- cd commands
$ clear 

clear is a standard Unix / Linux computer operating system command that is used to clear the terminal screen. This command first looks for a terminal type in environment and after that, it figures out the terminfo database for how to clear the screen. 

syntax :- 

$ clear

Fig :- clear command before

 Press Enter key.

Fig :- clear command after


  

 

 









Post a Comment

0 Comments