|
1
2
3
4
5
|
[root@localhost ~]# ls -ld /homedrwxr-xr-x. 4 root root 4096 9月 22 10:41 /home[root@localhost ~]# ls -d /home/home[root@localhost ~]# |
|
1
2
3
4
5
6
7
|
[root@localhost ~]# ls -h /homejustin lost+found[root@localhost ~]# ls -lh /home总用量 20Kdrwx------. 27 justin justin 4.0K 9月 22 13:19 justindrwx------. 2 root root 16K 9月 18 15:30 lost+found[root@localhost ~]# |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
[root@localhost ~]# ls -lR /home/home:总用量 20drwx------. 27 justin justin 4096 9月 22 13:19 justindrwx------. 2 root root 16384 9月 18 15:30 lost+found/home/justin:总用量 32drwxr-xr-x. 2 justin justin 4096 9月 22 10:49 公共的drwxr-xr-x. 2 justin justin 4096 9月 22 10:49 模板drwxr-xr-x. 2 justin justin 4096 9月 22 10:49 视频drwxr-xr-x. 2 justin justin 4096 9月 22 10:49 图片drwxr-xr-x. 2 justin justin 4096 9月 22 10:49 文档drwxr-xr-x. 2 justin justin 4096 9月 22 10:49 下载drwxr-xr-x. 2 justin justin 4096 9月 22 10:49 音乐drwxr-xr-x. 2 justin justin 4096 9月 22 10:49 桌面/home/justin/公共的:总用量 0/home/justin/模板:总用量 0/home/justin/视频:总用量 0/home/justin/图片:总用量 0/home/justin/文档:总用量 0/home/justin/下载:总用量 0/home/justin/音乐:总用量 0/home/justin/桌面:总用量 0/home/lost+found:总用量 0[root@localhost ~]# |
|
1
2
3
4
5
6
7
8
9
10
11
|
[root@localhost ~]# ls -l /home总用量 20drwx------. 27 justin justin 4096 9月 22 13:19 justindrwx------. 2 root root 16384 9月 18 15:30 lost+found-rw-r--r--. 1 root root 0 9月 22 15:21 t[root@localhost ~]# ls -lt /home总用量 20-rw-r--r--. 1 root root 0 9月 22 15:21 tdrwx------. 27 justin justin 4096 9月 22 13:19 justindrwx------. 2 root root 16384 9月 18 15:30 lost+found[root@localhost ~]# |
|
1
2
3
4
5
6
7
8
9
10
11
12
|
gssapi_mech.conf popt.d xmlgtk-2.0 portreserve yp.confhal postfix yumhost.conf ppp yum.confhosts prelink.cache yum.repos.dhosts.allow prelink.confhosts.deny prelink.conf.d[root@localhost etc]# ll -d /etc/po*.ddrwxr-xr-x. 2 root root 4096 1月 11 2010 /etc/popt.d[root@localhost etc]# ll -d /etc/po?.dls: 无法访问/etc/po?.d: 没有那个文件或目录[root@localhost etc]# |
|
1
2
3
4
5
|
[root@localhost src]# du -h nagios-3.5.0.tar.gz1.8M nagios-3.5.0.tar.gz[root@localhost src]# du nagios-3.5.0.tar.gz1748 nagios-3.5.0.tar.gz[root@localhost src]# |
-a---显示全部目录和其次目录下的每个档案所占的磁盘空间
|
1
2
3
|
[root@localhost local]# du -b src/nagios-3.5.0.tar.gz1789376 src/nagios-3.5.0.tar.gz[root@localhost local]# |
|
1
2
3
|
[root@localhost local]# du -sh src/41M src/[root@localhost local]# |
|
1
2
3
4
5
6
7
8
|
[root@localhost ~]# df -Th文件系统 类型 容量 已用 可用 已用%% 挂载点/dev/sda2ext49.9G 2.6G 6.9G 28% /tmpfs tmpfs 504M 112K 504M 1% /dev/shm/dev/sda1ext4194M 27M 158M 15% /boot/dev/sda5ext47.7G 147M 7.2G 2% /home/dev/sr0iso96602.9G 2.9G 0 100% /media/RHEL_6.3 i386 Disc 1[root@localhost ~]# |
|
1
2
3
4
5
6
|
[root@localhost home]# file justin/justin/: directory[root@localhost home]# file justin1justin1: empty[root@localhost ~]# file install.loginstall.log: UTF-8 Unicode text |
|
1
|
[root@localhost log]# cat /var/log/messages |
|
1
2
3
4
5
6
7
|
[root@localhost log]# more -5s /var/log/messagesSep 22 10:36:06 localhost kernel: imklog 5.8.10, log source= /proc/kmsgstarted.Sep 22 10:36:06 localhost rsyslogd: [origin software="rsyslogd"swVersion="5.8.10"x-pid="1323"x-info="http://www.rsyslog.com"] startSep 22 10:36:06 localhost kernel: Initializing cgroup subsys cpusetSep 22 10:36:06 localhost kernel: Initializing cgroup subsys cpu--More--(0%) |
|
1
2
3
4
5
6
7
|
[root@localhost ~]# head -5 /etc/passwdroot:x:0:0:root:/root:/bin/bashbin:x:1:1:bin:/bin:/sbin/nologindaemon:x:2:2:daemon:/sbin:/sbin/nologinadm:x:3:4:adm:/var/adm:/sbin/nologinlp:x:4:7:lp:/var/spool/lpd:/sbin/nologin[root@localhost ~]# |
|
1
2
3
4
5
6
7
|
[root@localhost ~]# tail -5 /etc/passwdnfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologinabrt:x:173:173::/etc/abrt:/sbin/nologinsshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologintcpdump:x:72:72::/:/sbin/nologinjustin:x:500:500:justin_peng:/home/justin:/bin/bash[root@localhost ~]# |
说明:tail命令用法与head命令类似
|
1
2
3
4
|
[root@localhost home]# touch file1 file2[root@localhost home]# lsfile1 file2 justin lost+found t[root@localhost home]# |
|
1
2
3
4
5
6
7
|
[root@localhost home]# lsjustin lost+found t[root@localhost home]# mkdir dir1[root@localhost home]# mkdir dir2/dirmkdir: 无法创建目录"dir2/dir": 没有那个文件或目录[root@localhost home]# mkdir -p dir2/dir[root@localhost home]# |
|
1
2
3
4
5
6
7
8
|
[root@localhost home]# lsjustin lost+found t[root@localhost home]# mkdir -p {dir1,dir2/{dir3,dir4}}[root@localhost home]# lsdir1 dir2 justin lost+found t[root@localhost home]# ls dir2dir3 dir4[root@localhost home]# |
|
1
2
3
4
5
6
7
8
9
10
|
[root@localhost home]# mkdir -p {dir1,dir2/dir3}[root@localhost home]# lsdir1 dir2 justin lost+found t[root@localhost home]# rmdir dir1[root@localhost home]# rmdir dir2rmdir: 删除 "dir2"失败: 目录非空[root@localhost home]# rmdir -p dir2/dir3/[root@localhost home]# lsjustin lost+found t[root@localhost home]# |
|
1
2
3
4
5
6
|
[root@localhost home]# mkdir -p dir1/dir2[root@localhost home]# rm -r dir1/rm:是否进入目录"dir1"? yrm:是否删除目录 "dir1/dir2"?yrm:是否删除目录 "dir1"?y[root@localhost home]# |



浙公网安备 33010602011771号