LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 12-30-2009, 12:04 AM   #1
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Linux Mint Cinnamon
Posts: 224

Rep: Reputation: 31
Question Please explain this :./install >install.log 2>& 1


Hello,
I know that to redirect the output of a command (in terminal) to a file we can use '>' like :
Quote:
./install > install.log
Recently I saw this:
Quote:
./install >install.log 2>& 1
Kindly explain what does the red portion do:
Quote:
./install >install.log 2>& 1
Thanks
 
Old 12-30-2009, 12:09 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Redirects standard error to standard out and therefore into install.log.

Cheers,

Evo2.
 
1 members found this post helpful.
Old 12-30-2009, 04:56 AM   #3
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Linux Mint Cinnamon
Posts: 224

Original Poster
Rep: Reputation: 31
Thanks evo2...
Any more explanations ???
like what does '2', '>', '&' and '1' etc signify separately..??
BTW I have come to know that '&' is used to execute a command in the background environment.

Last edited by mq15; 12-30-2009 at 04:58 AM.
 
Old 12-30-2009, 05:06 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
"2" is std error and "1" is std out. Details on redirection can be found in th "REDIRECTION" section in the bash man page (I'm not yelling - section title is capitalized). '>&' is a distinct entity, not a compound form of '&' and '>'.

Cheers,

Evo2.
 
2 members found this post helpful.
Old 12-30-2009, 07:13 AM   #5
mq15
Member
 
Registered: Apr 2009
Location: Pakistan
Distribution: Linux Mint Cinnamon
Posts: 224

Original Poster
Rep: Reputation: 31
Humm..Thanks a lot evo2..
Have nice days ahead..
 
  


Reply



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
Uncertain how to configure/install packages & compiler before install VMware on FC8. Azazwa Linux - Newbie 1 03-28-2009 07:27 PM
Can anyone explain these /var/log/messages ErrorBound Linux - Kernel 6 03-04-2007 11:34 PM
Log entry: can someone explain this? future assassin Slackware 3 11-22-2005 02:46 AM
Can anyone explain how to install wxPython? frycarson Linux - Newbie 11 09-14-2003 02:44 PM
Can anyone explain how to install a program hextex Linux - Newbie 1 04-17-2001 03:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:53 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
Open Source Consulting | Domain Registration