Linux cat命令:显示某个文件的内容到终端

cat 作用:显示某个文件的内容到终端。

案例:

我们把”hello world”写入 “test.txt“,然后用 cat 命令看看文件 “test.txt” 内容:

[root@bianchengshe web]# echo "hello world" > test.txt
[root@bianchengshe web]# cat test.txt
hello world

我们来看看 cat 一个内容比较丰富的文件:

[root@bianchengshe web]# cat web.log

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.7.RELEASE)

2022-09-29 18:56:44.488  INFO 2449397 --- [           main] data.server.App                          : Starting App v0.0.1-SNAPSHOT on rddata with PID 2449397 (/home/workspace/web/server-0.0.1-SNAPSHOT.jar started by root in /home/workspace/web)
2022-09-29 18:56:44.499  INFO 2449397 --- [           main] data.server.App                          : No active profile set, falling back to default profiles: default
2022-09-29 18:56:46.863  INFO 2449397 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8090 (http)
2022-09-29 18:56:46.893  INFO 2449397 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2022-09-29 18:56:46.893  INFO 2449397 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.34]
2022-09-29 18:56:46.998  INFO 2449397 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2022-09-29 18:56:46.998  INFO 2449397 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2330 ms
2022-09-29 18:56:47.860  INFO 2449397 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'

效果展示

图片[1]-Linux cat命令:显示某个文件的内容到终端-编程社
Linux cat命令
© 版权声明
THE END
喜欢就支持一下吧
点赞65 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称

    暂无评论内容