LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cat command Option (https://www.linuxquestions.org/questions/linux-newbie-8/cat-command-option-536714/)

foysol_bgd 03-12-2007 12:12 AM

Cat command Option
 
Hi,

I like to view a file by Cat command and want to see it page by page, How can I?

Thanks.

oskar 03-12-2007 12:44 AM

man cat

if there is no option for cat that does that, you can pipe it through less

cat [filename] | less

quit less with q

foysol_bgd 03-12-2007 12:58 AM

Oskar,

Thanks for your help. It is working but with the cat [file name] | more command.

Regards,

Fazlur.

oskar 03-12-2007 01:03 AM

I thought so... cat is one of those programs whose programmers are religious about bloat. (joke)

you can use pipes (|) for alot of stuff.
It simply sends the output of the last command to the next one.
same works with "ls -l | less"
or "locate stuff | grep cool"
which would search for "stuff" and filter it so only lines that contain cool and stuff are being printed.

archtoad6 03-12-2007 08:56 AM

You can "page" a file directly with less:
Code:

less <filename>
It also has many useful options, many more than more. RT:)M for both of them & compare.

Most people I know never use more unless less is missing from the system they're working at -- then they complain bitterly, often cursing 3 or more generations of the installer's family :).

Quote:

less is more than more.
more is less than less.
The more you less, the less you more.

donzo37 12-11-2008 10:33 AM

Paging by piping
 
Thanx :cool: I had a similar problem with flying scrolls - can't wait to try it


All times are GMT -5. The time now is 03:11 PM.