Chinaunix首页 | 论坛 | 博客
  • 博客访问: 165449
  • 博文数量: 37
  • 博客积分: 1132
  • 博客等级: 准尉
  • 技术积分: 380
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-18 16:56
个人简介

吆嘻!

文章分类

全部博文(37)

文章存档

2013年(1)

2012年(19)

2011年(17)

分类: LINUX

2011-06-01 08:58:09

AIX utilities 工具

find 
find path expression(表达式)
find . -name sum
./test/sum
find . -name sum -print UNIX 环境下可能需要print
find . -name "m*" -exec ls -l {无空格,Matched file name} \;
find . -name "m*" -ok ls -l {无空格,Matched file name} \; 有互动效果,进一步做提示

-type  f 、d  文件、目录
-size +n 、-n、 n   意思为 blocks
-mtime +x、 -x   几天前修改的x
-prem onum、mode   access permissions match onum
-user  定义用户所有者
-o 或者 or
-newer 
 
 

 


grep
-v 不匹配
-c  行
-l 显示匹配 文件内的字符
-n 显示匹配的行号
-i 忽略大小写
-w 单词的搜索

egerp 与fgrep
egrep 允许使用| or 模式
fgrep -f 更快一些比grep

 

head  查看文件的前几行
head -5 myfile

tail 查看文件的最后几行

sort 对文件进行排序
sort 【-t delimiter】 【+fiedle【.column】】  【options】
options
-d 以字典方式进行排序, 字母数字。空格、参加排序
-r 反序
-n 算数指排序
-t 分隔符
-k 进行排序的关键字
sort +0.1  是指对第一行的第二字符进行排序
sort -t . -n +1
 


dosread,doswrite,dosdel,dosdir,dosformat DOS环境下的交互工具
dosdir 列出文件的内容
dosread copy a file
doswrite 写一个AIX文件到 dos环境
dosdel file   删除一个文件

tn ftp  和别的机器通讯的工具
tn = telnet
 
tar 命令 备份、恢复文件,归档文件

———————————————————————————————————————————————————————————————————————————————————————————-----

xargs
cat file | xargs -t(追踪) rm
实例1:
ls > printlist
cat printlist
file1
file2
file3
xargs -t qprt < printlist
实例2:
ls | xargs -t -I {} mv {} {}.old

实例3:
find . -type f -mtime +30 | xargs -t rm
rm ./file1 .file2
实例4:
find .type f | xargs -t grep -l hello


-links
实例5
find /home -type f -links +1 |xargs ls -li
文件链接数大于1 交给xargs 并ls下

实例6:
alias 与find、xargs 结合

alias myliks=‘find . -type f -links +1 |xargs ls -li’
alias myrm='find . -type f -mtime +30 | xargs rm ‘
which、whereis whence
diff 、cmp、dircmp
non-printable

 

which find grep
/usr/bin/find

whereis find grep
find: /usr/bin/find
grep:/usr/bin/grep

whence -pv find grep
grep is /usr/bin/grep
find is /usr/bin/find


file 命令  确定数据类型
 实例:
-bash-3.00$ ls
environment.txt  phone.txt        profile.txt
filenametest     phone2.txt       test
-bash-3.00$ ls > filenametest
————
-bash-3.00$ file -f filenametest
environment.txt:        ascii text
filenametest:   ascii text
phone.txt:      empty file
phone2.txt:     English text
profile.txt:    ascii text
test:           directory


-bash-3.00$
diff 文件比较命令

cmp names names.old
cmp -l names names.old


dircmp 比较目录
dircmp -d /home/team01 /home/team02

 

cat myfile
this file has tabs and spaces and ends with a return
 
cat -vte myfile显示不能打印的内容
-v  显示不可打印的字符, 让她可见
-t tab 这个字符 ^I
-e 每行最后的字符 $

建立一个文件结尾是进程的ID
touch myfile$$
ls
myfile1288

 
创建以月份为文件名字的文件

阅读(1561) | 评论(0) | 转发(0) |
0

上一篇:定义用户环境变量

下一篇:文件单位

给主人留下些什么吧!~~