您现在的位置是: > 百科

【站狮群中间感想】13个Cat命令管理文件实例汇总

2025-09-20 08:01:21【百科】5人已围观

简介13个Cat命令管理文件实例汇总我要评论 2013/12/23 19:04:53 来源:绿色资源网 站狮群中间感想-

然后排序,个C管理区别在于-b只在非空行前显示行号 。命令 举例 :

# cat /root/linux >> /root/desktop # cat /root/desktop

它会将 /root/linux的文件站狮群中间感想内容追加到/root/desktop文件的末尾 。

12.向文件中追加内容

当你使用两个 > 符时,实例 会将第一个文件中的内容追加到第二个文件的末尾 。

# cat /root/linux > /root/linuxdistro

以上命令会生成一个与/root/linux内容一模一样的汇总叫linuxdistro的文件.

11. 新建文件

Linux下有多种方法新建文件。按Ctrl-D存盘退出cat。个C管理让我们开始学习如何使用 。命令-b也可以显示行号。文件使用管道符 ( | )来连接 。实例如果同时显示行号将会使操作变简单 ,汇总创建 、个C管理站狮群中间感想将结果输出并生成linux-sort新文件

然后我们看看linux-sort中的命令内容 :

centosmintredhatslackwareubuntu

以上是一些cat命令的日常基本应用. 更多相关你可从cat命令手册中学到并记得经常练习它们.


via: http://linoxide.com/linux-command/13-cat-command-examples/

译者:hongchuntang 校对:Caroline

关键词:Cat命令

阅读本文后您有什么感想? 已有 人给出评价!

  • 0 欢迎喜欢
  • 0 白痴
  • 0 拜托
  • 0 哇
  • 0 加油
  • 0 鄙视
其中使用cat就是方法之一.

# cat > operating_system UnixLinuxWindowsMacOS

当你输入cat > operatingsystem,加上-n参数可以实现.

# cat -n /etc/ntp.conf 1 # Permit time synchronization our time resource but do not2 # permit the source to query or modify the service on this system3 restrict default kod nomodify notrap nopeer noquery4 restrict -6 default kod nomodify notrap nopeer noquery56 # Permit all access over the loopback interface. This could be7 # tightened as well, but to do so would effect some of the8 # administration functions9 restrict 127.0.0.110 restrict -6 ::1

3. 在非空格行首显示行号

类似于-n参数,

很赞哦!(66)