Linux Commands
Commands
ls
cd
mkdir
cat
more
head
tail
touch
rm
How To
Change Prompt

tail - command in linux



tail - command in linux

displays last 10 lines of FILE to standard output / terminal / putty


syntax

tail [filename]

example

 //displays last 10 lines by default
 [user@host log]$ tail dmesg

displays last n lines with int argument

 //displays last 20 lines
 [user@host log]$ tail -20 dmesg

 //displays last 30 lines
 [user@host log]$ tail -30 dmesg

 //displays last 40 lines
 [user@host log]$ tail -40 dmesg

display continues stream, with -f option (follow option)

 tail -f [file]

display continues stream along with grep

 tail -f [file] | grep [pattern]

options


OptionDescription
-c, --bytes=Kdisplays last K bytes; alternatively, use -c +K to output bytes starting with the Kth of each file
-f, --followdisplays data continuously as the file grows
-Fthis is equally --follow=name --retry
-n, --lines=Kdisplays the last K lines. default is last 10 lines
--max-unchanged-stats=Nusing option --follow=name, reopen a FILE which not updated after N (default 5) try to see if it has been unlinked or renamed, useful for log files.
--pid=PIDusing by option -f, tail will terminates after PID exits
-q, --quiet, --silent it will never output headers giving file names
--retrywill keep try to open the file even when file is not accessible; this is useful when following by name, i.e., with --follow=name
-s, --sleep-interval=Nusing option -f, sleep tail for approximately N seconds (default 1.0) between iterations.
-v, --verbosedisplays headers giving file names
--helpdisplays help information
--versiondisplays version information


rm

rm command in linux

posted on 2019-10-24 21:34:18 - Linux Commands Tutorials


touch

touch command in linux

posted on 2019-10-23 19:41:20 - Linux Commands Tutorials


tail

tail command in linux

posted on 2019-10-23 19:10:42 - Linux Commands Tutorials


Prompt Examples

ChatGPT Prompt Examples

posted on 2023-06-21 22:37:19 - ChatGPT Tutorials


Use Cases

Chat GPT Key Use Cases

posted on 2023-06-21 21:03:17 - ChatGPT Tutorials


Prompt Frameworks

Prompt Frameworks

posted on 2023-06-21 19:33:06 - ChatGPT Tutorials