=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2374 - July  2, 2006

                   
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

리눅스에서의 줄 번호

만일 파일내용과 줄 번호를 원한다면(인쇄할 때)(?)
리눅스에서는 "nl" 명령어를 사용할 수 있다.

$ nl file.c > file.c.num

많은 옵션을 위해서는 man 페이지를 보라.
보통 nl은 공백이 아닌 줄만 줄번호를 붙인다.

강제로 모든 줄에 번호를 주려면 -ba 옵션을 사용하라

$ nl -ba file.c >file.c.all_num

@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@
 
LINE NUMBERS IN LINUX

If you want a file with line
numbers (say for printing).
You can use the "nl" command
in linux.

$ nl file.c > file.c.num

See man for more options.
Normally nl gives line numbers
only for non blank lines.

To force it to give it to all lines
use -ba option:

$ nl -ba file.c >file.c.all_num
반응형
Posted by She쥐포s

블로그 이미지
She쥐포s
Yesterday
Today
Total

달력

 « |  » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

최근에 올라온 글

최근에 달린 댓글

글 보관함