GNU/Linux Command – LS

ls — List directory contents

Summary:

List the current or specified directory contents and informations. It is similar to DOS DIR command. ls has option (-F) to show the different types of files with symbol ( / – Directory, * – Executable, @ – Link, nothing – Normal file). ls has option (–color) to show the different types files with different colors. Fields displayed in long (-l) output format: 1st File Type (- Normal file, d Directory, s Socket file, l Link file), 2nd Permissions(Owner, Group, Others), 3rd Number of links, 4th Owner, 5th Group, 6th Size, 7th Last modified Time, 8th Name.

Examples :
$ ls -- Alphabetically list all files and Dir $ ls --color=always -- Output in color $ ls -F -- Files are classified with /@|= symbols $ ls -1 -- Output in single column $ ls -a -- Display hidden entries starting with dot $ ls -R -- Recursive output $ ls -Q -- Enclose entry names in double quotes $ ls -lh -- List file is long format and show size in human readable format like KB, MB, GB, .. $ ls -m -- List file in comma separated entries. $ ls -lt -- Sort and show by last modification time. $ ls -lu -- Sort and show by last access time. $ ls -rlu -- Show in reverse order.
Read : man ls

Advertisements
Tagged with: ,
Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: