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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
11-18-2009, 12:39 PM
|
#1
|
LQ Newbie
Registered: Nov 2009
Posts: 5
Rep:
|
Need advice on output redirection
Just getting confused doing a lab for my linux class. Need help for the following;
Run the command 'mkdir old' and redirect any error messages into the file 'errors'.
I've tried a bunch of different combination and none of them work for some reason. Thanks a lot in advance.
|
|
|
11-18-2009, 12:40 PM
|
#2
|
Member
Registered: Aug 2009
Posts: 311
Rep:
|
hi,
please use proper title for your message,and secondly this is your classwork,search for it and do it yourself :-) All i can tell you is look for redirectors in unix/linux.The answer to your question was in your Question .Mention what all options you tried
|
|
|
11-18-2009, 12:43 PM
|
#3
|
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
|
Hello and welcome to LinuxQuestions,
First of all you'll have to change the title of your thread since this isn't drawing attention to it, on the contrary. Second, post what you've tried and what errors you got. And last but not least, read the man page for mkdir
and do some Googling on output redirection in Linux ( turns up this)
Kind regards,
Eric
|
|
|
11-18-2009, 12:49 PM
|
#4
|
LQ Newbie
Registered: Nov 2009
Posts: 5
Original Poster
Rep:
|
I've tried
mkdir old | 2>errors
mkdir old | cat 2>errors
I'm not even sure if I'm supposed to be piping it. Assuming that's right since it says run the command mkdir old and then redirect error messages into a file named errors.
And yeah, I know it's my classwork. I said that in my first post.
I'm not too sure how to change the name of the thread. I'll be more descriptive next time. Thanks.
|
|
|
11-18-2009, 12:55 PM
|
#5
|
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
|
Have a look at the link I posted about redirection. Compare the example(s) in that document to your structure. I'm sure you'll see the error. Since it is your homework, I'm not going to do it for you but this should get you in the right direction.
Tip: Read about the difference between piping and redirecting output.
Kind regards,
Eric
|
|
|
11-18-2009, 01:01 PM
|
#6
|
LQ Newbie
Registered: Nov 2009
Posts: 5
Original Poster
Rep:
|
Thanks a lot. Appreciate the help.
Didn't need to pipe. The command mkdir old 2>errors worked just fine.
Last edited by mnzahra; 11-18-2009 at 01:03 PM.
|
|
|
11-18-2009, 01:11 PM
|
#7
|
Member
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528
Rep:
|
Quote:
mnzahra
Thanks a lot. Appreciate the help.
Didn't need to pipe. The command mkdir old 2>errors worked just fine.
|
In case you don't know, when you use only one > to redirect the output, each time you run the command a single > will overwrite the existing file. If you want to append to the file use two >>
|
|
|
11-18-2009, 01:14 PM
|
#8
|
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
|
Quote:
Originally Posted by mnzahra
Thanks a lot. Appreciate the help.
Didn't need to pipe. The command mkdir old 2>errors worked just fine.
|
Good for you, you figured it out. First point won, on to the next one. Just think logically and read a lot (Google even more )
Kind regards,
Eric
|
|
|
11-18-2009, 01:46 PM
|
#9
|
LQ Newbie
Registered: Nov 2009
Posts: 5
Original Poster
Rep:
|
Yeah I did. I should have read the question more clearly. My prof has a really bad accent and I can't understand anything he says. Thanks
|
|
|
11-18-2009, 01:53 PM
|
#10
|
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
|
That's going to be pretty difficult when you have to take exam.
|
|
|
11-18-2009, 01:59 PM
|
#11
|
LQ Newbie
Registered: Nov 2009
Posts: 5
Original Poster
Rep:
|
Well I've used the operating system before. This class is just introduction to Linux using the shell in Windows. So I should be fine as long as I do my work. The class average right now is 53% and I'm getting a 70 . I wouldn't be surprised if that is the highest mark in the class too.
|
|
|
11-18-2009, 02:03 PM
|
#12
|
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
|
Looks like your taking the lead in the classroom! Great! Keep it up!
|
|
|
11-18-2009, 06:08 PM
|
#13
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,419
|
|
|
|
All times are GMT -5. The time now is 01:36 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|