john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Linux readonly view text cat more less tail head

linux-readonly-view-text-cat-more-less-tail-head

cat -b filename

//above is line numbers but below is line numbers on blank lines too

cat -n filename

cat -A //shows whitespace non printable characters too

"more", q to quit, spacebar to advance a screen, enter to advance a line, no going back arrow keys to move around

more +10    //starts at line# 10
more /"string"      //only shows lines with the given text

"less", q to quit, spacebar wholescreen, d halfscreen, b backscreen, u halfbackscreen

less z10    //enter = forward ten lines instead of one line, y10 would be back

-V highlights tabs, line endings, non printable characters

ctl+k highlights all string instances from less /"string", esc+u unhighlights
    -I = case insensitive search

:n and :p = multi-file navigation

"head" /var/log/filename.log shows the top 10 lines, head -20 shows 20 lines

"tail" -v shows the file name/format, -f shows the file as new output is added

tail -f -s 5 //will check every 5 seconds for new output, --pid means -f depends on a process


  • « Linux recycle bin
  • Linux random notes »

Published

Feb 6, 2010

Category

linux

~164 words

Tags

  • cat 3
  • head 1
  • less 1
  • linux 249
  • more 1
  • readonly 1
  • tail 2
  • text 16
  • view 2