file managment for solaris (二)
File and directory contents display
一: file contents display
head command:
syntax : head -n N file_name
N 为正整数,表示要显示文件的前N行内容。默认是10
tail command:
syntax : tail -n N file_name
N 为正整数,表示要显示文件的N行内容。默认是10
more command:
syntax: more option file_name
+/text 表示分页显示,并且将光标停在与text字符想匹配的字符处。
-n 表示分页显示,并且指定每敲空格一次,下翻几行。默认一屏。
在more中可使用的命令:
/text 搜索文本,按n向下搜索,按大N向上搜索。
!command 在more中执行系统命令
: p 在多文件查看中,显示当前文件的上一个文件的名字
: f 在多文件查看中,显示当前文件的名字
: n 在多文件查看中,显示当前文件的下一个文件的名字
q OR Q 退出more
file command:
syntax: file file_name 用于确定文件的类型
wc command:
syntax: wc [-l][-w][-c] file_name
-l 用于计算并显示文件的行数
-w 用于计算并显示文件的字数
-c 用于计算并显示文件的字符数
该命令默认三参数同时使用,既返回文件的行数,字数,字符数。
二: directory contents display.
ls command:
syntax: ls option directory_name
-l 以长格式显示详细信息
-a 显示所有信息,包括隐藏文件
该命令选项较多,记住长用的则可。当然全记住更好。
阅读(509) | 评论(0) | 转发(0) |