Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
OK. I really did not want to make a post but I could not take it any more. I know this has to be a dumb question and am probably going to get crap for it but I can not find out how to do this anywhere. I list something in a directory and my terminal scrolls down so I can not see what is above it. I know I can Pause the text with the [scroll lock] key but it scrolls too fast and I still can't catch the first part of the list. I also found out that I can scroll the terminal up by holding down [shift] and pressing [Page up] key but It doesn't go up far enough. I still can not see the top of the list. I thought maybe there would be a switch or something for the ls command that would pause the list like you can do with the dir command in DOS but I haven't seen it in the man pages. What am I missing here. The directory is huge and i just want to see the hole thing.
Click here to see the post LQ members have rated as the most helpful post in this thread.
There has to be an easier way than a work around like that right. I mean I just want to view the contents of a huge directory from a command line. It can't be more difficult than using a command to view it one page at a time can it. thanks for your help.
In Linux and Unix the philosophy has been when making a command, that it is to do one job and to do it right. So as far as the command-line, no, there's not an easier way to do it. Pipes and redirection are an itegral part of the Unix/Linux world.
If you want to do it with a GUI, KDE and GNOME have good file managers or check out the Gentoo File Manager http://www.obsession.se/gentoo/
If you are in KDE and have a wheel mouse, you can use the wheel to scroll the screen.
Piping through the less command allows you search for text.
Just type a slash '/' and the text you are looking for. Repeat the search by typing '/' by itself again.
Thanx to all. I was not aware that linux and unix was so different. I really was not expecting such a hard time learning this OS. I had no idea that you could pipe a command to another command to get more funtionality. You all were a great help.
Just as an update to my earlier post I found that it can be annoying if the dir doesn't fill the whole screen and just sits in less. Hence a different alias:
Code:
alias list='NUM=`ls -la $1|grep -c ""`;TOT=`stty size|cut -d" " -f1`;if [ $NUM -lt $TOT ];then ls -la $1;else ls -la $1|less;fi'
Try piping your ls command into less. eg:
ls -la | less
Then you can scroll with the arrow keys.
Code:
ls -la | less
Works perfect!
I only have root terminal on a sick laptop . . .so . . . Thank you very much.
I am running a Sharp AL27 laptop just off of a "jerry-rig" USB OS (Ubuntu 9.04) (live versions won't map to hard drive - incomplete boot).
The USB OS was made on a Dell campus computer, but I got amazingly lucky . . .
I can at least get that root terminal on the laptop for file rescue mission off of the unbootable hard drive OS (Windows XP).
Anyhoo . . . my entire laptop screen after a PXE LAN boot to this USB OS is only the root terminal . . . basic black with white font.
I sure hope this forum doesn't mind too much about some other terminal commands I may ask about (only when I'm really stuck).
Thanks.
Last edited by jenaniston; 01-29-2010 at 03:54 PM.
ls -la!less command
it did as you said (Great!) but at the end of the directory was the word END printed.
I couldnt get back to the command prompt.
So, how to get back to the command prompt?
(sry i found it. type q Q :Q ZZ)
Maybe someone could comment a little on what the "less" parameter does? What it is? Are there other words to follow the "|" (***not the letter l, but the vertical line***) character which modify a command? If so is there a list of them?
Last edited by ToothlessPenguin; 08-04-2013 at 08:06 AM.
Reason: found the way
Short answer; the pipe '|' allows you to pipe (or chain) multiple cmds so that, as mentioned above, you can use almost any of the basic cmds to filter the output of one cmd through another and so on.
As above, *nix offers many simple cmds that you can use to build your own toolbox, rather forcing complex standalone cmds on you that you can't pipe.
'less' is a cmd, as is 'more', and there are many others.
See the clever tricks in some answers here for pulling substrings etc out of records using eg cat, sed, cut, awk....
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.