| |
|
开发:
C++知识库
Java知识库
JavaScript
Python
PHP知识库
人工智能
区块链
大数据
移动开发
嵌入式
开发工具
数据结构与算法
开发测试
游戏开发
网络协议
系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程 数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁 |
-> 系统运维 -> Linux基本命令之文件及目录命令02 -> 正文阅读 |
|
[系统运维]Linux基本命令之文件及目录命令02 |
|
操作 | 功能 |
---|---|
空格键 | 向下翻一页 |
Enter | 向下翻一行 |
q | 退出more,不在显示内容 |
Ctrl+b | 返回上一屏 |
Ctrl+F | 向下滚动一屏 |
/字符 | 查找这个字符 |
2.13、less:分页显示文件内容
? less与more命令类似,都是用来查看文件的内容,但是比 more 指令更加强大,支持各种显示终端。less 指令在显示文件内容时,并不是一次将整个文件加载之后才显示,而是根据显示需要加载内容,以分屏幕
的方式显示文本文件的内容对于显示大型文件具有较高的效率。
语法
less [参数] [文件]
参数说明:
案例
1.查看/home/itbestboy/test01 目录下的hello.java文件。
[root@root /]# less /home/itbestboy/test01/hello.java
**注:**常用操作
操作 | 功能 |
---|---|
Ctrl+D | 向前滚动半屏 |
Ctrl+U | 向后滚动半屏 |
q | 退出more,不在显示内容 |
Ctrl+B | 向后移动一屏 |
Ctrl+F | 向前滚动一屏 |
/字符 | 查找这个字符 |
2.14、head:显示文件头部内容
? head 命令可用于查看文件的开头部分的内容,默认显示 10 行的内容。
语法
head [参数] [文件]
参数:
案例
1.查看/home/itbestboy/test01 目录下的hello.java文件的前10行。
[root@root /]# head /home/itbestboy/test01/hello.java
hello everyone!!!!!
HELLOW JAVA PYTHON
HELLO
GOOGL
There is no denying the fact that it is a hotly debated topic
today how college graduates should choose their careers.
Some time ago, it was reported that some college graduates chose to work as village officials.
2.查看/home/itbestboy/test01 目录下的hello.java文件的前10个字符。
[root@root /]# head -c 10 /home/itbestboy/test01/hello.java
hello ever
2.15、tail:显示文件尾部内容
tail 用于输出文件中尾部的内容,默认情况下 tail 指令显示文件的后 10 行
内容。一般这个命令还可以用来做追踪,比如日志更新等
语法
tail [参数] [文件]
参数:
案例
1.查看/home/itbestboy/test01 目录下的hello.java文件的后20行。
[root@root /]# tail -n 20 /home/itbestboy/test01/hello.java
There is no denying the fact that it is a hotly debated topic
today how college graduates should choose their careers.
Some time ago, it was reported that some college graduates chose to work as village officials.
To this people's attitudes differ sharply. Some hold the positive view while others are against it.
As far as I am concerned, I believe that it is a wise choice.
On the one hand, college graduates can contribute a lot to the development of the countryside.
First, they can apply their professional knowledge there.
Secondly, they can introduce new concepts to the countryside and speed the development of rural culture
. As a result, the gap between the city and the countryside can well be bridged.
On the other hand, these graduates can benefit a lot from working as village officials
. While too many college graduates are fighting for the handful of positions in big cities,
these graduates can find themselves a wider stage of development and realize their value.
Therefore, college graduates working as village officials is a win-win choice and more graduates should be encouraged to work in the countryside.
[root@root /]#
2.查看/home/itbestboy/test01 目录下的hello.java文件的后20个字符。
[root@root /]# tail -c 20 /home/itbestboy/test01/hello.java
in the countryside.
3.追踪/home/itbestboy/test01 目录下hello.java文件的增长情况。
[root@root /]# tail -f /home/itbestboy/test01/hello.java
2.16、nl:显示行号
语法
nl [参数] [文件]
选项与参数:
案例
查看/home/itbestboy/test01 目录下的hello.java文件。
[root@root /]# nl /home/itbestboy/test01/hello.java
1 hello everyone!!!!!
2 HELLOW JAVA PYTHON
3 HELLO
4 GOOGL
5 There is no denying the fact that it is a hotly debated topic
6 today how college graduates should choose their careers.
7 Some time ago, it was reported that some college graduates chose to work as village officials.
8 To this people's attitudes differ sharply. Some hold the positive view while others are against it.
9 As far as I am concerned, I believe that it is a wise choice.
10 On the one hand, college graduates can contribute a lot to the development of the countryside.
11 First, they can apply their professional knowledge there.
12 Secondly, they can introduce new concepts to the countryside and speed the development of rural culture
13 . As a result, the gap between the city and the countryside can well be bridged.
14 On the other hand, these graduates can benefit a lot from working as village officials
15 . While too many college graduates are fighting for the handful of positions in big cities,
16 these graduates can find themselves a wider stage of development and realize their value.
17 Therefore, college graduat
Linux基本命令之文件及目录命令01:---------------------------------------------------------《加载完成》---------------------------------------------------------------
|
|
上一篇文章 下一篇文章 查看所有文章 |
|
开发:
C++知识库
Java知识库
JavaScript
Python
PHP知识库
人工智能
区块链
大数据
移动开发
嵌入式
开发工具
数据结构与算法
开发测试
游戏开发
网络协议
系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程 数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁 |
360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年12日历 | -2024/12/27 11:34:24- |
|
网站联系: qq:121756557 email:121756557@qq.com IT数码 |
数据统计 |