Linux 命令学习(一天两个,回宿舍前)
三企鹅级命令:
bg [工作编号]
F: run job in the background,功能与命令后加上‘&’相同。如果没有指定工作编号,会将当前工作移到后台。
查询工作编号,用jobs命令。若要移回前台,fg。
CTRl+Z 暂停当前命令。
--------------------------------------
df(disk free)
显示磁盘的文件系统于使用情形
-h (--human-readable)
-a(--all)
-l(--loacl)
--sync
-t ext3 -x(--exclude-type) --block-size=2048
-T(--print-type)
-m(--megabytes) -k(kilobytes)
-i(--inodes)
[文件或者设备]
--------------------------------------
find
任何在参数之前的字符串都被视为是欲查找的目录,当前目录为默认值。-print为默认值。可在参数前加!,表示不符合此参数。-o可以链接两参数,表或运算。
注明: a--accessed c--changed m--modified
-amin 10/-10/+10 <一分钟计>
-cmin
-atime 10/-10/10,以24小时计
-ctime
-anewer <参考文件或目录> 表存取时间接近现在的,至于-follow之后
-cnewer <参考文件或目录> 表更改时间接近现在的,至于-follow之后
-empty 文件大小为0或者空文件夹
-depth 从指定目录下最深沉的子目录开始找
-name
-print 每行一个名称,
-print0 全部的名称都在同一行
-fprint 指定文件
-type <文件类型> b,block; c:character ; d:Directory; p:Named Pipe; f:regular File; l:symbolic link; s:socket
example
find /mnt -name hello.txt -fstype vfat
find /mnt -name hello.txt ! -fstype vfat
find -name long/* -o -name hu/*
find /tmp -user lll
find /tmp -uid +501
find /tmp -nouser
find /tmp -name hello -maxdepth 4 /mindepth
find /mnt -size +5120k
find /tmp -links +2
find /tmp -perm 0700 权限刚好为0700的/
find /tmp -name hello.txt -exec cat {} / (以/结尾,{}表示当前处理的文件) OK
---------------------------------