GetWiki
ls
ARTICLE SUBJECTS
being →
database →
ethics →
fiction →
history →
internet →
language →
linux →
logic →
method →
news →
policy →
purpose →
religion →
science →
software →
truth →
unix →
wiki →
ARTICLE TYPES
essay →
feed →
help →
system →
wiki →
ARTICLE ORIGINS
critical →
forked →
imported →
original →
ls
please note:
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
{{Short description|Command to list files and directories in Unix and Unix-like operating systems}}{{Other uses|LS (disambiguation){{!}}LS}}{{Lowercase|title=ls}}- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
factoids | |
---|---|
History
An ls utility appeared in the first version of AT&T UNIX, the name inherited from a similar command in Multics also named 'ls', short for the word "list".WEB, 14 February 1985, Multics manual page for ls or list command,weblink WEB,weblink A Brief History of the 'ls' command, Eric, Fischer, The Linux Documentation Project, WEB,weblink Multics programmer's manual - Commands and active functions, 397, {{code|ls}} is part of the X/Open Portability Guide since issue 2 of 1987. It was inherited into the first version of POSIX.1 and the Single Unix Specification.{{man|cu|ls|SUS}}Behavior
Unix and Unix-like operating systems maintain the idea of a working directory. When invoked without arguments, ls lists the files in the working directory. If a directory is specified as an argument, the files in that directory are listed; if a file is specified, that file is listed. Multiple directories and files may be specified.In many Unix-like systems, names starting with a dot (.) are hidden. Examples are ., which refers to the working directory, and .., which refers to its parent directory. Hidden names are not shown by default. With -a, all names, including all hidden names, are shown. Using -A shows all names, including hidden names, except for . and ... File names specified explicitly (for example ls .secret) are always listed.Without options, ls displays names only.The different implementations have different options, but common options include:- -l Long format, displaying Unix file types, permissions, number of hard links, owner, group, size, last-modified date-time and name. If the modified date is older than 6 months, the time is replaced with the year. Some implementations add additional flags to permissions. The file type can be one of 8 characters: -, regular file; d, directory; l, symbolic (soft) link; n, network files; s, socket; p, named pipe (FIFO); c, character special file; b, block special file.
- -h Output sizes in human readable format (e.g., 1K (kilobytes), 234M (megabytes), 2G (gigabytes)). This option is not part of the POSIX standard, although implemented in several systems, e.g., GNU coreutils in 1997,WEB,weblink (decode_switches): -h and -H override output units., coreutils.git, 1997-12-31, FreeBSD 4.5 in 2002,WEB,weblink [base] Log of /stable/10/bin/ls/ls.c, 2001-12-28, and Solaris 9 in 2002.{{citation |url=http://docs.oracle.com/cd/E19683-01/806-5202/6je7shk5c/index.html |title=What's New in the Solaris 9 Operating Environment |publisher=Sun Microsystems |year=2002}}
- -R Recursively list items in subdirectories.
- -t Sort the list by modification time (default sort is alphabetically).
- -u Sort the list by last access time.
- -c Sort the list by last attribute (status) change time.
- -r Reverse the order, for example most recent time last.
- --full-time Show times down to the second and millisecond instead of just the minute.
- -1 One entry per line.
- -m Stream format; list items across the page, separated by commas.
- -g Include group but not owner.
- -o Include owner but not group (when combined with -g both group and owner are suppressed).
- -d Show information about a directory or symbolic link, rather than the contents of a directory or the link's target.
- -F Append a "/" to directory names and a "" to executable files.
- GNU ls uses the --color option;WEB, General output formatting (GNU Coreutils 9.1),weblink 2023-01-07, www.gnu.org, it checks the Unix file type, the file permissions and the file extension and uses its own database to control colors maintained using dircolors.
- FreeBSD ls uses the -G option; it checks only the Unix file type and file permissions and uses the termcap databaseWEB,weblink FreeBSD Man Pages — ls, June 23, 2013,
-rw-r--r-- 1 tsmitt nregion 26650 Dec 20 11:16 audio.ogg
brw-r--r-- 1 tsmitt nregion 64 Jan 27 05:52 bd-block-device
crw-r--r-- 1 tsmitt nregion 255 Jan 26 13:57 cd-character-device
-rw-r--r-- 1 tsmitt nregion 290 Jan 26 14:08 image.png
drwxrwxr-x 2 tsmitt nregion 48 Jan 26 11:28 di-directory
-rwxrwxr-x 1 tsmitt nregion 29 Jan 26 14:03 ex-executable
-rw-r--r-- 1 tsmitt nregion 0 Dec 20 09:39 fi-regular-file
lrwxrwxrwx 1 tsmitt nregion 3 Jan 26 11:44 ln-soft-link -> dir
lrwxrwxrwx 1 tsmitt nregion 15 Dec 20 10:57 or-orphan-link -> mi-missing-link
drwxr-xrwx 2 tsmitt nregion 4096 Dec 20 10:58 ow-other-writeable-dir
prw-r--r-- 1 tsmitt nregion 0 Jan 26 11:50 pi-pipe
-rwxr-sr-x 1 tsmitt nregion 0 Dec 20 11:05 sg-setgid
srw-rw-rw- 1 tsmitt nregion 0 Jan 26 12:00 so-socket
drwxr-xr-t 2 tsmitt nregion 4096 Dec 20 10:58 st-sticky-dir
-rwsr-xr-x 1 tsmitt nregion 0 Dec 20 11:09 su-setuid
-rw-r--r-- 1 tsmitt nregion 10240 Dec 20 11:12 compressed.gz
drwxrwxrwt 2 tsmitt nregion 4096 Dec 20 11:10 tw-sticky-other-writeable-dir
brw-r--r-- 1 tsmitt nregion 64 Jan 27 05:52 bd-block-device
crw-r--r-- 1 tsmitt nregion 255 Jan 26 13:57 cd-character-device
-rw-r--r-- 1 tsmitt nregion 290 Jan 26 14:08 image.png
drwxrwxr-x 2 tsmitt nregion 48 Jan 26 11:28 di-directory
-rwxrwxr-x 1 tsmitt nregion 29 Jan 26 14:03 ex-executable
-rw-r--r-- 1 tsmitt nregion 0 Dec 20 09:39 fi-regular-file
lrwxrwxrwx 1 tsmitt nregion 3 Jan 26 11:44 ln-soft-link -> dir
lrwxrwxrwx 1 tsmitt nregion 15 Dec 20 10:57 or-orphan-link -> mi-missing-link
drwxr-xrwx 2 tsmitt nregion 4096 Dec 20 10:58 ow-other-writeable-dir
prw-r--r-- 1 tsmitt nregion 0 Jan 26 11:50 pi-pipe
-rwxr-sr-x 1 tsmitt nregion 0 Dec 20 11:05 sg-setgid
srw-rw-rw- 1 tsmitt nregion 0 Jan 26 12:00 so-socket
drwxr-xr-t 2 tsmitt nregion 4096 Dec 20 10:58 st-sticky-dir
-rwsr-xr-x 1 tsmitt nregion 0 Dec 20 11:09 su-setuid
-rw-r--r-- 1 tsmitt nregion 10240 Dec 20 11:12 compressed.gz
drwxrwxrwt 2 tsmitt nregion 4096 Dec 20 11:10 tw-sticky-other-writeable-dir
Sample usage
The following example demonstrates the output of the command:$ ls -ldrwxr--r-- 1 fjones editors 4096 Mar 2 12:52 drafts-rw-r--r-- 3 fjones editors 30405 Mar 2 12:52 edition-32-r-xr-xr-x 1 fjones bookkeepers 8460 Jan 16 2022 edit.shEach line shows the d (directory) or - (file) indicator, Unix file permission notation, number of hard links (1 or 3), the file's owner, the file's group, the file size, the modification date/time, and the file name. In the working directory, the owner fjones has a directory named drafts, a regular file named edition-32, and an executable named edit.sh which is "old", i.e. modified more than 6 months ago as indicated by the display of the year.ââââââââââââ file (not a directory)|ââââââââââââ read-write (no execution) permissions for the owner|â ââââââââââ read-only permissions for the group|â â ââââââââ read-only permissions for others|â â â âââ number of hard links|â â â â âââ owner|â â â â â âââ user group|â â â â â â âââ file size in bytes|â â â â â â â âââ last modified on|â â â â â â â â âââ filename-rw-r--r-- 3 fjones editors 30405 Mar 2 12:52 edition-32See also
- stat (Unix)
- chown
- chgrp
- du (Unix)
- mdls
- User identifier (Unix)
- Group identifier (Unix)
- List of Unix commands
- Unix directory structure
References
{{Reflist}}External links
- {{man|cu|ls}}
- {{man|1|ls|FreeBSD}}
- {{man|1|ls|NetBSD}}
- {{man|1|ls|OpenBSD}}
- {{man|1|ls|Solaris}}
- {{man|1|ls|Linux}}
- {{man|1|ls|Plan 9}}
- {{man|1|ls|Inferno}}
- GNU ls source code (as part of coreutils)
- ls at the LinuxQuestions.org wiki
- content above as imported from Wikipedia
- "ls" does not exist on GetWiki (yet)
- time: 12:08am EDT - Sun, May 05 2024
- "ls" does not exist on GetWiki (yet)
- time: 12:08am EDT - Sun, May 05 2024
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 23 MAY 2022
The Illusion of Choice
Culture
Culture
GETWIKI 09 JUL 2019
Eastern Philosophy
History of Philosophy
History of Philosophy
GETWIKI 09 MAY 2016
GetMeta:About
GetWiki
GetWiki
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
Biographies
GETWIKI 20 AUG 2014
GetMeta:News
GetWiki
GetWiki
© 2024 M.R.M. PARROTT | ALL RIGHTS RESERVED