LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-14-2005, 10:31 AM   #1
AndeAnderson
Member
 
Registered: Feb 2005
Location: Pennsylvania
Distribution: Debian (maybe)
Posts: 237

Rep: Reputation: 30
Command Line Entries


Very basic questions

From the command line I can type a command with the switch --help to see what the proper format and options for that command are.

Here's the catch. How do I get the --help to only print one screen at a time? The default appears to be print the entire --help file to the screen at one time. That only allows me to see the last 20 to 25 lines of the --help for that command.

Can the --help information be piped to or opened by a text editor?

Next, once the man command is given for a command how do I stop or exit from the man command?

Is there a way to print this information?

I also read about something called info files. What and where are they?
 
Old 04-14-2005, 10:45 AM   #2
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
To display any output one screen at a time, then pipe it into one of "more" or "less".

For example: <command> --help | less, or <command> --help | more

For more, then press enter to move down through the text. For less, use the up / down arrow keys. To exit from both of these (and from man), press q.

You can send output from any command into a file, using the > operator, for example man (command) > file.txt (warning, this will overwrite file.txt if it already exists - to avoid this and add the text at the end, use >>). This file can then be viewed in and printed from any text editor.

Info files are yet another source of documentation for common commands. To view them, just type info (command). Once again, use q to quit.
 
Old 04-14-2005, 11:41 AM   #3
AndeAnderson
Member
 
Registered: Feb 2005
Location: Pennsylvania
Distribution: Debian (maybe)
Posts: 237

Original Poster
Rep: Reputation: 30
--help | less is great

Thanks.

That was what I needed.

Now for another basic question.

In ls --help I am shown an option or switch --color with the format of --color[=WHEN].

No matter how I type it I get error messages. Do I use the brackets []? I see that the brackets [] are used to differentiate arguments from options but I do not see the actual command typed out to see how to use the arguments when typing in the command.
 
Old 04-14-2005, 11:51 AM   #4
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
The square brackets are used to indicate that anything in them is optional. Words in all uppercase are just placeholders, and need to be replaced with actual values. In this particular case, you could do any of the following:

--color (this uses the default value, none. But note that ls without the --color tag defaults to --color=always)
--color=never
--color=always
--color=auto
 
Old 04-14-2005, 01:11 PM   #5
AndeAnderson
Member
 
Registered: Feb 2005
Location: Pennsylvania
Distribution: Debian (maybe)
Posts: 237

Original Poster
Rep: Reputation: 30
Brackets

Thanks for the answer on the brackets.

As an aside, I was using the --color as an example because the Debian Sarge Linux I have installed will display the ls in color only one time. The next time I use it the ls does not have color.

I tried both --color=always and --color=auto and received the same result so I thought I was typing something wrong and wanted to know what the correct format was.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 08:19 PM
Redirecting output to a command-line argument of another command madiyaan Linux - Newbie 1 02-19-2005 05:35 PM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 08:45 PM
51 characters only in the 1st Line of command line eggCover Linux - General 2 07-29-2004 02:28 PM
Where is Command line utility for Cups and command tutorial mossy Linux - Software 8 01-16-2004 01:24 AM


All times are GMT -5. The time now is 09:11 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration