shell command --tail

shell command --tail

0, tail command exclusive view of bed

Click here to quickly open the article [ map bed _shell command tail ]

Function 1, tail command description

tailThe tail command displays the contents of the file, the default execution tailcommand output file last 10row.

Syntax 2, tail command

SYNOPSIS
    tail [OPTION]... [FILE]...

3. Option Description tail command

  • -f: cycle reading
  • -q: does not display process information
  • -v: display detailed processing information
  • : -c <number> is the number of bytes displayed
  • -n <line number>: display the contents of the file tail of n lines
  • --pid = PID: and -f combination, expressed after the end of the process ID, PID dies
  • -q, --quiet, --silent: never output headers giving file names
  • -s, --sleep-interval = S: and combined -f, represents the sleep interval repeated every S seconds

4, hands-tail command

Example 1: Displaying the file 10line

seq -w 30 >file.txt  -->写入内容
tail file.txt  <-->默认也是10行

Example 2: After displaying the file 5line

tail -n5 file.txt

Example 3: From the first 15line displays the file contents start

tail -n +15 file.txt

Example 4: real-time monitoring file changes (commonly used)

tail -f file.txt

echo "I love linux" >>file.txt  -->在新开的窗口追加内容
echo "I love linux" >>file.txt  -->在新开的窗口追加内容

"MineGi something to say": Come and sweep the two-dimensional code link below, and join us!

Guess you like

Origin www.cnblogs.com/MineGi/p/12205197.html
Recommended