注:
下面的测试中提到的0331,0401,0312等都是目录名
cd
cd 目录名
root@jsetc-virtual-machine:/# cd 0331
root@jsetc-virtual-machine:/0331#
cd 目录路径
root@jsetc-virtual-machine:/0331# cd /0312/make
root@jsetc-virtual-machine:/0312/make#
cd /
root@jsetc-virtual-machine:/0331# cd /
root@jsetc-virtual-machine:/#
cd ..
root@jsetc-virtual-machine:/0312/make# cd ..
root@jsetc-virtual-machine:/0312#
cd -
root@jsetc-virtual-machine:/0312/make# cd ..
root@jsetc-virtual-machine:/0312# cd -
/0312/make
root@jsetc-virtual-machine:/0312/make#
ls
ls:
root@jsetc-virtual-machine:/0331# ls
fifo r1.c read.c si.c w1 write
r1 read si test.txt w1.c write.c
ls /目录名
root@jsetc-virtual-machine:/0331# ls /0401
dx dx.c jn jn.c sh sh.c
ls -a
root@jsetc-virtual-machine:/0331# ls -a
. fifo r1.c read.c si.c w1 write
.. r1 read si test.txt w1.c write.c
ls -A
root@jsetc-virtual-machine:/0331# ls -A
fifo r1.c read.c si.c w1 write
r1 read si test.txt w1.c write.c
ls -c
root@jsetc-virtual-machine:/# ls -c
tmp 0327 0322 0311 sbin var
run 0314 0318 home snap srv
root 0326 0317 etc boot opt
0402 0319 0315 c initrd.img initrd.img.old
0401 0325 dev libx32 vmlinuz swapfile
0331 0316 sys usr vmlinuz.old lost+found
0330 zuoye proc lib media
0329 0324 0312 lib32 mnt
0328 0323 bin lib64 cdrom
ls -C
root@jsetc-virtual-machine:/# ls -C
0311 0323 0401 initrd.img opt tmp
0312 0324 0402 initrd.img.old proc usr
0314 0325 bin lib root var
0315 0326 boot lib32 run vmlinuz
0316 0327 c lib64 sbin vmlinuz.old
0317 0328 cdrom libx32 snap zuoye
0318 0329 dev lost+found srv
0319 0330 etc media swapfile
0322 0331 home mnt sys
ls -l
root@jsetc-virtual-machine:/0331# ls -l
total 80
prw-r--r-- 1 root root 0 3月 31 14:50 fifo
-rwxr-xr-x 1 root root 8656 3月 31 16:28 r1
-rw-r--r-- 1 root root 584 3月 31 16:33 r1.c
-rwxr-xr-x 1 root root 8480 3月 31 11:32 read
-rw-r--r-- 1 root root 303 3月 31 11:32 read.c
-rwxr-xr-x 1 root root 8416 3月 31 17:36 si
-rw-r--r-- 1 root root 245 3月 31 17:36 si.c
prw-r--r-- 1 root root 0 3月 31 16:34 test.txt
-rwxr-xr-x 1 root root 8664 3月 31 16:34 w1
-rw-r--r-- 1 root root 593 3月 31 16:34 w1.c
-rwxr-xr-x 1 root root 8536 3月 31 14:31 write
-rw-r--r-- 1 root root 329 3月 31 14:31 write.c
ls -lh
root@jsetc-virtual-machine:/0331# ls -lh
total 80K
prw-r--r-- 1 root root 0 3月 31 14:50 fifo
-rwxr-xr-x 1 root root 8.5K 3月 31 16:28 r1
-rw-r--r-- 1 root root 584 3月 31 16:33 r1.c
-rwxr-xr-x 1 root root 8.3K 3月 31 11:32 read
-rw-r--r-- 1 root root 303 3月 31 11:32 read.c
-rwxr-xr-x 1 root root 8.3K 3月 31 17:36 si
-rw-r--r-- 1 root root 245 3月 31 17:36 si.c
prw-r--r-- 1 root root 0 3月 31 16:34 test.txt
-rwxr-xr-x 1 root root 8.5K 3月 31 16:34 w1
-rw-r--r-- 1 root root 593 3月 31 16:34 w1.c
-rwxr-xr-x 1 root root 8.4K 3月 31 14:31 write
-rw-r--r-- 1 root root 329 3月 31 14:31 write.c
在以上命令后,缀上目录名的作用就是锁定要查看的目录,不在当前目录下的目录要查看则要缀上要查看的目录路径,不缀目录名就默认查看当前所在目录。