Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Text processing command series-- cat

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

The main function of cat is to connect and display the contents of the file. You can follow multiple files to be displayed later.

Common options:

-n: displays the line number

-E: displays the Terminator. Line Terminator under Linux is $(\ n), line Terminator under windows is ^ M (\ r\ n)

Example:

[root@vm1 ~] # cat-n / etc/issue 1CentOS release 6.5 (Final) 2Kernel\ r on an\ m 3 [root@vm1] # [root@vm1 ~] # cat-E / etc/issueCentOS release 6.5 (Final) $Kernel\ r on an\ etc/issueCentOS release $[root@vm1 ~] #

The newline character of Windows is converted to the newline character of Linux: dos2unix

The newline character of Linux is converted to the newline character of Windows: unix2dos

The package needs to be installed:

Yum install-y dos2unix unix2dos

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report