Commonly used · Reading and processing text
tail: Read the last few lines
Syntax
tail [-n lines] [-f] [file…]Options
-n- Specify the number of lines at the end
-f- The sandbox only shows the current snapshot
Examples
tail -n 1 logs/app.logUsage and sandbox support
Real tail -f will continue to wait for new content in the file, and the sandbox will not be refreshed in the background.
Hands-on exercises
- Read the last line of the logEveryday
Related commands
catRead and concatenate textlessRead text in pagesmoreView text in pagesheadRead the first few linesgrepFilter text by patternfindFind paths by name or typewcCount lines, words and bytessortSort lines of textuniqMerge adjacent duplicate rowscutExtract columns or characterstrReplace or delete characterssedReplace text or select linesawkExtract structured text fieldsdiffCompare two text filesvimEdit files in terminalnanoModify files with a simple editornlNumber lines of texttacOutput lines of text in reverse orderrevReverse characters line by linepasteSplicing text columns horizontallycommCompare sorted listscmpCompare files to see if they are the sameexpandConvert Tab to spacesunexpandConvert leading spaces to TabfoldWrap long textrgFast recursive text searchjqHandle JSONyqHandle YAMLjoinMerge sorted tables by common fieldsfmtReformat paragraphs word by wordcolumnArrange text tablestringsExtract printable text from binaryodView file byte representationhexdumpShow hexadecimal bytesxxdView or restore hex dumpiconvConvert text encodingdos2unixConvert Windows to newlinesplitSplit file by linescsplitSplit text by patternbcEvaluate a numeric expression