Linux每日一命令--Day 1 ls

ls

名称

ls

功能

listdirectory contents.

列出目标目录中所有的子目录和文件。

格式

ls[OPTION]... [FILE]…

ls [选项] [目录名]

参数p

-a,—all

donot ignore entries starting with .

列出目录下的所有文件,包括以.开头的隐含文件

-A, --almost-all

donot list implied . and ..

列出目录下的所有文件,但不包括以.和..开头的隐含文件

--author

with-l, print the author of each file

配合-l:打印出每个文件的作者

-b,--escape

printoctal escapes for nongraphic characters

以八进制 ( \nnn) 表示法显示非打印字符

--block-size=SIZE

useSIZE-byte blocks.

使用SIZE-byte块

-B,--ignore-backups

donot list implied entries ending with ~

不输出以 “~”结束的备份文件

-c

with-lt: sort by, and show, ctime (time of last modification of file statusinformation)

with-l: show ctime and sort by name otherwise: sort by ctime

配合-lt:根据 ctime 排序及显示 ctime (文件状态最后更改的时间)

配合-l:显示 ctime 但根据名称排序

否则:根据 ctime 排序

-C

listentries by columns

按列输出,纵向排序

--color[=WHEN]

colorizethe output. WHEN defaults to ‘always’ or can be ‘never’ or ‘auto’. More infobelow

控制是否使用色彩分辨文件。WHEN可以是“never”、“always”或“auto”其中之一

-d,--directory

listdirectory entries instead of contents, and do not dereference symbolic links

将目录像文件一样显示,而不是显示其下的文件

-D,--dired

generateoutput designed for Emacs’ dired mode

产生适合Emacs的dired模式使用的结果

-f

donot sort, enable -aU, disable -ls --color

对输出的文件不进行排序,-aU选项生效,-ls和颜色选项失效

-F,--classify

appendindicator (one of */=>@|) to entries

如果文件是目录,在文件名后面放置一个 /(斜杠),如果文件可执行,则放置一个 *(星号),如果文件为套接字,则放置一个 =(等号),如果为 FIFO,则放置一个 |(管道)符号,如果是符号链接,则放置一个 @

--file-type

likewise,except do not append ‘*’

同样的,除了不添加“*”

--format=WORD

across-x, commas -m, horizontal -x, long -l, single-column -1, verbose -l, vertical-C

-m - x,逗号,水平- x - l,单列,详细- l,垂直- c

--full-time

like-l --time-style=full-iso

类似于-l --time-style=full-iso

-g

like-l, but do not list owner

类似 -l,但不列出所有者

--group-directories-first

groupdirectories before files. augment with a --sort option, but any use of--sort=none (-U) disables grouping

将输出结果在保留原有顺序的前提下(-s)只根据第栏的第一个字母到第一栏的第一个字母之间的内容——也就是该文件的类型——排序

-G,--no-group

ina long listing, don’t print group names

不列出任何有关组的信息

-h,--human-readable

with-l, print sizes in human readable format (e.g., 1K 234M 2G)

以容易理解的格式列出文件大小 (例如 1K 234M 2G)

—si

likewise,but use powers of 1000 not 1024

类似 -h,但文件大小取 1000 的次方而不是 1024

-H,--dereference-command-line

followsymbolic links listed on the command line

使用命令列中的符号链接指示的真正目的地

--dereference-command-line-symlink-to-dir

followeach command line symbolic link that points to a directory

遵循每个命令行符号链接指向一个目录

--hide=PATTERN

donot list implied entries matching shell PATTERN (overridden by -a or -A)

不隐含条目列表匹配的shell模式(由——或者——覆盖)

--indicator-style=WORD

appendindicator with style WORD to entry names: none (default),  slash (-p),  file-type (--file-type), classify (-F)

指定在每个项目名称后加上指示符号<方式>:none (默认),classify (-F),file-type (-p)

-i,--inode

printthe index number of each file

印出每个文件的 inode 号

-I,--ignore=PATTERN

donot list implied entries matching shell PATTERN

不印出任何符合 shell 万用字符<样式>的项目

-k

like--block-size=1K

即 –block-size=1K,以 k 字节的形式表示文件的大小

-l

usea long listing format

使用长格式列出信息。即除了文件名之外,还将文件的权限、所有者、文件大小等信息详细列出来

-L,--dereference

whenshowing file information for a symbolic link, show information for the file thelink references rather than for the link itself

当显示符号链接的文件信息时,显示符号链接所指示的对象而并非符号链接本身的信息

-m

fillwidth with a comma separated list of entries

使用流输出格式,所有项目以逗号分隔,并填满整行行宽

-n,--numeric-uid-gid

like-l, but list numeric user and group IDs

除显示用户和组 ID 而不是用户和组名称以外,它显示和 -l 标志同样的信息

-N,--literal

printraw entry names (don’t treat e.g. control characters specially)

当确定文件状态时,不跟在_符号链接之后

-o

like-l, but do not list group information

类似 -l,显示文件的除组信息外的详细信息

-p,--indicator-style=slash

append/ indicator to directories

此项为一个先进先出(FIFO)特殊文件

-q,--hide-control-chars

print? instead of non graphic characters

将文件名中的非打印字符显示成 ?(问号)

--show-control-chars

shownon graphic characters as-is (default unless program is ‘ls’ and output is a terminal)

直接显示无法打印的字符 (这是默认方式,除非调用的程序名称是“ls”而且是在终端机画面输出结果)

-Q,--quote-name

encloseentry names in double quotes

把输出的文件名用双引号括起来

--quoting-style=WORD

usequoting style WORD for entry names: literal, locale, shell, shell-always, c,escape

使用指定的 quoting 显示项目的名称:literal、locale、shell、shell-always、c、escape

-r,--reverse

reverseorder while sorting

依相反次序排列

-R,--recursive

listsubdirectories recursively

同时列出所有子目录层

-s,--size

printthe allocated size of each file, in blocks

以块大小为单位列出所有文件的大小

-S

sortby file size

根据文件大小排序

--sort=WORD

sortby WORD instead of name: none -U, extension -X, size -S, time -t, version -v

以下是可选用的 WORD 和它们代表的相应选项:

extension -X status -c

none -U time -t

size -S atime -u

time -t access -u

version -v use -u

--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 assort key if --sort=time

和 -l 同时使用时显示WORD 所代表的时间而非修改时间:atime、access、use、ctime 或 status;加上               --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 appliesto non-recent files and FORMAT2 to recent files; if STYLE is

prefixed with  ‘posix-’, STYLE takes effect only outside the POSIX locale

和 -l 同时使用时根据STYLE 代表的格式显示时间:full-iso、iso、locale、posix-iso、+FORMAT。FORMAT即是“date”所用的时间格式;如果 FORMAT是FORMAT1FORMAT2,FORMAT1 适用于较旧的文件而 FORMAT2 适用于较新的文件;如果 STYLE以“posix-”开头,则 STYLE 仅在 POSIX 语系之外生效

-t

sortby modification time

以文件修改时间排序

-T,--tabsize=COLS

assumetab stops at each COLS instead of 8

自行指定 tab 的,而非8 个字符

-u

with -lt: sort by, and show, access time

with-l: show access time and sort by name

otherwise:sort by access time

配合-lt:显示访问时间而且依访问时间排序

配合-l:显示访问时间但根据名称排序

否则:根据访问时间排序

-U

donot sort; list entries in directory order

不进行排序;依文件系统原有的次序列出项目

-v

naturalsort of (version) numbers within text

根据版本进行排序

-w,--width=COLS

assumescreen width instead of current value

自行指定屏幕宽度而不使用目前的数值

-x

listentries by lines instead of by columns

逐行列出项目而不是逐栏列出

-X

sortalphabetically by entry extension

根据扩展名排序

-1

listone file per line

每行只列出一个文件

--lcontext

Displaysecurity context.   Enable -l. Lines will probably be too wide for mostdisplays.

-Z,--context

Display security  context so it fits on most displays.  Displays onlymode, user, group, security context and file name.

--scontext

Displayonly security context and file name.

--help

displaythis help and exit

显示此帮助信息并离开

--version

outputversion information and exit

显示版本信息并离开

时间: 2024-08-12 14:15:38

Linux每日一命令--Day 1 ls的相关文章

Linux每日一命令:【00】总纲

Linux每日一命令更新频率为每周5篇. 文章结构如下: 简介 语法 选项 参数 常用实例 实用技巧(可选) 参考文档 文章目录如下: 2018-02-19 20:15 -- Linux每日一命令:[00]总纲 原文地址:https://www.cnblogs.com/tianknight/p/8454325.html

linux 常用命令ll 即 ls -l --color=auto

1.linux系统运维或者开发中,经常会用到ll 即 ls -l --color=auto 命令.比如 ll -hF, <span style="font-size:18px;">[[email protected] ~]$ ll -hF 总用量 1.1G drwxrwxr-x. 2 doctor doctor 4.0K 1月 18 10:23 Documents/ -rw-r-----. 1 doctor doctor 701M 12月 24 21:51 Far123-X

Linux每日一命令--Day 1

ls 名称 ls 功能 listdirectory contents. 列出目标目录中所有的子目录和文件. 格式 ls[OPTION]... [FILE]- ls [选项] [目录名] 参数p -a,-all donot ignore entries starting with . 列出目录下的所有文件,包括以.开头的隐含文件 -A, --almost-all donot list implied . and .. 列出目录下的所有文件,但不包括以.和..开头的隐含文件 --author wit

Linux每日一命令--Day2 pwd

pwd 命令 pwd 功能 printname of current/working directory. Printthe full filename of the current working directory. 查看当前目录的完整路径 格式 pwd[OPTION]... pwd [选项] 参数 -L,--logical usePWD from environment, even if it contains symlinks 与-P参数相反,显示逻辑路径 -P,--physical a

linux每日一命令--cut

--按文件大小排序 显示前100行 显示后五列 ll -Sh|head -n 100|cut -d ' ' -f 5- 一.基本语法cut是一个选取命令,以行为单位,用指定分隔符将行切分为若干字段,选取所需要的字段.1.语法格式cut [option] filesoption常用参数如下: -d:用来定义分隔符,默认为tab键,一般与-f配合使用(如果分隔符是空格,必须是两个单引号之间确实有一个空格,是一个哦,不是支持多个)-f:需要选取的字段,根据-d切分的字段集选取,下标从1开始-s:表示不

linux每日命令(1):ls命令

ls命令是linux下最常用的命令.ls命令就是list的缩写缺省下ls用来打印出当前目录的清单如果ls指定其他目录那么就会显示指定目录里的文件及文件夹清单. 通过ls 命令不仅可以查看linux文件夹包含的文件而且可以查看文件权限(包括目录.文件夹.文件权限)查看目录信息等等.ls 命令在日常的linux操作中用的很多! 1.命令格式: ls [选项] [目录名] 2.命令功能 列出目标目录中所有的子目录和文件.(不包含.开头的文件) 3.常用选项参数 选项参数 作用 -l 除了文件名之外

linux每日命令(26):Linux文件属性详解

阅读目录(Content) 命令: 输出: 说明: 关于inode: Linux 文件或目录的属性主要包括:文件或目录的节点.种类.权限模式.链接数量.所归属的用户和用户组.最近访问或修改的时间等内容.具体情况如下: 命令: ls -lih 输出: [[email protected] test]# ls -lih total 0 51621141 drwxr-xr-x. 4 root root 159 Nov 20 19:24 dir1 33980025 -rw-r--r--. 1 root

linux命令(1):ls命令

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

每天一个linux命令(1):ls命令

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