See file content
There are various way to see the file content in linux.
1. cat
Symbol: cat fileName
will show the content of file in shell.
2. head
head will show the content from the top of the file. In head you can specify number of line you want to see.
Symbol: head -20 fileName
will show the first 20 lines from the file.
3. tail
tail will show the content from the bottom of the file. like head you can specify the number of line you want to see
Symbol: tail -100 fileName
will show last 100 line from the file.
*** If you want to see content from a log file which is continuously written by system/other application use tail as follows.
This will continously show the last written 20 line from the file.
1. cat
Symbol: cat fileName
will show the content of file in shell.
2. head
head will show the content from the top of the file. In head you can specify number of line you want to see.
Symbol: head -20 fileName
will show the first 20 lines from the file.
3. tail
tail will show the content from the bottom of the file. like head you can specify the number of line you want to see
Symbol: tail -100 fileName
will show last 100 line from the file.
*** If you want to see content from a log file which is continuously written by system/other application use tail as follows.
tail -20f fileName.
This will continously show the last written 20 line from the file.
Comments
Post a Comment