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.
My question is the line between the ax and grep is actually a straight up and down line. How do I type it on the keyboard or does it mean type enter and then grep dnrd
Thanks,
Steve
I typed the grep dnrd and nothing happens I type logout nothing happens how to I get out of this screen.
As you probably figured out from the dnrd I'm having problem with DNS or at least I think I am.
Once I type the ps ax how to i scroll up to see the rest of the items in the list?
It should be a straight-up down line called "pipe". It lets you take output of one program and give it as input to another program.
Code:
ps ax | grep dnrd
ps here is the program whose output is inputed into another program grep. If you are using a english keyboard (qwerty layout) then it is the key just above "enter"...you have to press shift to use it though.
Quote:
Once I type the ps ax how to i scroll up to see the rest of the items in the list?
You have to use a pager program (either more or less) like this.
it's a 'pipe' . its location varies depending on the keyboard. it's a shifted backslash on the keyboard i'm using now.looks like two dashes standing on end.
The vertical bar that you type is on the \| key (usually around the backspace key). It actually looks like two stacked bars on most US keyboards. When you see that in a commandline (ex: ls |fgrep jpg), what it tells the shell is to pipe the output (not the errors) from the first command, and feed them as input to the second command.
Here's another example. Say you want a sorted list of jpg files in your home directory (and all subdirectories below), sorted by directory/name:
find ~ -name "*.jpg" |sort
Now, let's assume you also want the file size (but not the date/time, owner, and permissions info):
The first command, find looks in the current users home directory (~) for files that match *.jpg in the name, then fore each file, executes an ls -lh (long ls format with filesize in human readable form) on each file. This output is then passed to sort, and then to awk, which parses each line into space delimited fields (by default), printing out the 9th field (size), a tab (\t), and the path.
The vertical bar can be quite powerful on the command line. There are a lot of other uses that could be scripted on the fly. For example, I use the pipe in a for loop to rename mp3's or convert filenames from all uppercase to lower case.
For more examples of shell scripting, check out the online manuals for bash or tcsh
Originally posted by steve423 [snip]
My question is the line between the ax and grep is actually a straight up and down line. How do I type it on the keyboard or does it mean type enter and then grep dnrd
[snip]
As rshaw said, it depends on your keyboard. So, fill in your personal information (the "MyLQ" button at the top of the screen) so we can see the country in which you're located. Then, perhaps, you'll get some specific help.
Oh, your keyboard layout usually changes when you change languages, so you might also specify the language you're using. (I.e., the value of LANG displayed by the set command.)
Thanks Very, Very helpful I'm using CensorNet which runs on Debain. I work for a small High School and it's the best firewall/web content solution on the market and it's free.
Our DNS is getting hammered and we lose Internet after awhile. It was every 30 min or so but it seems to now go for a day or so. The CensorNet folks are great but I though I'd run it pass you guys as well. I'm still stuck after running grep dnrd I can't seem to get out of this screen, unless I restart. This probably doesn't belong in newbie but I thought the | ? had to have a simple answer Doh!
It didn't run at all. no command prompt. I could type a command but nothing happened. I had to restart because the Internet went down but thanks for the info.
I'm still stuck after running grep dnrd I can't seem to get out of this screen, unless I restart.
If you are running "grep dnrd" as it's own command, then you won't get a return because grep is parsing stdin (standard input). grep takes at least two parameters, the search string, and the search location, which will default to standard input if blank. If you get into that situation, you just hit <ctrl>-c to break out.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.