From a87514da97752ffbbcead48c504b64124012af66 Mon Sep 17 00:00:00 2001 From: gasts Date: Thu, 22 Nov 2018 05:05:52 +0100 Subject: [PATCH] Short description of unix tail (#22446) A short description of unix tail --- guide/english/bash/bash-tail/index.md | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 guide/english/bash/bash-tail/index.md diff --git a/guide/english/bash/bash-tail/index.md b/guide/english/bash/bash-tail/index.md new file mode 100644 index 0000000000..5e516139de --- /dev/null +++ b/guide/english/bash/bash-tail/index.md @@ -0,0 +1,37 @@ +--- +title: Bash tail +--- + +## Bash tail +Tail is a program to display the **tail** end of a text file. If no option is given, tail shows the last 10 lines of a given file. + +### Usage + +```bash +tail [options] [file_names] +``` + +Most used options: + +* `-f`, display the last lines and then monitor the file. If new lines are added to the file, tail updates the display. +* `-c NUM`, display the last `NUM` bytes of the file. +* `-n NUM`, display the last `NUM` lines, instead of the last 10 + + +### Example + +To show the last 10 lines from file **log.txt** + +```bash +tail log.txt +``` +Show only the last line from file **log.txt** +```bash +tail -n1 log.txt +``` +Show live changes from file **log.txt** +```bash +tail -f log.txt +``` +#### More Information: +* Wikipedia: https://en.wikipedia.org/wiki/Tail_(Unix)