head/tail/more/less/nl

손성훈·2021년 6월 27일
0

linux-command

목록 보기
7/7
post-thumbnail

head/tail

# head는 파일의 첫 n개의 줄을 출력한다
head -4 test.txt
# tail은 파일의 마지막 n개의 줄을 출력한다
head -9 test.txt

more/less

파일을 끊어서 읽을 때 사용한다

# more은 위에서 아래로 밖에 못 읽고 끝에 도달하면 자동 종료한다
cat test.txt | more
# less는 화살표를 이용해 위아래로 스크롤할 수 있고 q를 눌러 빠져 나간다
cat test.txt | less

nl

줄 번호를 출력한다

cat test.txt | nl

출처

https://withcoding.com/111

profile
Living loving and learning

0개의 댓글