Linux 命令 ls,ls命令 linux ls命令用法详解

ls list directory contents 列出目录 也可以是文件

参数

-a =all 列出所有文件,包括隐藏文件,示例

[root@bob ~]# ls

anaconda-ks.cfg ett.txt install.log install.log.syslog

[root@bob ~]# ls -a

. anaconda-ks.cfg .bash_logout .bashrc ett.txt install.log.syslog .viminfo

.. .bash_history .bash_profile .cshrc install.log .tcshrc

在linux中以.开头的文件为隐藏文件,其中.代表当前目录,..代表上一层目录。

-l 以长格式列出文件列表输出内容,示例

[root@bob ~]# ls -l

total 48

-rw-------. 1 root root 1252 Dec 18 19:10 anaconda-ks.cfg

-rw-r--r--. 1 root root 6 Dec 19 06:35 ett.txt

-rw-r--r--. 1 root root 27312 Dec 18 19:10 install.log

-rw-r--r--. 1 root root 7572 Dec 18 19:09 install.log.syslog

-t 以文件的修改时间排序

[root@bob ~]# ls -tl

total 48

-rw-r--r--. 1 root root 6 Dec 19 06:35 ett.txt

-rw-------. 1 root root 1252 Dec 18 19:10 anaconda-ks.cfg

-rw-r--r--. 1 root root 27312 Dec 18 19:10 install.log

-rw-r--r--. 1 root root 7572 Dec 18 19:09 install.log.syslog

-d 仅显示目录

-s 显示文件的大小已区块显示

[root@bob ~]# ls -s

total 48

4 anaconda-ks.cfg 4 ett.txt 32 install.log 8 install.log.syslog

--color[=WHEN] 使用不同颜色显示不同类型的文件

差不多就写到这里,,有空在总结

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值