Skip to content

Tail

tail은 특정파일의 마지막 내용을 확인하거나 모니터링 할 수 있다.

Example

기본적으로 파일에서 마지막 부분의 10개행을 화면에 출력:

$ tail test

마지막 부분의 20개행까지 출력:

$ tail -n 20 test

마지막에서 200byte 까지를 출력:

$ tail -c 200 test

로그파일을 실시간 모니터링, (종료는 Ctrl-c):

$ tail -f /var/log/messages

Windows alternative

tail명령(-f)을 대신 사용할 수 있는 명령은, PowerShell에서 cat filename.txt -Wait -Tail 1000와 같은 방식으로 사용하면 된다.

See also

Favorite site