tial -f [파일명]
- 파일의 마지막 10Line 출력, 주로 -f 옵션을 붙여 실시간으로 로그 파일이 싸이는 모니터링용으로 쓰임
aix 5.3
fedora14
http://www.computerhope.com/unix/utail.htm
- 파일의 마지막 10Line 출력, 주로 -f 옵션을 붙여 실시간으로 로그 파일이 싸이는 모니터링용으로 쓰임
aix 5.3
tail Command
Purpose
Displays the last few lines of a file.
Syntax
Standard Syntax
tail [ -f ] [ -c Number | -n Number | -m Number | -b Number | -k Number ] [ File ]
To Display Lines in Reverse Order
tail [ -r ] [ -n Number ] [ File ]
Description
The tail command writes the file specified by the File parameter to standard output beginning at a specified point. If no file is specified, standard
input is used. The Number variable specifies how many units to write to standard output. The value for the Number variable can be a positive or
negative integer. If the value is preceded by + (plus sign), the file is written to standard output starting at the specified number of units from
the beginning of the file. If the value is preceded by - (minus sign), the file is written to standard output starting at the specified number of
units from the end of the file. If the value is not preceded by + (plus sign) or - (minus sign), the file is read starting at the specified number of
units from the end of the file.
The type of unit used by the Number variable to determine the starting point for the count is determined by the -b, -c, -k, -m, or -n flag. If one of
these flags is not specified, the tail command reads the last ten lines of the specified file and writes them to standard output. This is the same as
entering -n 10 at the command line.
The -m flag provides consistent results in both single- and double-byte character environments. The -c flag should be used with caution when the
input is a text file containing multibyte characters, because output can be produced that does not start on a character boundary.
Flags
-b Number
Reads the specified file beginning at the 512-byte block location indicated by the Number variable.
-c Number
Reads the specified file beginning at the byte location indicated by the Number variable.
-f
If the input file is a regular file or if the File parameter specifies a FIFO (first-in-first-out), the tail command does not terminate after
the last specified unit of the input file has been copied, but continues to read and copy additional units from the input file as they become
available. If no File parameter is specified and standard input is a pipe, the -f flag is ignored. The tail -f command can be used to monitor
the growth of a file being written by another process.
-k Number
Reads the specified file beginning at the 1KB block location indicated by the Number variable.
-m Number
Reads the specified file beginning at the multibyte character location indicated by the Number variable. Using this flag provides consistent
results in both single- and double-byte character-code-set environments.
-n Number
Reads the specified file from the first or last line location as indicated by the sign (+ or - or none) of the Number variable and offset by the
number of lines Number.
-r
Displays the output from the end of the file in reverse order. The default for the -r flag prints the entire file in reverse order. If the file
is larger than 20,480 bytes, the -r flag displays only the last 20,480 bytes.
The -r flag is valid only with the -n flag. Otherwise, it is ignored.
Exit Status
This command returns the following exit values:
0
Successful completion.
>0
An error occurred.
Examples
1 To display the last 10 lines of the notes file, enter:
tail notes
2 To specify the number of lines to start reading from the end of the notes file, enter: tail -n 20 notes
3 To display the notes file a page at a time, beginning with the 200th byte, enter: tail -c +200 notes | pg
4 To follow the growth of a file, enter: tail -f accounts
This displays the last 10 lines of the accounts file. The tail command continues to display lines as they are added to the accounts file. The
display continues until you press the Ctrl-C key sequence to stop it.
File
/usr/bin/tail
Contains the tail command.
Related Information
The dd command, head command, more command, pg command.
Files in Operating system and device management describes files, file types, and how to name files.
Input and output redirection in Operating system and device management describes how the operating system processes input and output.
fedora14
TAIL(1) User Commands TAIL(1)
NAME
tail - output the last part of files
SYNOPSIS
tail [OPTION]... [FILE]...
DESCRIPTION
Print the last 10 lines of each FILE to standard output. With more
than one FILE, precede each with a header giving the file name. With
no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options
too.
-c, --bytes=K
output the last K bytes; alternatively, use -c +K to output
bytes starting with the Kth of each file
-f, --follow[={name|descriptor}]
output appended data as the file grows; -f, --follow, and --fol‐
low=descriptor are equivalent
-F same as --follow=name --retry
-n, --lines=K
output the last K lines, instead of the last 10; or use -n +K to
output lines starting with the Kth
--max-unchanged-stats=N
with --follow=name, reopen a FILE which has not changed size
after N (default 5) iterations to see if it has been unlinked or
renamed (this is the usual case of rotated log files)
--pid=PID
with -f, terminate after process ID, PID dies
--retry
keep trying to open a file even when it is or becomes inaccessi‐
ble; useful when following by name, i.e., with --follow=name
-s, --sleep-interval=N
with -f, sleep for approximately N seconds (default 1.0) between
iterations
-v, --verbose
always output headers giving file names
--help display this help and exit
--version
output version information and exit
If the first character of K (the number of bytes or lines) is a `+',
print beginning with the Kth item from the start of each file, other‐
wise, print the last K items in the file. K may have a multiplier suf‐
fix: b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, GB
1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.
With --follow (-f), tail defaults to following the file descriptor,
which means that even if a tail'ed file is renamed, tail will continue
to track its end. This default behavior is not desirable when you
really want to track the actual name of the file, not the file descrip‐
tor (e.g., log rotation). Use --follow=name in that case. That causes
tail to track the named file in a way that accommodates renaming,
removal and creation.
AUTHOR
Written by Paul Rubin, David MacKenzie, Ian Lance Taylor, and Jim Mey‐
ering.
REPORTING BUGS
Report tail bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
Report tail translation bugs to <http://translationproject.org/team/>
COPYRIGHT
Copyright © 2010 Free Software Foundation, Inc. License GPLv3+: GNU
GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for tail is maintained as a Texinfo manual. If
the info and tail programs are properly installed at your site, the
command
info coreutils 'tail invocation'
should give you access to the complete manual.
GNU coreutils 8.5 October 2010 TAIL(1)
http://www.computerhope.com/unix/utail.htm
추가 정보 windows에서 tail 사용하기
http://blog.naver.com/websearch?Redirect=Log&logNo=70000398132
http://blog.naver.com/websearch?Redirect=Log&logNo=70046575769
http://chez.egloos.com/1860963
http://blog.naver.com/websearch?Redirect=Log&logNo=70000398132
http://blog.naver.com/websearch?Redirect=Log&logNo=70046575769
http://chez.egloos.com/1860963
http://www.codeway.co.kr/board/bbs/board.php?bo_table=ETC_PDS&wr_id=181&sfl=&stx=&sst=wr_hit&sod=desc&sop=and&page=5
http://blog.naver.com/dlwone97?Redirect=Log&logNo=70036912128
http://blog.naver.com/dlwone97?Redirect=Log&logNo=70036912128
Posted by systemer