Discussion Locked

Moving forward and backward

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi.
On the command interface. Say I go to the etc directory, and use the command ls--then use the ls -al command for refinement of information. How can I move back and forth. The screen is filled with directories and files, but I know there is more. I cant seem to figure out the more command with this ls command. Do I use the ; or | character????
Thanks for your help .......Pat

7 replies

by zamski

Here is a weenie way to do what you want. By weenie I mean that there is probably a much simpler way to do it. Anyway...

In your home directory create a file with the commands you want to issue. For example edit a text file and include ls and ls -al on seperate lines. Name the file list or something similar.

Then create an alias by entering something like:
alias lsless='sh ~/list | less'

This will make an alias named lsless that you can type in any directory. It will issue the commands you placed the list file and output them to the program less. Less is very similar to more except that you can use the up and down arrows as well as pageup and pagedown keys to scroll the output.

Hope this helps. Good luck.

by zamski

Oh yeah, if you want to keep the alias you will have to put it in your .bash_profile or .bashrc file. Assuming you are using the standard bash shell, that is.

by zamski

Darn, I misunderstood your question. For what you want to do, all you have type is
ls -al | less in the directory you want a listing of. You can ignore most of the stuff I wrote above. I thought you were asking how to scroll between the output of two commands.

by theword

Thanks.

This did the trick. I am a novice, and in need of help.
Thanks again......Pat

by marshallkeithusa

The guy above is right ls -al |less. I would
like to add that you must use q to get out
control c will not get you out. This is true
with anything using less. The same for man.

This discussion is closed to new replies.