tar -- manipulate tape archives(磁带归档)可以用于压缩文件和解压文件
ar -- create and maintain library archives 集合许多文件,成为单一的备存文件。在备存文件中,所有成员文件皆保有原来的属性与权限。
passwd -- modify a user's password
date -- display or set date and time
cal, ncal -- displays a calendar and the date of Easter
who -- display who is logged in
finger -- user information lookup program
clear - clear the terminal screen
echo -- write arguments to the standard output
write -- send a message to another user (也可以给自己发)
wall -- write a message to users
talk -- talk to another user
mesg -- display (do not display) messages from other users 用户设置终端机的写入权限。
pwd -- return working directory name(print working directory)
mkdir -- make directories
rmdir -- remove directories
cd -- change directory
ls -- list directory contents
- -l :long 列出详细信息
- -a :all 列出所有文件
- -r :recursive 递归列出所有文件
- -R :reverse 反向排序列出(默认是按字母由小到大,-R 后是由大到小)
lsof - list open files
touch -- change file access and modification times (touch 之后,文件的修改时间会变化,即时并没有实质性修改。若 touch 指名的文件不存在,则会创建,因此 touch 可以用于新建文件)
cp -- copy files
mv -- move files
link, ln -- make links (注意 ln 命令默认是硬连接,加 -s 参数后变成软链接)
rm, unlink -- remove directory entries (unlink 也可用于删除文件)
cat -- concatenate and print files (一般就是输出文件内容)
more [filename] 读文件,一次显示一页(刚好布满整个终端)按空格键翻页。也可以用上下键滚动(一次滚动一行)
less [filename] 读文件,一次显示一页(刚好布满整个终端)按空格键翻页。也可以用上下键滚动(一次滚动一行)。比 more 更高级的是,less 还支持用触控板滑动上下翻。想去哪去哪。
mkdir -- make directories
mknod -- make device special file
mkfifo -- make fifos 可以用于创建命名管道文件(FIFO)
qiaodisheng@MBP: helloc $ mkfifo pipe
hello.c pipe
qiaodisheng@MBP: helloc $ ls -l
prw-r--r-- 1 qiaodisheng staff 0 4 24 10:01 pipe
locate -- find filenames quickly 用于查找符合条件的文档,他会去保存文档和目录名称的数据库内,查找合乎范本样式条件的文档或目录。
find -- walk a file hierarchy
-
find . -name "*.xml"
找出当前目录及其递归子目录下所有以 .xml 结尾的文件
grep -- 查找文件里符合条件的字符串。
file -- determine file type
head -- display first lines of a file 查看文件的开头部分的内容,参数 -n 用于显示行数,默认为 10,即显示 10 行的内容。
tail -- display the last part of a file
chmod -- change file modes or Access Control Lists 修改文件权限
chown -- change file owner and group
chgrp -- change group
umask -- 设置建立文件时预设的权限掩码,要给个三位数。默认权限 = 777 - umask
man - format and display the on-line manual pages 可以我man我自己
read
- -p 输入提示
- -n 跟一个数字,定义输入文本的长度
- -t 后面跟秒数,定义输入字符的等待时间,过时不候(没按回车)
- -s 安静模式,在输入字符时不再屏幕上显示,如输入密码
ps -- process status 用于显示当前进程状态,ps -A
可以显示所有进程状态
kill -- terminate or signal a process
uname -- Print operating system name
tty -- return user's terminal name
nice -- execute a utility with an altered scheduling priority