LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 09-13-2007, 09:51 PM   #1
bourne
Member
 
Registered: Feb 2006
Location: Toronto, Ontario
Distribution: Fedora 10, centos
Posts: 181

Rep: Reputation: 30
proper syntax for 'more' command


Hey whats going on. I am trying to find a command to take the contents of a file and display it one screen at a time. I did some looking and was looking into the 'more' command. There is a '-p' attribute that pauses the command and then allows you to issue subcommands. I have played around with the subcommands a little but unfortunately I haven't been able to get them to work properly. I was just wondering if someone could help me with my syntax.

Here is what I have so far
Code:
more -p j <filename>
option p: it pauses the more command
j: is the subcommand which moves forward K lines, or one full screen if you do not give a value for K.

However when I issue the command for some reason the 'j' option is interpreted as being a file and not a subcommand. I even tried using examples of other subcommands straight out of the 'man page' for more but for some reason the subcommands are still being interpreted as files and not subcommands

If someone could maybe help me fix up my syntax that would be great
thanks in advance

todd
 
Old 09-13-2007, 10:11 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,497

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
More is by definition a paginater - similar to the same command under Windoze.
The "-p" merely changes the way it moves the data - clear screen then re-paint rather than scrolling to the top.
Subcommands are entered once in more.

I'd suggest you use "less" - much better (as in user friendly).

Last edited by syg00; 09-13-2007 at 10:40 PM.
 
Old 09-13-2007, 10:37 PM   #3
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
More can be used in two ways:

more filename

or

filename | more

Maybe you are using the wrong one?
 
Old 09-14-2007, 02:11 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Quote:
Originally Posted by jay73 View Post
filename | more
This syntax doesn't works, unless filename is an executable command.

Perhaps do you mean
Code:
cat filename | more
which is a typical example of common but useless cat invocation.
 
Old 09-14-2007, 02:21 AM   #5
oskar
Senior Member
 
Registered: Feb 2006
Location: Austria
Distribution: Ubuntu 12.10
Posts: 1,138

Rep: Reputation: 49
I would suggest you try 'less'
less is more (literally)

It will let you scroll by default.

Last edited by oskar; 09-14-2007 at 02:26 AM.
 
Old 09-14-2007, 09:26 AM   #6
bourne
Member
 
Registered: Feb 2006
Location: Toronto, Ontario
Distribution: Fedora 10, centos
Posts: 181

Original Poster
Rep: Reputation: 30
Ah perfect guys.
Thanks for the suggestions. After re-evaluating what I had I realized that I can actually just use more for what I need. I don't need to use any special subcommands with it. The general function of more serves my purposes perfectly.

Thanks so much for the responses guys
thanks
todd
 
Old 09-14-2007, 10:26 AM   #7
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian, Linux From Scratch
Posts: 416
Blog Entries: 1

Rep: Reputation: 32
You could try the "most" pager too. (hohoho ... devs and their naming schemes). It's fairly intuitive and has some nice colour schemes. Try setting it as the default pager for man pages, it is quite pretty.
 
  


Reply


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ls command syntax Freestone Linux - General 5 03-20-2007 07:37 PM
Shell Script help or proper command jmikeneedham Linux - General 2 04-30-2006 02:25 PM
Tar for backups ? Proper syntax ? Reefcrazed Linux - Newbie 8 02-21-2006 06:18 PM
how do i get the proper path to a file through find command napster Linux - General 4 11-07-2005 05:35 AM
command syntax Jeebizz Slackware 1 04-14-2005 11:55 PM


All times are GMT -5. The time now is 01:58 AM.

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