1/ 列出文件
echo /bin/*sh
ls /bin/*sh
2/ 使用touch 更新修改时间
#creat a new file
touch file
#update time of file
touch file
3/ 寻找文件
locate file
locate '*file*'
4/ 寻找命令存储
#where is gcc?
type gcc
gcc is /usr/local/bin/gcc
type cd
cd is a shell builtin
5/ find指令
find -name 'file'
find
6/ 文件系统的空间信息
df -k
df -h
xiewen@ubuntu:~/shell/dir-test$ df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/loop0 19G 6.4G 12G 36% /
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 385M 860K 384M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1.9G 18M 1.9G 1% /run/shm
/dev/sda4 143G 22G 122G 15% /host
/dev/sda6 196G 174G 22G 90% /media/本地磁盘
/dev/sda5 77G 67G 11G 87% /media/本地磁盘_
/dev/sda2 51G 47G 4.7G 91% /media/924C18204C180221
/dev/sda1 100M 31M 70M 31% /media/系统保留
7/比较文件diff
#file one, two
xiewen@ubuntu:~/shell/dir-test$ cat one
aaaa eee
bbbb
xiewen@ubuntu:~/shell/dir-test$ cat two
aaaa ddd
bbbb
ffff
xiewen@ubuntu:~/shell/dir-test$ diff one two
1c1
< aaaa eee
---
> aaaa ddd
2a3
> ffff