Home »

Ls

The meaning of «ls»

In computing, ls is a command to list computer files in Unix and Unix-like operating systems. ls is specified by POSIX and the Single UNIX Specification. When invoked without any arguments, ls lists the files in the current working directory. The command is also available in the EFI shell.[1] In other environments, such as DOS, OS/2, and Microsoft Windows, similar functionality is provided by the dir command. The numerical computing environments MATLAB and GNU Octave include an ls function with similar functionality.[2][3]

An ls utility appeared in the original version of AT&T UNIX, the name inherited from a similar command in Multics also named 'ls', short for the word "list".[4][5][6] Today, the two popular versions of ls are the one provided with the GNU coreutils package, and that released by various BSD variants. Both are free software and open source, and have only minor syntax differences. The version of ls bundled in GNU coreutils was written by Richard Stallman and David MacKenzie.[7]

Unix and Unix-like 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. If another directory is specified, then ls will list the files there, and in fact the user may specify any list of files and directories to be listed.

Files whose names start with "." are not listed, unless the -a flag is specified, the -A flag is specified, or the files are specified explicitly.

Without options, ls displays files in a bare format. This bare format however makes it difficult to establish the type, permissions, and size of the files. The most common options to reveal this information or change the list of files are:

It's normally possible to highlight different types of files with different colors, instead of with characters as -F would, but this is an area where the two main ls versions differ:

When the option to use color to indicate file types is selected, the output might look like:

-rw-r--r-- 1 unixguy staff 26650 Dec 20 11:16 audio.ogg brw-r--r-- 1 unixguy staff 64, 64 Jan 27 05:52 bd-block-device crw-r--r-- 1 unixguy staff 64, 255 Jan 26 13:57 cd-character-device -rw-r--r-- 1 unixguy staff 290 Jan 26 14:08 image.png drwxrwxr-x 2 unixguy staff 48 Jan 26 11:28 di-directory -rwxrwxr-x 1 unixguy staff 29 Jan 26 14:03 ex-executable -rw-r--r-- 1 unixguy staff 0 Dec 20 09:39 fi-regular-file lrwxrwxrwx 1 unixguy staff 3 Jan 26 11:44 ln-soft-link -> dir lrwxrwxrwx 1 unixguy staff 15 Dec 20 10:57 or-orphan-link -> mi-missing-link drwxr-xrwx 2 unixguy staff 4096 Dec 20 10:58 ow-other-writeable-dir prw-r--r-- 1 unixguy staff 0 Jan 26 11:50 pi-pipe -rwxr-sr-x 1 unixguy staff 0 Dec 20 11:05 sg-setgid srw-rw-rw- 1 unixguy staff 0 Jan 26 12:00 so-socket drwxr-xr-t 2 unixguy staff 4096 Dec 20 10:58 st-sticky-dir -rwsr-xr-x 1 unixguy staff 0 Dec 20 11:09 su-setuid -rw-r--r-- 1 unixguy staff 10240 Dec 20 11:12 compressed.gz drwxrwxrwt 2 unixguy staff 4096 Dec 20 11:10 tw-sticky-other-writeable-dir Sample usage[edit]

The following example demonstrates the output of the ls command given two different arguments (pwd is a command that shows the present working directory, or in other words, the folder you are currently in):

Related Searches

LS based GM small-block engineLSU Tigers footballLSU Tigers and Lady Tigers
LSU Tigers basketballLSU Tigers baseballLS3/5A
LSmLSE Students' UnionLSU Tigers football statistical leaders

Choice of words

l-s_ _
ls-_ _
ls:_ _ _ _
ls_ _ _ _
ls_ - _ _ _
ls-_ _ _ _
ls _ _ _ _ _
ls _ - _ _ _ _
lsa* lsb* lsc* lsd* lse* lsf* lsg* lsh* lsi* lsj* lsk* lsl* lsm* lsn* lso* lsp* lsq* lsr* lss* lst* lsu* lsv* lsw* lsx* lsy* lsz*
© 2015-2020, Wikiwordbook.info
Copying information without reference to the source is prohibited!
contact us mobile version