ONE COMMAND A DAY.

18.04.2009

1>   ls command.

SUMMARY

This command displays a listing files in a directory.We can list the names of files available in a directory with this command.It basically displays the listing file of the current directory,suppose we do ‘ls’ after going in root directory,it lists the files present in the root directory.We can also see the listed files by going through the path i.e ls /home/  lists the files in home directory.

SYNTAX:

-a Shows you all files, even files that are hidden (these files begin with a dot.)
-A List all files including the hidden files. However, does not display the working directory (.) or the parent directory (..).
-b Force printing of non-printable characters to be in octal \ddd notation.
-c Use time of last modification of the i-node (file created, mode changed, and so forth) for sorting (-t) or printing (-l or -n).
-C Multi-column output with entries sorted down the columns. Generally this is the default option.
-d If an argument is a directory it only lists its name not its contents.
-f Force each argument to be interpreted as a directory and list the name found in each slot. This option turns off -l, -t, -s, and -r, and turns on -a; the order is the order in which entries appear in the directory.
-F Mark directories with a trailing slash (/), doors with a trailing greater-than sign (>), executable files with a trailing asterisk (*), FIFOs with a trailing vertical bar (|), symbolic links with a trailing at-sign (@), and AF_Unix address family sockets with a trailing equals sign (=).
-g Same as -l except the owner is not printed.
-i For each file, print the i-node number in the first column of the report.
-l Shows you huge amounts of information (permissions, owners, size, and when last modified.)
-L If an argument is a symbolic link, list the file or directory the link references rather than the link itself.
-m Stream output format; files are listed across the page, separated by commas.
-n The same as -l, except that the owner’s UID and group’s GID numbers are printed, rather than the associated character strings.
-o The same as -l, except that the group is not printed.
-p Displays a slash ( / ) in front of all directories.
-q Force printing of non-printable characters in file names as the character question mark (?).
-r Reverses the order of how the files are displayed.
-R Includes the contents of subdirectories.
-s Give size in blocks, including indirect blocks, for each entry.
-t Shows you the files in modification time.
-u Use time of last access instead of last modification for sorting (with the -t option) or printing (with the -l option).
-x Displays files in columns.
-1 Print one entry per line of output.
pathnames File or directory to list.

There are many more options, we can see them by doing man ls.

Advertisements

About yevlempy
A foodie, a cleartripper, a linux geek!

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: