Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-19-2004, 07:26 AM   #1
Registered: May 2002
Posts: 401

Rep: Reputation: 30
cat command

Hi ,

Using the cat command I opened a very long file.

what is the best way to open a file just to read it ( not with vi) so it will show me the file in pieces ( something like dir /p in the dos days).

Old 08-19-2004, 07:32 AM   #2
Senior Member
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

Rep: Reputation: 47
cat filename | less
Old 08-19-2004, 07:33 AM   #3
Senior Member
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
a shorter route would be

less <filename>
Old 08-19-2004, 07:39 AM   #4
bruno buys
Senior Member
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,511

Rep: Reputation: 46
What about
cat filename |more
This will show the file in pieces.
Old 08-19-2004, 12:14 PM   #5
Registered: Nov 2003
Posts: 122

Rep: Reputation: 17
One shot

Originally posted by bruno buys
What about
cat filename |more
This will show the file in pieces.
More is a one shot thing, so you cannot go back and see it again as you can with less.

Cat is a really powerful command useful for different things. yes, it will send it to less, which makes it sort of a DOS type command.

Also, you can run

cat /dev/fd0 /path/filename

to make an image of a floppy, and reversing the command will make a floppy of the stored image.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MSDOS version for cat command frankie_DJ General 9 07-22-2005 09:08 AM
cat command for text files minm Linux - Newbie 5 07-03-2005 01:32 AM
how to run cat command in silent mode user_linux Linux - Newbie 4 06-16-2005 11:21 AM
what are the limits to the 'cat' command? Frybyte Linux - General 12 04-22-2004 05:32 PM
cat Command Moeses Linux - General 1 06-20-2002 04:27 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration