![]() In general, the applications writes error messages to log files. You can use the -f option to check for the error messages as and when they appear in the log file. $ cat state.txt | head -n 20 | tail -n 5 > list.txt $ cat list.txt v: By using this option, data from the specified file is always preceded by its file name. What is happening in this command let’s try to explore it. First cat command gives all the data present in the file state.txt and after that pipe transfers all the output coming from cat command to the head command. Head command gives all the data from start(line number 1) to the line number 20 and pipe transfer all the output coming from head command to tail command. Now, tail command gives last 5 lines of the data and the output goes to the file name list.txt via directive operator. This article is contributed by Akash Gupta. If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above. ![]() Using the mail command in linux update#.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |