diff options
Diffstat (limited to 'help/en/bash/ls.html')
-rw-r--r-- | help/en/bash/ls.html | 212 |
1 files changed, 212 insertions, 0 deletions
diff --git a/help/en/bash/ls.html b/help/en/bash/ls.html new file mode 100644 index 0000000..8f5d7f0 --- /dev/null +++ b/help/en/bash/ls.html @@ -0,0 +1,212 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> +<head> +<link rel="STYLESHEET" href="../term_tools/main.css" type="text/css"> +<title>ls MAN Page</title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +</head><body><!-- #BeginLibraryItem "/Library/head_bash.lbi" --><div id="nav-menu"> +<ul> +<li><a class="rl" href="../term_tools/index.html"><img src="../term_tools/images/ss64.gif" title="Home" alt="Home"></a></li> +<li><a class="rl" href="../term_tools/bash"><img src="../term_tools/images/bash-l.gif" title="bash" alt="bash"></a></li> +<li><!-- Search Google --> +<form action="http://www.google.com/search" method="get" style="margin:0px;padding:0px;"> +<div align="right"> +<input name="q" type="text" class="body" size="25"> +<input class="submit" type="submit" value="Search"> +<input type="hidden" name="q" value="site:ss64.com/bash/"> +</div> +</form></li> +<li><a class="rr" href="syntax.html"><img src="../term_tools/images/syntax-r.gif" title="Bash Syntax"></a></li> +</ul> +</div> <!-- #EndLibraryItem --><h1> ls</h1> +<p>List information about files.</p> +<pre>Syntax + ls [<em>Options</em>]... [<em>File</em>]... + +Key + Sort entries alphabetically if none of -cftuSUX nor --sort. + + -a, --all Do not hide entries starting with . + + -A, --almost-all Do not list implied . and .. + + -b, --escape Print octal escapes for nongraphic characters + + --block-size=<em>SIZE</em> Use <em>SIZE</em>-byte blocks + + -B, --ignore-backups Do not list implied entries ending with ~ + + -c Sort by change time; with -l: show ctime + + -C List entries by columns + + --color[=<em>WHEN</em>] Control whether color is used to distinguish file + types. WHEN may be `never', `always', or `auto' + + -d, --directory List directory entries instead of contents + + -D, --dired Generate output designed for Emacs' dired mode + + -f Do not sort, enable -aU, disable -lst + + -F, --classify Append indicator (one of */=@|) to entries + + --format=<em>WORD</em> Across -x, commas -m, horizontal -x, long -l, + single-column -1, verbose -l, vertical -C + + --full-time List both full date and full time + + -g (ignored) + + -G, --no-group Inhibit display of group information + + -h, --human-readable Print sizes in human readable format (e.g., 1K 234M 2G) + -H, --si Likewise, but use powers of 1000 not 1024 + + --indicator-style=<em>WORD</em> Append indicator with style <em>WORD</em> to entry names: + none (default), classify (-F), file-type (-p) + + -i, --inode Print index number of each file + + -I, --ignore=<em>PATTERN</em> Do not list implied entries matching shell <em>PATTERN</em> + + -k, --kilobytes Like --block-size=1024 + + -l Use a long listing format + + -L, --dereference List entries pointed to by symbolic links + + -m Fill width with a comma separated list of entries + + -n, --numeric-uid-gid List numeric UIDs and GIDs instead of names + + -N, --literal Print raw entry names (don't treat e.g. control + characters specially) + + -o Use long listing format without group info + + -p, --file-type Append indicator (one of /=@|) to entries + + -q, --hide-control-chars Print ? instead of non graphic characters + + --show-control-chars Show non graphic characters as-is (default) + + -Q, --quote-name Enclose entry names in double quotes + --quoting-style=<em>WORD</em> Use quoting style <em>WORD</em> for entry names: + literal, shell, shell-always, c, escape + + -r, --reverse Reverse order while sorting + + -R, --recursive List subdirectories recursively + + -s, --size Print size of each file, in blocks + + -S Sort by file size + + --sort=<em>WORD</em> time -t, version -v, status -c + size -S, extension -X, none -U + atime -u, access -u, use -u + + --time=<em>WORD</em> Show time as <em>WORD</em> instead of modification time: + atime, access, use, ctime or status; + also use this as a sort key if --sort=time + + -t sort by modification time + + -T, --tabsize=<em>COLS</em> assume tab stops at each <em>COLS</em> instead of 8 + + -u sort by last access time; with -l: show atime + + -U do not sort; list entries in directory order + + -v sort by version + + -w, --width=<em>COLS</em> assume screen width instead of current value + + -x list entries by lines instead of by columns + + -X sort alphabetically by entry extension + + -1 list one file per line + + --help display help and exit + + --version output version information and exit</pre> +<p><span class="body"> The most common options are -a (all files) and -l (long + or details)<br> + <br> + When output to file the files are listed one per line. <br> + <br> + By default, colour is not used to distinguish types of files. That is equivalent + to using --color=none. <br> + Using the --color option without the optional WHEN argument is equivalent to + using --color=always. <br> + With --color=auto, color codes are output only if standard output is connected +to a terminal (tty).</span></p> +<p><b>Examples</b></p> +<pre># List the contents of your home directory +<b>$ ls ~</b> + +# list everything in a vertical list: +<b>$ ls -al</b> + +total 109 +drwxr-xr-x 18 root root 4096 Jun 9 21:12 ./ +drwxr-xr-x 18 root root 4096 Jun 9 21:12 ../ +drwxr-xr-x 2 root root 4096 Jun 9 21:14 bin/ +drwxr-xr-x 3 root root 1024 Jun 9 20:32 boot/ +drwxr-xr-x 6 root root 36864 Jul 12 10:26 dev/ +drwxr-xr-x 34 root root 4096 Jul 12 10:25 etc/ +^ +the first column is the file type +d = directory +f = file + +# List the directories in the current directory: +<b>$ ls -d */</b> + +# list ALL subdirectories +<b>$ ls *</b></pre> +<p>The default behaviour of <span class="telety">ls</span> is to only pass color control codes to tty output <span class="telety">--color=auto</span>.<br> +To pipe the output to a second command complete with color codes then set <span class="body"><span class="telety">--color=always</span></span></p> +<p class="telety"><b>$ ls -lAXh --color=auto</b>|less -R</p> +<p>A list of <a href="../term_tools/bash/lsenv.html">environment variables that affect ls</a> (colour, column width, blocksize etc) </p> +<p><i> "If the doors of perception were cleansed every thing + would appear to man as it is, infinite" - William + Blake</i></p> +<p><b>Related</b>:<br> + <br> + <a href="dir.html">dir</a> - Briefly list directory contents<br> + <a href="dircolours.html">dircolors</a> - Colour setup for `ls' <br> + <a href="dirname.html">dirname</a> - Convert a full pathname to just a path<br> + lspci - List PCI devices + <br> + <a href="quota.html">quota</a> - Display disk usage and limits <br> + <a href="rm.html">rm</a> - Remove files <a href="rmdir.html"><br> + rmdir</a> - Remove folder(s) <br> + <a href="wc.html">wc</a> - Print byte, word, and line counts <br> +Equivalent Windows command: <a href="../term_tools/nt/dir.html"> + DIR</a> - Display a list of files and folders</p> +<!-- #BeginLibraryItem "/Library/foot_bash.lbi" --><p align="left"><script type="text/javascript"><!-- +google_ad_client = "pub-6140977852749469"; +google_ad_width = 300; +google_ad_height = 250; +google_ad_format = "300x250_as"; +google_ad_type = "text_image"; +google_ad_channel ="1984328893"; +google_color_border = "CCCCCC"; +google_color_bg = "CCCCCC"; +google_color_link = "000000"; +google_color_text = "333333"; +google_color_url = "0000FF"; +//--></script> +<script type="text/javascript" + src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> +</script><br> +</p> +<div align="center"><hr size="1"> + <p id="top"><a href="#"><img src="../term_tools/images/top-4.gif" width="47" height="53" border="0" alt="Back to the Top" title="Back to the Top"></a></p> + <p class="tagline">© Copyright <a href="http://ss64.com/">SS64.com</a> 1999-2010<br> +Some rights reserved<br> +</p> +</div><!-- #EndLibraryItem --></body> +</html> |