chenz@Chenzc:~/test$ ls a b backup test.c chenz@Chenzc:~/test$ ls -l total 16 drwxr-xr-x 2 chenz chenz 4096 Jan 15 00:09 a -rw-r--r-- 1 chenz chenz 1 Jan 15 00:08 b drwxr-xr-x 8 chenz chenz 4096 Feb 10 17:19 backup -rw-r--r-- 1 chenz chenz 132 Feb 11 00:51 test.c chenz@Chenzc:~/test$ ls -a . .. .a.txt a b backup test.c
pwd
输出当前目录
1 2 3 4 5
chenz@Chenzc:~/test$ pwd /home/chenz/test chenz@Chenzc:~/test$ cd ../ chenz@Chenzc:~$ pwd /home/chenz
cd
切换目录
1 2 3 4 5 6 7 8
chenz@Chenzc:~/test$ pwd /home/chenz/test chenz@Chenzc:~/test$ cd ./ chenz@Chenzc:~$ pwd /home/chenz/test chenz@Chenzc:~/test$ cd ../ chenz@Chenzc:~$ pwd /home/chenz
mkdir
创建目录
1 2 3
chenz@Chenzc:~$ mkdir c chenz@Chenzc:~$ cd c chenz@Chenzc:~/c$
chenz@Chenzc:~/test$ ls a b backup test.c chenz@Chenzc:~/test$ cat test.c #include <stdint.h> typedef unsigned int uint; typedef unsigned long uint64;
uint64 add(uint a, uint b) { return a + b + b; }
head / tail / more / less
查看文件开头 尾部 详细 省略内容
可以搭配某些选项实现特殊效果
1 2 3 4 5 6 7 8 9 10 11 12
chenz@Chenzc:~/test$ cat d.txt hello world chenz@Chenzc:~/test$ head d.txt hello world chenz@Chenzc:~/test$ tail d.txt hello world chenz@Chenzc:~/test$ more d.txt hello world chenz@Chenzc:~/test$ less d.txt chenz@Chenzc:~/test$ tail -f d.txt hello world ^C