1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| # 读取 cat file # 输出这个文件的全部内容,用于查看小文件
head file # 查看文件的头部 head --lines=n file # 查看文件的前n行 tail file # 查看文件的尾部 tail --lines=n file # 查看文件的后n行
less file # 查看文件的全部内容,允许上下滚动,用于长文件 more file # 查看文件的全部内容,只允许向下滚动
# 修改
vim file # i 进入编辑模式;冒号+wq 保存并退出;q!强制退出 vi file nano file
# 删除
rm file
|