특정 파일의 각행에서 지정된 열 뒷부분을 모두 삭제하고 출력하기
작성자 정보
- 관리자 작성
- 작성일
컨텐츠 정보
- 2,768 조회
- 0 추천
- 목록
본문
특정 파일의 각행에서 지정된 열 뒷부분을 모두 삭제하고 출력하기
colrm명령어의 설명을 위하여 README라는 파일의 내용이 다음과 같다는 것을 확인 하였습니다.
이 파일의 각각의 행에서 출력하지 않을 열을 지정하는 예를 보도록 하겠습니다.
[root@su250 ~]# cat README 12345678901234567890123456789012345678 This directory holds Apache 2.0 module- specific configuration files also file any files in this directory which have the ".conf" extension will be processed as Apache configuration files. Files are processed in alphabetical order, so if using configuration file is a gain directives which depend on, say, mod_perl being loaded, ensure that these are placed filename later sort order than "perl.conf". [root@su250 ~]# |
아래의 예는 README파일의 모든 행에서 10열 뒤의 모든 문자들은 출력에서 제외시킨 예입니다.
아래 결과를 보시면 각각의 행에서 10열 뒤의 내용이 출력되지 않은 것을 확인할 수 있습니다.
[root@su250 ~]# cat README | colrm 10
123456789 This dire specific any files the ".con as Apache Files are so if usi directive being loa filename [root@su250 ~]# |
위와 같이 colrm에서 시작열만 주어졌을 경우에는 주어진 시작열 뒤의 문자들은 각 행의 출력결과에서 모두 제외됩니다.
관련자료
-
이전
-
다음