cd 和 ls 的用法

[root@tyzz ~]# whoami  #查看当前用户
root
[root@tyzz ~]# id   #查看当前用户 uid gif groups
uid=0(root) gid=0(root) groups=0(root)
[root@tyzz ~]# echo $HOME   #输出当前用户家目录
/root
[root@tyzz ~]# cd /mnt/ 进入/mnt
[root@tyzz mnt]# 
[root@tyzz mnt]# pwd   # 查看当前所在目录
/mnt
[root@tyzz mnt]# cd
[root@tyzz ~]# cd - #进入上次所在目录
/mnt
[root@tyzz ~]# ls -l #查看文件属性
total 880
-rw-r--r--  1 root root  10240 Feb 16 09:33 1.tar
[root@tyzz ~]# ls -a #查看隐藏文件
.              .bash_logout   .cshrc          .tcshrc 
[root@tyzz ~]# ls -i #查看innode号
114704 1.tar  114705 2.tar.gz     
[root@tyzz ~]# ls -d #只查看目录
.
[root@tyzz ~]# ls -ld

[root@tyzz ~]# ls -t #按时间显示
1.txt  passwd
原文地址:https://www.cnblogs.com/aallenn/p/6700590.html