linux File Handling commands 'ls'.
ref:Linux / Unix Command: ls
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuSUX nor --sort.
Mandatory arguments to long options are mandatory for short options too.
- -a, --all
- do not hide entries starting with .
- -A, --almost-all
- do not list implied . and ..
- --author
- print the author of each file
- -b, --escape
- print octal escapes for nongraphic characters
- --block-size=SIZE
- use SIZE-byte blocks
- -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]
- 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=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
- -G, --no-group
- inhibit display of group information
- -h, --human-readable
- 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 on the command line
- --indicator-style=WORD append indicator with style WORD to entry names:
- none (default), classify (-F), file-type (-p)
- -i, --inode
- print 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 UIDs and GIDs
- -N, --literal
- print raw entry names (don't treat e.g. control characters specially)
- -o
- like -l, but do not list group information
- -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 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 size of each file, in blocks
- -S
- sort by file size
- --sort=WORD
- extension -X, none -U, size -S, time -t, version -v
- status -c, time -t, atime -u, access -u, use -u
- --time=WORD
- show time as WORD instead of modification time: atime, access, use, ctime or status; use specified time as sort key if --sort=time
- --time-style=STYLE
- show times using style STYLE: full-iso, long-iso, iso, locale, +FORMAT
- FORMAT is interpreted like `date'; if FORMAT is FORMAT1FORMAT2, 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
- sort by version
- -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
- --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 1,000,000, M 1,048,576, and so on for G, T, P, E, Z, Y.
By default, color is not used to distinguish types of files. That is equivalent to using --color=none. Using the --color option without the optional WHEN argument is equivalent to using --color=always. With --color=auto, color codes are output only if standard output is connected to a terminal (tty).
SEE ALSO
The full documentation for ls is maintained as a Texinfo manual. If the info and ls programs are properly installed at your site, the command
- info ls
should give you access to the complete manual.
Important: Use the man command (% man) to see how a command is used on your particular computer.
linux File Handling commands 'ls'.的更多相关文章
- Linux— file命令 用于辨识文件类型
Linux file命令用于辨识文件类型. 通过file指令,我们得以辨识该文件的类型. 语法 file [-bcLvz][-f <名称文件>][-m <魔法数字文件>...] ...
- Linux命令系列之ls——原来最简单的ls这么复杂
Linux命令系列之ls--原来最简单的ls这么复杂 ls命令应该是我们最常用的命令之一了,但是我们可能容易忽略那些看起来最简单的东西. 简介 ls命令的使用格式如下 ls [选项] [具体的文件] ...
- 20145239 Linux下常用的ls命令总结
20145239 Linux下常用的ls命令总结 通过学习本周的教学视频和要求掌握的内容,发现ls命令被使用的次数非常多,但作为一个初学者,可能我只会ls或者顶多ls -l两种用法.但其实ls是一个非 ...
- File handling in Delphi Object Pascal(处理record类型)
With new users purchasing Delphi every single day, it’s not uncommon for me to meet users that are n ...
- chattr lsattr linux file system attributes - linux 文件系统扩展属性
我们使用 linux 文件系统扩展属性,能够对linux文件系统进行进一步保护:从而给文件 赋予一些额外的限制:在有些情况下,能够对我们的系统提供保护: chattr命令用来改变文件属性.这项指令可改 ...
- 《学渣Linux笔记》——更改ls命令的输出颜色和命令提示符颜色(二)
<学渣Linux笔记>--更改ls命令的输出颜色和命令提示符颜色(二) II.更改命令提示符颜色 命令提示符的显示格式是由变量PS1决定的,首先我们查找GNU官方手册,发现如下内容(不是我 ...
- 【原】 The Linux Command Line- pwd,cd,ls,file,less
pwd - print name of current working directory. cd - change directory ls - list directory contents fi ...
- 磁盘、分区及Linux文件系统 [Disk, Partition, Linux File System]
1.磁盘基础知识 1.1 物理结构 硬盘的物理结构一般由磁头与碟片.电动机.主控芯片与排线等部件组成:当主电动机带动碟片旋转时,副电动机带动一组(磁头)到相对应的碟片上并确定读取正面还是反面的碟面,磁 ...
- Linux File Recovery Study
Background Today I did stupid things that I went into the ~/Downloads/ and pressed [Alt] + [A] then ...
随机推荐
- java 动态代理学习(Proxy,InvocationHandler)
前几天看到java的动态代理机制,不知道是啥玩意,然后看了看.死活不知道 invoke(Object proxy, Method m, Object[] args)种的proxy是个什么东西,放在这里 ...
- CodeForce 7 B - Memory Manager(模拟)
题目大意:给你一段内存,要你进行如下的三个操作. 1.分配内存 alloc X ,分配连续一段长度为X的内存. 如果内存不够应该输出NULL,如果内存够就给这段内存标记一个编号. 2.擦除编号为 ...
- 《编写高质量代码——Web前端开发修炼之道》读后随笔
结构样式行为的分离 结构标准包括XML标准.XHTML标准.HTML标准:样式标准有CSS标准:行为标准主要包括DOM标准和ECMAScript标准. 通常的项目会按照如上的方式进行分离,但自己曾今做 ...
- Spring 报错:Error creating bean with name
org.springframework.beans.factory.BeanCreationException: 原因是在autowire时,找不到相应的类,上述问题是因为XXXXX的实现类中没有加相 ...
- 记录下mybatis中#{}和${}传参的区别
最近在用mybatis,之前用过ibatis,总体来说差不多,不过还是遇到了不少问题,再次记录下, 比如说用#{},和 ${}传参的区别, 使用#传入参数是,sql语句解析是会加上"&quo ...
- 你真正的了解Ajax?Ajax技术简述
Ajax技术是目前在浏览器中通过JavaScript脚本可以使用的所有技术的集合.Ajax并没有创造出某种具体的新技术,它所使用的大多数技术都是在很多年以前就已经存在了,然而Ajax以一种崭新的方式来 ...
- Unable to locate the Javac Compiler 解决办法
在使用eclipse对maven项目进行编译打包(Run As->Maven install)时,报以下错误:[ERROR] Failed to execute goal org.apache. ...
- python获取网络时间和本地时间
今天我们来看一下如何用python获取网络时间和本地时间,直接上代码吧,代码中都有注释. python获取网络时间 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...
- Qt Quick 事件处理之信号与槽
前面两篇文章<QML 语言基础>和<Qt Quick 简单教程>中我们介绍了 QML 语言的基本的语法和 Qt Quick 的常见元素,亲们,通过这两篇文章,您应该已经能够完毕 ...
- CSS 有趣的边框
今天看到一篇文章.是利用CSS边框来做折纸效果.感觉非常有意思.于是就对CSS的border研究了一下.发现还真有一些好玩的使用方法. 1.border折纸效果 首先是HTML代码,为了简单,就一个d ...