ls command used to list the content of a diretory or directories

Syntax :-

$ ls [options] [directory-name]

$ ls

this command show all the content of current working directory

$ ls software

this command show all the content of software directory

$ ls /   (Symbol / indicates the root directory)

this command show all the content of the root directory

$ ls Desktop/software

this command show all the content of software directory

$ Desktop/Software/mdce ls ..

this command show all the content of the one directory back from the current directory, which is software directory.

$ Desktop/Software/mdce ls ../..

this command show all the content of the two directories back from the current directory, which is Desktop directory.

$ Desktop/Software/mdce ls -l

this command show all the contents of the directory in the long format which means date, time, permission, author, size of the files and directories will be shown.


abhisharmaofficial.blogspot.com


$ Desktop/Software/mdce ls -a

this command show all the contents of the hidden directory or files.


abhisharmaofficial.blogspot.com


$ Desktop/Software/mdce ls -al

this command show all the contents of the hidden directory or files as well as long format which means date, time, permission, author, size of the files and directories will be shown.


abhisharmaofficial.blogspot.com

$ Desktop/Software/mdce ls *.html

this command show all html files having extension .html in the mdce directory.

$ Desktop/Software/mdce ls *.*

this command show all the files in the mdce directory.

$ Desktop/Software/mdce ls -l > data.txt

this command create a notepad file name as data.txt and move the data of "-l" command into a Notepad file. 


$ Desktop/Software/mdce ls -d */

this command list out the all directories not a files. 



Your feedback is very important for us :)