ls — List directory contentsSummary: 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