LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-18-2007, 03:40 AM   #1
munna_dude
Member
 
Registered: Dec 2006
Posts: 362

Rep: Reputation: 30
let me know


hi all
what is the meaning of this.
2> /dev/null
can u please explain.

thank you in advance
 
Old 05-18-2007, 03:42 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
If I'm not completely mistaken it means that any error messages produced should be forwarded to /dev/null (instead of printing them to screen), effectively causing error messages not to be shown.
 
Old 05-18-2007, 03:47 AM   #3
munna_dude
Member
 
Registered: Dec 2006
Posts: 362

Original Poster
Rep: Reputation: 30
thank you for quick replay

Quote:
Originally Posted by b0uncer
If I'm not completely mistaken it means that any error messages produced should be forwarded to /dev/null (instead of printing them to screen), effectively causing error messages not to be shown.
yeah! its ok.
but what is "2>". why we use this.

thank you in advance
 
Old 05-18-2007, 07:58 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
">" (or "<") is the redirection operator. If it is not preceded by a number (the file designator) then it defaults to standard output (>) or standard input (<)

example:
cat filename|[some command] >newfilename
This takes data from filename and runs it thru [some command] and then send the output to newfilename.

using input redirection, it looks like this:
[some command] <filename >newfilename

(Note that it is more common to enclose metadata in <>, but that would really be confusing when describing the < and > operators)

To run a command and direct the output to a file and trash the errors:

[some command] 1>filename 2>/dev/null
 
  


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



LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:17 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