Tuesday, January 21, 2014

LS Command Options in Linux

LS Command Options in Linux

Commands are case sensitive. The command ls is different from LS. In fact LS is not recognised as a valid command.

ls is specified by POSIX and the Single UNIX Specification.

Abbreviation of ls Command is - list directory contents

In Linux operating systems maintain the idea of a current working directory, that is, where one is currently positioned in the hierarchy of directories.

When invoked without any arguments, ls lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed.



Linux and Unix users and system admins cannot live without this two letter command. Whether you use it 10 times a day or 100 times a day, 

Command options can usually be combined or listed separately.

Unix commands have the general format:

command  [options]  [item]

Command: ls
Command Usage:
The ls command lists all files in the directory that match the name. If name is left blank, it will list all of the files in the directory.
The syntax for the ls command is: ls [options]
OR
Go to Terminal Type : ls
Then you will get the Directory Details in Your Terminal
To Display Line By Line Files in Terminal
There are so many option in the Command so Type this command in your terminal: ls -1
There are so many option in the Command so i am explaining here few option with description.

LS Command Examples

Option Description
a Displays all files. b Displays non printing characters in octal. c Displays files by file time stamp. C Displays files in a columnar format (default) d Displays only directories. f Interprets each name as a directory, not a file. F Flags file names. g Displays the long format listing, but exclude the owner name. i Displays the inode for each file. l Displays the long format listing. L Displays the file or directory referenced by a symbolic link. m Displays the names as a comma-separated list. n Displays the long format listing, with GID and UID numbers. o Displays the long format listing, but excludes group name. p Displays directories with / q Displays all non printing characters as ? r Displays files in reverse order. R Displays sub directories as well. t Displays newest files first. (based on time stamp) u Displays files by the file access time. x Displays files as rows across the screen. 1 Displays each entry on a line.

LS Command Options in Linux

No comments:

Post a Comment

Related Post

Linux Tips and tricks,Online Linux Helpers