博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
cat -n
阅读量:2442 次
发布时间:2019-05-10

本文共 1031 字,大约阅读时间需要 3 分钟。

You can   under Linux or Unix like operating systems. The cat command also number all output lines starting with number one with the following syntax:

cat -n fileNameHere

OR

cat --number foo.c

The -b / --number-nonblank option number all nonempty output lines, starting with one and the syntax is:

cat -b fileNameHere

OR

cat --number--nonblank filename

Finally, you suppress or remove repeated empty output lines with the -s / --squeeze-blank option:
cat -s -n fileNameHere

OR

cat --squeeze-blank -n filename

Say hello to nl command

Use  under Linux or Unix oses. The syntax is:

nl filename

Examples

Create a text file called hello.c as follows:

/* Purpose: Sample see program to print Hello world on stdout  * Author: nixCraft * Copyright: None / Copyleft */ #include
 /* our main */int main(void){
printf("Hello world\n"); return 0;}

Use the cat or nl command to display line numbers:

cat -n hello.cnl hello.c

Sample outputs:

Fig.01: Displaying line numbers for hello.c using the cat and nl command.

转载地址:http://yxiqb.baihongyu.com/

你可能感兴趣的文章
在Windows 7或Vista开始菜单上启用运行命令
查看>>
如何使用OneDrive共享Microsoft Word文档
查看>>
在iPhone上共享照片时如何删除位置数据
查看>>
将Internet Explorer 7和8菜单栏放回顶部
查看>>
如何在Windows Vista中使用Windows Movie Maker制作/编辑电影
查看>>
liunx内置火狐浏览器_使Firefox内置搜索框使用Google的实验搜索键
查看>>
如何在Linux上使用whois命令
查看>>
从系统托盘中删除QuickTime图标
查看>>
键盘忍者:无需鼠标即可启动任何应用程序
查看>>
c++ cleartype_在Windows Vista中调整ClearType字体设置
查看>>
在Windows Vista中重新启用睡眠模式
查看>>
在Firefox中使用安全登录
查看>>
查看chrome保存密码_如何在Google Chrome浏览器中查看已保存的密码
查看>>
安全计算:Avast Home Edition提供免费的病毒防护
查看>>
如何隐藏在不和谐状态下玩的游戏
查看>>
Exaile 0.3.0是Ubuntu的音乐播放器
查看>>
如何更新iPhone和iPad应用程序
查看>>
使用Media Center Studio自定义Windows Media Center开始菜单
查看>>
360浏览器极速模式自动_浏览器正在为网站带来自动暗模式
查看>>
tfw是哪个运营商_“ TFW”是什么意思,以及如何使用它?
查看>>