linux命令第四天--ls

本文详细介绍了Linux中ls命令的使用方法,包括不同选项的含义和应用场景,如显示隐藏文件、按时间排序、列出目录信息等,帮助用户更好地管理和查看文件系统。
摘要由CSDN通过智能技术生成

目录

ls 查看 list 列出

使用方法:

man ls

ls --help

Usage:ls [OPTION]... [FILE]...

 单纯的ls

-a 选项 显示. 和.. 隐藏文件

-A 选项 显示.开头的文件   但是不显示.. 和.

-c 排序 可以结合-t 按时间排序

-d 列出目录本身 而不是内容

-F 目录会列出/

-g 打印组名

-l 列出详细信息 一般都会加上这个 很方便

-h 文件大小用单位来表示

-i 列出inode

 -m 后面添加逗号

-n 将uid 列出来

 -r 反转 倒序 排序的时候

-S 通过文件大小排序

-1 每行一个文件


ls 查看 list 列出

使用方法:

  • man ls

  • 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 is specified.
    
    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 C-style escapes for nongraphic characters
          --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                         like -l, but do not list owner
          --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             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, --kibibytes            default to 1024-byte blocks for disk usage
      -l             
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值