ls --help 常用命令

$ ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort.

Mandatory arguments to long options are mandatory for short options too.
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and ..
--author with -l, print the author of each file
-b, --escape print octal escapes for nongraphic characters
--block-size=SIZE use SIZE-byte blocks. See SIZE format below
-B, --ignore-backups do not list implied entries ending with ~
-c with -lt: sort by, and show, ctime (time of last
modification of file status information)
with -l: show ctime and sort by name
otherwise: sort by ctime
-C list entries by columns
--color[=WHEN] colorize the output. WHEN defaults to `always‘
or can be `never‘ or `auto‘. More info below
-d, --directory list directory entries instead of contents,
and do not dereference symbolic links
-D, --dired generate output designed for Emacs‘ dired mode
-f do not sort, enable -aU, disable -ls --color
-F, --classify append indicator (one of */=>@|) to entries
--file-type likewise, except do not append `*‘
--format=WORD across -x, commas -m, horizontal -x, long -l,
single-column -1, verbose -l, vertical -C
--full-time like -l --time-style=full-iso
-g like -l, but do not list owner
--group-directories-first
group directories before files.
augment with a --sort option, but any
use of --sort=none (-U) disables grouping
-G, --no-group in a long listing, don‘t print group names
-h, --human-readable with -l, print sizes in human readable format
(e.g., 1K 234M 2G)
--si likewise, but use powers of 1000 not 1024
-H, --dereference-command-line
follow symbolic links listed on the command line
--dereference-command-line-symlink-to-dir
follow each command line symbolic link
that points to a directory
--hide=PATTERN do not list implied entries matching shell PATTERN
(overridden by -a or -A)
--indicator-style=WORD append indicator with style WORD to entry names:
none (default), slash (-p),
file-type (--file-type), classify (-F)
-i, --inode print the index number of each file
-I, --ignore=PATTERN do not list implied entries matching shell PATTERN
-k like --block-size=1K
-l use a long listing format
-L, --dereference when showing file information for a symbolic
link, show information for the file the link
references rather than for the link itself
-m fill width with a comma separated list of entries
-n, --numeric-uid-gid like -l, but list numeric user and group IDs
-N, --literal print raw entry names (don‘t treat e.g. control
characters specially)
-o like -l, but do not list group information
-p, --indicator-style=slash
append / indicator to directories
-q, --hide-control-chars print ? instead of non graphic characters
--show-control-chars show non graphic characters as-is (default
unless program is `ls‘ and output is a terminal)
-Q, --quote-name enclose entry names in double quotes
--quoting-style=WORD use quoting style WORD for entry names:
literal, locale, shell, shell-always, c, escape
-r, --reverse reverse order while sorting
-R, --recursive list subdirectories recursively
-s, --size print the allocated size of each file, in blocks
-S sort by file size
--sort=WORD sort by WORD instead of name: none -U,
extension -X, size -S, time -t, version -v
--time=WORD with -l, show time as WORD instead of modification
time: atime -u, access -u, use -u, ctime -c,
or status -c; use specified time as sort key
if --sort=time
--time-style=STYLE with -l, show times using style STYLE:
full-iso, long-iso, iso, locale, +FORMAT.
FORMAT is interpreted like `date‘; if FORMAT is
FORMAT1<newline>FORMAT2, FORMAT1 applies to
non-recent files and FORMAT2 to recent files;
if STYLE is prefixed with `posix-‘, STYLE
takes effect only outside the POSIX locale
-t sort by modification time
-T, --tabsize=COLS assume tab stops at each COLS instead of 8
-u with -lt: sort by, and show, access time
with -l: show access time and sort by name
otherwise: sort by access time
-U do not sort; list entries in directory order
-v natural sort of (version) numbers within text
-w, --width=COLS 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

SELinux options:

--lcontext Display security context. Enable -l. Lines
will probably be too wide for most displays.
-Z, --context Display security context so it fits on most
displays. Displays only mode, user, group,
security context and file name.
--scontext Display only security context and file name.
--help display this help and exit
--version output version information and exit

SIZE may be (or may be an integer optionally followed by) one of following:
KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.

Using color to distinguish file types is disabled both by default and
with --color=never. With --color=auto, ls emits color codes only when
standard output is connected to a terminal. The LS_COLORS environment
variable can change the settings. Use the dircolors command to set it.

Exit status:
0 if OK,
1 if minor problems (e.g., cannot access subdirectory),
2 if serious trouble (e.g., cannot access command-line argument).

Report ls bugs to bug-[email protected]
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
For complete documentation, run: info coreutils ‘ls invocation‘

ls 显示当前目录下文件,按照文件名排序。

ls -a 显示所有项目,不忽略隐藏文件。

ls -s 显示项目时附带大小。

ls -l 详细信息

ls -t 按修改时间排序

ls -r 按照选定排序方式逆序排列

ls -lh 易读方式详细信息

常用:ls -ltrah 显示所有文件易读详细信息,并按照时间倒序排列。

时间: 2024-10-19 13:31:33

ls --help 常用命令的相关文章

轻松学习之Linux教程三 玩转Linux常用命令

本系列文章由@超人爱因斯坦出品,转载请注明出处.         文章链接:          http://hpw123.net/a/Linux/Linuxjichu/2014/1025/89.html 作者:超人爱因斯坦    个人网站:http://www.hpw123.net 邮箱: [email protected] CSDN:http://blog.csdn.net/u010283694 知道吗?Linux有多种不同的操作方式,图形界面与文字界面,使用命令操作的时候,怎么用这些命令,

Linux常用命令_(文件管理)

文件管理命令•基本命令:ls.cd.pwd.man•文件操作:touch.cp.rm.mv.ln.mkdir.rmdir.•文件查看:cat.more.less.head.tail•文件权限:chmod.chgrp.chown•文件搜索:which.whereis.grep.find.wc 1.ls 打印当前目录下的文件和目录文件 用法详解:: ls [-alFR] [文件或目录] -a 显示所有文件,包括隐藏文件:[[email protected]]#ls -a  -l 使用长格式显示:[[

Linux常用命令(echo、date、ls、cd、history、cat)

一.linux常用命令有很多今天我们来总结一下常用的入门命令: 1.linux下关机命令:poweroff.init 0.halt.shutdown -h now 2.linux下重启命令:reboot.init 6.shutdown -r now 3.shutdown命令: 格式:shutdown  options TIME 其中options有以下几个: -r:执行重启 -c:取消shutdown命令 -h:执行关机 其中TIME有以下几个: now:表示现在 +m:相对时间表示法,从命令提

Linux常用命令001之ls、mkdir、cd、pwd、rmdir、rm、cp、mv、ln

001_Linux常用命令 之ls.mkdir.cd.pwd.rmdir.rm.cp.mv.ln ===================== 正 文 =============================== ××××××目录及文件命令×××××× 1.ls ls [选项] [文件或目录] 选项: -a      ----显示所有文件,包括隐藏文件 -l      ----显示详细信息(long  表示长格式显示 eg:ls -l) -d      ----查看目录属性 -h      --

linux常用命令cd&ls&PATH

一.cd 命令cd--change directory即变换目录. cd 绝对路径或相对路径 cd ~用户 表示到这个用户的家目录,即/home/用户 cd ~表示回到自己的家目录,即/root这个目录 cd 表示回到自己的家目录 cd .. 表示回到上次目录 二.ls命令 ls--list即列出当前目录下的文件. ls -l表示列出文件的长数据串行,包含属性和权限等数据(常用) ls -a表示列出全部文件,连同隐藏(开头为.)一起列出 ls -A表示列出全部文件,连同隐藏,但不包括.和..这两

linux 常用命令之ls的使用场景和结果解释

1.列出/linux/ls-file 文件夹下的所有文件和目录的详细资料 [linux ~]$ ls -l -R /linux/ls-file 输入上面的命令回车后,就会显示目录下所有文件的详细信息 在使用 ls 命令时要注意命令的格式:在命令提示符后,首先是命令的关键字,接下来是命令参数,在命令参数之前要有一短横线"-",所有的命令参数都有特定的作用,自己可以根据需要选用一个或者多个参数,在命令参数的后面是命令的操作对象. 在以上这条命令""ls -l -R /l

linux 常用命令之ls的格式和参数

ls命令就是list的缩写,缺省下ls用来打印出当前目录的清单,如果ls指定其他目录,那么就会显示指定目录里的文件及文件夹清单. 通过ls 命令不仅可以查看linux文件夹包含的文件,而且可以查看文件权限(包括目录.文件夹.文件权限),查看目录信息等等,ls 命令在日常的linux操作中用的很多,在此先给大家介绍一下ls 命令格式和参数. ls命令格式:ls [选项] [目录名]. ls命令功能:列出目标目录中所有的子目录和文件. ls 命令的参数选项说明: -a, –all 列出目录下的所有文

linux常用命令[ls/cd/man/type/date/hwclock]

linux常用命令: ls -l : 长格式 文件类型: - : 普通文件 (f) d : 目录文件 d : 块设备文件 (block) c :字符设备文件 (character) l :符号链接文件 (symbolic link file) p :命令套管文件 (pipe) s :套接字文件 (socket) 文件权限: 9位, 每3位一组,每一组:rwx(读,写,执行) 文件硬链接的次数 文件的属主(onwer) 文件的属组(group) 文件大小(size),单位是字节 时间戳(times

常用命令su ls cp cd mv cat touch mkdir rm head less more pwd tac 等

1.用户切换 su:switch user su kevin   //半切换,切换到kevin用户,但是不读取kevin用户的配置文件 su - kevin   //完全切换,执行这个命令的时候表示切换到kevin用户,并且重新读取用户环境相关配置文件 clear   /*清屏*/ 2.pwd pwd   //printing working directory,显示当前目录 3.cd cd:change directory 切换目录 cd 切换到用户的家目录,也就是主目录,Home direc