在线Linux命令查询工具

ls

显示目录内容列表

补充说明

ls命令用来显示目标列表,在Linux中是使用率较高的命令。ls命令的输出信息可以进行彩色加亮显示,以分区不同类型的文件。

语法

ls(选项)(参数)

选项

-a, --all        # 不隐藏任何以. 开始的项目
-A, --almost-all #   列出除. 及.. 以外的任何项目--author     # 与-l 同时使用时列出每个文件的作者
-b, --escape     # 以八进制溢出序列表示不可打印的字符--block-size=SIZE   #   scale sizes by SIZE before printing them; e.g.,#     '--block-size=M' prints sizes in units of#     1,048,576 bytes; 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, newest first
-C                      #   list entries by columns--color[=WHEN]      #   colorize the output; WHEN can be 'never', 'auto',#     or 'always' (the default); more info below
-d, --directory         #   list directories themselves, not their contents
-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        # 类似-l,但不列出所有者--group-directories-first#  group directories before files;#    can be augmented with a --sort option, but any#    use of --sort=none (-U) disables grouping
-G, --no-group          # 以一个长列表的形式,不输出组名
-h, --human-readable    # 与-l 一起,以易于阅读的格式输出文件大小(例如 1K 234M 2G)--si      # 同上面类似,但是使用1000 为基底而非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, --kibibytes          #  default to 1024-byte blocks for disk usage
-l                #  使用较长格式列出信息
-L, --dereference #  当显示符号链接的文件信息时,显示符号链接所指示# 的对象而并非符号链接本身的信息
-m   #     所有项目以逗号分隔,并填满整行行宽
-n, --numeric-uid-gid #  类似 -l,但列出UID 及GID 号
-N, --literal  #   输出未经处理的项目名称 (如不特别处理控制字符)
-o       # 类似 -l,但不列出有关组的信息
-p,  --indicator-style=slash # 对目录加上表示符号"/"
-q, --hide-control-chars #  print ? instead of nongraphic characters--show-control-chars #  show nongraphic characters as-is (the 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   #  逆序排列
-R, --recursive #  递归显示子目录
-s, --size      #  以块数形式显示每个文件分配的尺寸
-S                      #   sort by file size--sort=WORD         #   sort by WORD instead of name: none (-U), size (-S),#     time (-t), version (-v), extension (-X)--time=WORD         #   with -l, show time as WORD instead of default#     modification time: atime or access or use (-u)#     ctime or status (-c); also 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, or +FORMAT;#     FORMAT is interpreted like in 'date'; if FORMAT#     is FORMAT1<newline>FORMAT2, then 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, newest first
-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 lineSELinux 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    # 显示此帮助信息并退出--version # 显示版本信息并退出

参数

目录:指定要显示列表的目录,也可以是具体的文件。

实例

$ ls       # 仅列出当前目录可见文件
$ ls -l    # 列出当前目录可见文件详细信息
$ ls -hl   # 列出详细信息并以可读大小显示文件大小
$ ls -al   # 列出所有文件(包括隐藏)的详细信息

显示当前目录下包括影藏文件在内的所有文件列表

[root@localhost ~]# ls -a
.   anaconda-ks.cfg  .bash_logout   .bashrc  install.log         .mysql_history  satools  .tcshrc   .vimrc
..  .bash_history    .bash_profile  .cshrc   install.log.syslog  .rnd            .ssh     .viminfo

输出长格式列表

[root@localhost ~]# ls -1anaconda-ks.cfg
install.log
install.log.syslog
satools

显示文件的inode信息
索引节点(index inode简称为“inode”)是Linux中一个特殊的概念,具有相同的索引节点号的两个文本本质上是同一个文件(除文件名不同外)。

[root@localhost ~]# ls -i -l anaconda-ks.cfg install.log
2345481 -rw------- 1 root root   859 Jun 11 22:49 anaconda-ks.cfg
2345474 -rw-r--r-- 1 root root 13837 Jun 11 22:49 install.log

水平输出文件列表

[root@localhost /]# ls -mbin, boot, data, dev, etc, home, lib, lost+found, media, misc, mnt, opt, proc, root, sbin, selinux, srv, sys, tmp, usr, var

修改最后一次编辑的文件
最近修改的文件显示在最上面。

[root@localhost /]# ls -ttmp  root  etc  dev  lib  boot  sys  proc  data  home  bin  sbin  usr  var  lost+found  media  mnt  opt  selinux  srv  misc

显示递归文件

[root@localhost ~]# ls -R
.:
anaconda-ks.cfg  install.log  install.log.syslog  satools./satools:
black.txt  freemem.sh  iptables.sh  lnmp.sh  mysql  php502_check.sh  ssh_safe.sh

打印文件的UID和GID

[root@localhost /]# ls -ntotal 254
drwxr-xr-x   2 0 0  4096 Jun 12 04:03 bin
drwxr-xr-x   4 0 0  1024 Jun 15 14:45 boot
drwxr-xr-x   6 0 0  4096 Jun 12 10:26 data
drwxr-xr-x  10 0 0  3520 Sep 26 15:38 dev
drwxr-xr-x  75 0 0  4096 Oct 16 04:02 etc
drwxr-xr-x   4 0 0  4096 Jun 12 10:26 home
drwxr-xr-x  14 0 0 12288 Jun 16 04:02 lib
drwx------   2 0 0 16384 Jun 11 22:46 lost+found
drwxr-xr-x   2 0 0  4096 May 11  2011 media
drwxr-xr-x   2 0 0  4096 Nov  8  2010 misc
drwxr-xr-x   2 0 0  4096 May 11  2011 mnt
drwxr-xr-x   2 0 0  4096 May 11  2011 opt
dr-xr-xr-x 232 0 0     0 Jun 15 11:04 proc
drwxr-x---   4 0 0  4096 Oct 15 14:43 root
drwxr-xr-x   2 0 0 12288 Jun 12 04:03 sbin
drwxr-xr-x   2 0 0  4096 May 11  2011 selinux
drwxr-xr-x   2 0 0  4096 May 11  2011 srv
drwxr-xr-x  11 0 0     0 Jun 15 11:04 sys
drwxrwxrwt   3 0 0 98304 Oct 16 08:45 tmp
drwxr-xr-x  13 0 0  4096 Jun 11 23:38 usr
drwxr-xr-x  19 0 0  4096 Jun 11 23:38 var

列出文件和文件夹的详细信息

[root@localhost /]# ls -ltotal 254
drwxr-xr-x   2 root root  4096 Jun 12 04:03 bin
drwxr-xr-x   4 root root  1024 Jun 15 14:45 boot
drwxr-xr-x   6 root root  4096 Jun 12 10:26 data
drwxr-xr-x  10 root root  3520 Sep 26 15:38 dev
drwxr-xr-x  75 root root  4096 Oct 16 04:02 etc
drwxr-xr-x   4 root root  4096 Jun 12 10:26 home
drwxr-xr-x  14 root root 12288 Jun 16 04:02 lib
drwx------   2 root root 16384 Jun 11 22:46 lost+found
drwxr-xr-x   2 root root  4096 May 11  2011 media
drwxr-xr-x   2 root root  4096 Nov  8  2010 misc
drwxr-xr-x   2 root root  4096 May 11  2011 mnt
drwxr-xr-x   2 root root  4096 May 11  2011 opt
dr-xr-xr-x 232 root root     0 Jun 15 11:04 proc
drwxr-x---   4 root root  4096 Oct 15 14:43 root
drwxr-xr-x   2 root root 12288 Jun 12 04:03 sbin
drwxr-xr-x   2 root root  4096 May 11  2011 selinux
drwxr-xr-x   2 root root  4096 May 11  2011 srv
drwxr-xr-x  11 root root     0 Jun 15 11:04 sys
drwxrwxrwt   3 root root 98304 Oct 16 08:48 tmp
drwxr-xr-x  13 root root  4096 Jun 11 23:38 usr
drwxr-xr-x  19 root root  4096 Jun 11 23:38 var

列出可读文件和文件夹详细信息

[root@localhost /]# ls -lhtotal 254K
drwxr-xr-x   2 root root 4.0K Jun 12 04:03 bin
drwxr-xr-x   4 root root 1.0K Jun 15 14:45 boot
drwxr-xr-x   6 root root 4.0K Jun 12 10:26 data
drwxr-xr-x  10 root root 3.5K Sep 26 15:38 dev
drwxr-xr-x  75 root root 4.0K Oct 16 04:02 etc
drwxr-xr-x   4 root root 4.0K Jun 12 10:26 home
drwxr-xr-x  14 root root  12K Jun 16 04:02 lib
drwx------   2 root root  16K Jun 11 22:46 lost+found
drwxr-xr-x   2 root root 4.0K May 11  2011 media
drwxr-xr-x   2 root root 4.0K Nov  8  2010 misc
drwxr-xr-x   2 root root 4.0K May 11  2011 mnt
drwxr-xr-x   2 root root 4.0K May 11  2011 opt
dr-xr-xr-x 235 root root    0 Jun 15 11:04 proc
drwxr-x---   4 root root 4.0K Oct 15 14:43 root
drwxr-xr-x   2 root root  12K Jun 12 04:03 sbin
drwxr-xr-x   2 root root 4.0K May 11  2011 selinux
drwxr-xr-x   2 root root 4.0K May 11  2011 srv
drwxr-xr-x  11 root root    0 Jun 15 11:04 sys
drwxrwxrwt   3 root root  96K Oct 16 08:49 tmp
drwxr-xr-x  13 root root 4.0K Jun 11 23:38 usr
drwxr-xr-x  19 root root 4.0K Jun 11 23:38 var

显示文件夹信息

[root@localhost /]# ls -ld /etc/drwxr-xr-x 75 root root 4096 Oct 16 04:02 /etc/

按时间列出文件和文件夹详细信息

[root@localhost /]# ls -lttotal 254
drwxrwxrwt   3 root root 98304 Oct 16 08:53 tmp
drwxr-xr-x  75 root root  4096 Oct 16 04:02 etc
drwxr-x---   4 root root  4096 Oct 15 14:43 root
drwxr-xr-x  10 root root  3520 Sep 26 15:38 dev
drwxr-xr-x  14 root root 12288 Jun 16 04:02 lib
drwxr-xr-x   4 root root  1024 Jun 15 14:45 boot
drwxr-xr-x  11 root root     0 Jun 15 11:04 sys
dr-xr-xr-x 232 root root     0 Jun 15 11:04 proc
drwxr-xr-x   6 root root  4096 Jun 12 10:26 data
drwxr-xr-x   4 root root  4096 Jun 12 10:26 home
drwxr-xr-x   2 root root  4096 Jun 12 04:03 bin
drwxr-xr-x   2 root root 12288 Jun 12 04:03 sbin
drwxr-xr-x  13 root root  4096 Jun 11 23:38 usr
drwxr-xr-x  19 root root  4096 Jun 11 23:38 var
drwx------   2 root root 16384 Jun 11 22:46 lost+found
drwxr-xr-x   2 root root  4096 May 11  2011 media
drwxr-xr-x   2 root root  4096 May 11  2011 mnt
drwxr-xr-x   2 root root  4096 May 11  2011 opt
drwxr-xr-x   2 root root  4096 May 11  2011 selinux
drwxr-xr-x   2 root root  4096 May 11  2011 srv
drwxr-xr-x   2 root root  4096 Nov  8  2010 misc

按修改时间列出文件和文件夹详细信息

[root@localhost /]# ls -ltrtotal 254
drwxr-xr-x   2 root root  4096 Nov  8  2010 misc
drwxr-xr-x   2 root root  4096 May 11  2011 srv
drwxr-xr-x   2 root root  4096 May 11  2011 selinux
drwxr-xr-x   2 root root  4096 May 11  2011 opt
drwxr-xr-x   2 root root  4096 May 11  2011 mnt
drwxr-xr-x   2 root root  4096 May 11  2011 media
drwx------   2 root root 16384 Jun 11 22:46 lost+found
drwxr-xr-x  19 root root  4096 Jun 11 23:38 var
drwxr-xr-x  13 root root  4096 Jun 11 23:38 usr
drwxr-xr-x   2 root root 12288 Jun 12 04:03 sbin
drwxr-xr-x   2 root root  4096 Jun 12 04:03 bin
drwxr-xr-x   4 root root  4096 Jun 12 10:26 home
drwxr-xr-x   6 root root  4096 Jun 12 10:26 data
dr-xr-xr-x 232 root root     0 Jun 15 11:04 proc
drwxr-xr-x  11 root root     0 Jun 15 11:04 sys
drwxr-xr-x   4 root root  1024 Jun 15 14:45 boot
drwxr-xr-x  14 root root 12288 Jun 16 04:02 lib
drwxr-xr-x  10 root root  3520 Sep 26 15:38 dev
drwxr-x---   4 root root  4096 Oct 15 14:43 root
drwxr-xr-x  75 root root  4096 Oct 16 04:02 etc
drwxrwxrwt   3 root root 98304 Oct 16 08:54 tmp

按照特殊字符对文件进行分类

[root@localhost nginx-1.2.1]# ls -Fauto/  CHANGES  CHANGES.ru  conf/  configure*  contrib/  html/  LICENSE  Makefile  man/  objs/  README  src/

列出文件并标记颜色分类

[root@localhost nginx-1.2.1]# ls --color=autoauto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  Makefile  man  objs  README  src

在线Linux命令查询工具

Linux常用命令——ls命令-编程之家
原文链接

查看全文

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.dgrt.cn/a/1707803.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章:

Linux常用命令——ls命令-编程之家

Linux常用命令——ls命令

在线Linux命令查询工具
ls
显示目录内容列表
补充说明
ls命令用来显示目标列表,在Linux中是使用率较高的命令。ls命令的输出信息可以进行彩色加亮显示,以分区不同类型的文件。
语法
ls(选项)(参数)选……

Linux常用命令——ls命令-编程之家

STM32CubeMX使用说明

目录1 软件安装1.1 软件&环境下载1.1.1 STM32CubeMX软件下载1.1.2 Java环境下载1.2 安装1.2.1 Java环境安装1.2.2 STM32CubeMX软件安装2 软件启动与安装库文件2.1 软件界面2.2 修改默认库文件路径2.3 在线安装固件库3 新建第一个工程3.1 新建工程3.2 选择MCU型号3.3 设置De……

Linux常用命令——ls命令-编程之家

做一个简易的图片切换代码

做一个简易的图片切换代码
网上大佬些的代码我感觉还是对于我这种新手太难了,光看布局就看了好久,我这就写了个自己做的超级简单的纯js代码, var i 1; //作为一个循环的数//通过点击切换function qie(number) { //这个函……

Linux常用命令——ls命令-编程之家

node多个res.end数据返回会返回最后一个

最近在做毕业设计
后台node学了没多久,在设计专门给登录做的url时发生了一些问题
这串代码,运行,并且前端请求后,前端控制台打印出了404,然后后台控制台打印出了数据,很明显登录请求的res.end(subdata.us……

Linux常用命令——ls命令-编程之家

不使用jq,自行封装的简单的ajax

请求样式


ajax( 2, //1是get 2是post/aaa, //请求的url{ //请求的数据 (没有数据填0)a:123,b:321},function(data){} //服务器响应
)​​
ajax的代码
function……

Linux常用命令——ls命令-编程之家

js锚记跳转的两个个注意事项

js锚记跳转的两个个注意事项
1.锚记节点 a标签是用的name ,div用的是id,div用name是不生效的
2.跳转的方式有location.hash和location.herf,在这两者建议使用herf,hash只在第一次跳转到页面时起作用,herf是一直都可以使用…

Linux常用命令——ls命令-编程之家

vue路由拦截器遇到的坑

思路,所有的跳转该域名的url,都会跳转到登陆login页面,在login页面输入正确的账号和密码后,后台返回一个token,存在sessionStorage 里面,拦截器读取到token就放
router.beforeEach((to,from,next) > {l……

Linux常用命令——ls命令-编程之家

node设置跨域允许

搞了两天终于不再报错了,看得我浑身发抖,大热天的全身冷汗,手脚冰凉,地狱空荡荡魔鬼在人间,这个社会还能不能好了?后台 到底要怎么活着你们才满意 ?眼泪不争气的流了下来 ,这个社会到……

Linux常用命令——ls命令-编程之家

undefined is not a promise

第一次用Promise,报错
查了下
没new
每一个环节都要new new Promise((resolve,reject) > {req.on(end,() > {str JSON.parse(str)resolve(str)})}).then(str > { console.log(str)return Promise(resolve > {
}
这没new就报错了
改正 new Promise……

Linux常用命令——ls命令-编程之家

option请求不能人为添加任何东西

今天花了我一下午的时间,能气死 后台的路由拦截思路是,请求token的请求放行,其他的请求全部验证一遍token,headers里面的token正确才让过,本来是很正常的, 但是我有个请求用户名的post请求一直被卡着&#……

Linux常用命令——ls命令-编程之家

深度分析Palantir的投资价值,Palantir2023年将实现强劲反弹?

来源:猛兽财经 作者:猛兽财经 在本文中,猛兽财经将通过对Palantir的股票关键指标、商业模式、盈利能力、影响Palantir2023年股价的关键利好因素等方面,对Palantir进行全面、深度的分析。 Palantir股票的关键指标 自从Palantir(PL……

Linux常用命令——ls命令-编程之家

Pandas入门实践2 -数据处理

为了准备数据进行分析,我们需要执行数据处理。在本节中,我们将学习如何清理和重新格式化数据(例如,重命名列和修复数据类型不匹配)、对其进行重构/整形,以及对其进行丰富(例如,离散化……

Linux常用命令——ls命令-编程之家

一、lua基础知识1

一、lua 的数据类型
–类型 a1; –number print(type(a)) –number b"HelloWorld"; print(type(b)) –string 两种数据类型 ctrue; print(type(c)) –boolean true 或者 false d print; d("HelloWorld"); print(type(d)); –function类型 ……

Linux常用命令——ls命令-编程之家

二、lua语言基础2

1.lua的类型有哪些?答:lua的数据类型有:number,string,nil function,table,thread,userdata(用户自定义的类型),boolean(布尔类型) 2.什么是尾调用,尾调用有什么优点尾调用:在一个函数的最后一步开始调用另……

Linux常用命令——ls命令-编程之家

quick-cocos2dx-luaUI控件讲解

–MyApp部分 require("config") require("cocos.init") require("framework.init") local MyApp class("MyApp", cc.mvc.AppBase) function MyApp:ctor() MyApp.super.ctor(self) end function MyApp:run() cc.FileUti……

Linux常用命令——ls命令-编程之家

quick-cocos2dx lua语言讲解 (动作,定时器,触摸事件,工程的类的讲解)

–MainScene部分
— display.newScene 创建一个场景 — 在quick里面我们的控件、精灵 一般是加载到场景上的 local MainScene class("MainScene", function() return display.newScene("MainScene") end) function MainScene:ctor() –创……

Linux常用命令——ls命令-编程之家

使用quick-cocos2dx-lua 实现的小游戏(包含碰撞检测,触屏发子弹)

–主界面local MainScene class("MainScene", function()return display.newScene("MainScene")end)ON true;function MainScene:ctor()local bg cc.Sprite:create("main_background.png");bg:setScale(2);bg:setPosition(display.cx,display……

Linux常用命令——ls命令-编程之家

cocos2d-js 中scrollview详解

/****
开头的一些废话:
1、多思考,善于思考
2、懂得变通
3、多多查询API首先复制一段 API中的源码:(UIScrollView.js)这段代码可以看出 scrollview
中的容器是一个node,并且他的位置是:代码最后……

Linux常用命令——ls命令-编程之家

cocos2d-js中的回调函数中世界坐标系和节点坐标系的相互转换

世界坐标系和节点坐标系都是OPENGL 坐标系 1、世界坐标系原点就是屏幕的左下角; 2、节点坐标系的原点就是一个节点的左下角; 3、两个坐标系可以通过已经写好的cocosAPI进行想换转换; 4、所有的节点需要转为一个节点上或者是统一的世界坐标系……

Linux常用命令——ls命令-编程之家

通过JavaScript实现漂浮

<html>
<head><meta http-equiv"Content-Type" content"text/html"; charset"gb2312" /><title>漂浮广告</title><style type"text/css">div{position:absolute;}</style>
</head>
&……