zoukankan      html  css  js  c++  java
  • cat

    cat

    cat 是查看文本中所有数据的命令。

    [root@linux-node1 ~]# cat anaconda-ks.cfg 
    #version=DEVEL
    # System authorization information
    auth --enableshadow --passalgo=sha512
    # Use CDROM installation media
    cdrom
    # Use graphical install
    graphical
    # Run the Setup Agent on first boot
    firstboot --enable
    ignoredisk --only-use=sda
    # Keyboard layouts
    keyboard --vckeymap=us --xlayouts='us'
    # System language
    lang en_US.UTF-8

     参数:

    -n 给所有的行加上行号:

    [root@linux-node1 ~]# cat -n 123.txt 
         1    #version=DEVEL
         2    # System authorization information
         3    auth --enableshadow --passalgo=sha512
         4    # Use CDROM installation media
         5    cdrom
         6    # Use graphical install
         7    graphical
         8    # Run the Setup Agent on first boot
         9    firstboot --enable
        10    ignoredisk --only-use=sda
        11    # Keyboard layouts
        12    keyboard --vckeymap=us --xlayouts='us'
        13    # System language
        14    lang en_US.UTF-8

      

    -b 给有文本的行加上行号

    [root@linux-node1 ~]# cat -b 123.txt 
         1    #version=DEVEL
         2    # System authorization information
         3    auth --enableshadow --passalgo=sha512
         4    # Use CDROM installation media
         5    cdrom
         6    # Use graphical install
         7    graphical
    
    
    
    
    
         8    # Run the Setup Agent on first boot
         9    firstboot --enable
        10    ignoredisk --only-use=sda
        11    # Keyboard layouts
        12    keyboard --vckeymap=us --xlayouts='us'
        13    # System language
        14    lang en_US.UTF-8

     -T 参数会用^|字符组合去替换文件中的所有制表符

    [root@linux-node1 ~]# cat -T 123.txt 
    #version=DEVEL
    # System authorization information
    auth --enableshadow --passalgo=sha512
    # Use CDROM installation media
    cdrom
    # Use graphical install
    graphical
    1^I2^I3
    4^I5
    
    
    
    
    # Run the Setup Agent on first boot
    firstboot --enable
    ignoredisk --only-use=sda
    # Keyboard layouts
    keyboard --vckeymap=us --xlayouts='us'
    # System language
    lang en_US.UTF-8

      

      

     

    也许世上本没有幸运二字,只有那些给自己提出严格的要求,并且以高度自律逼自己完成的人,才能得到别人眼里的心想事成。
  • 相关阅读:
    应用文档iOS, 在应用之间共享文档。
    项目范围项目管理项目范围管理
    网站教程一些学习网站
    布局文件Android ListView入门知识各种Adapter配合使用
    随波逐流希望2013年半年小总结(复杂艰难的半年)
    安全微软微软安全新闻聚焦双周刊第三十二期
    对象类《大话设计模式》部分模式总结(一):
    循环跳转JAVA Continue实例详解
    节点程序寻找链表倒数第k个节点
    box2d编译
  • 原文地址:https://www.cnblogs.com/shigozsr/p/12723006.html
Copyright © 2011-2022 走看看