LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 04-22-2010, 07:34 AM   #1
ManuMayer
LQ Newbie
 
Registered: Apr 2010
Posts: 18

Rep: Reputation: 0
'&' and '&' Symboles


There is no better place then the Newb Channel for a question like that.

In my Crontab file, I have a command that ends with &> /dev/null

I understand that basically the /dev/null is there so it produce no output, however, I would like to understand exactly what the '&' and '>' means ?

Also, it's really hard to find a information for non Alphanumeric chars on Google. Is there a good Linux site where it would explain what these symbols does ?

thanks
 
Old 04-22-2010, 07:40 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Have a look at this. /dev/null is your bitbucket/wastebasket/bin, whatever you want to call it. So basically redirecting (>) to /dev/null is saying you don't want to see it. You can Google for input/output redirection in Linux and it will take you to a lot more detailed information. Or you can read the Bash Beginners Guide.

Kind regards,

Eric
 
Old 04-22-2010, 07:47 AM   #3
ManuMayer
LQ Newbie
 
Registered: Apr 2010
Posts: 18

Original Poster
Rep: Reputation: 0
So using $ command > dev/null
would be used I don't want to see the standard output

and

using $ command &> dev/null
would be used If I don't want to see the standard output and the error output ?

Is that correct ?
 
Old 04-22-2010, 08:00 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
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html

I don't know the relevance of "$" in your examples---but it is not related to re-direction.
 
Old 04-22-2010, 08:06 AM   #5
ManuMayer
LQ Newbie
 
Registered: Apr 2010
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany View Post
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html

I don't know the relevance of "$" in your examples---but it is not related to re-direction.
I looked into your link and the last entry

Quote:
3.6 Sample: stderr and stdout 2 file

This will place every output of a program to a file. This is suitable sometimes for cron entries, if you want a command to pass in absolute silence.

rm -f $(find / -name core) &> /dev/null
say that everything is going to pass in absolute silence, which I guess means what I just said

Quote:
using $ command &> dev/null
would be used If I don't want to see the standard output and the error output ?
Thanks for helping me understand that feature of linux
 
Old 04-22-2010, 08:40 AM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
command1 | command2

sends the stdout of command1 to the stdin of command2

command < file

sends the contents of file to command's stdin

command > file

writes the stdout of command to file, overwriting it's original contents.

command 2> file

writes the stderr of command to file, overwriting it's original contents.

command &> file

writes the stdout and stderr of command to file, overwriting it's original contents.

command >> file

appends the stdout of command to file's original contents.
 
1 members found this post helpful.
Old 04-22-2010, 08:50 AM   #7
ManuMayer
LQ Newbie
 
Registered: Apr 2010
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks a lot MTK358
If every tutorials were made like that, life would be much more easier
that's exactly what I needed.
 
Old 04-22-2010, 08:52 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
The link I provided gave you all of that info---n'est-ce pas?
 
  


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
zsnes && logitech dual action gamepad && dpad woes John5788 Linux - Games 5 10-29-2008 09:56 PM
AOL UK && BT Voyager 100 && Slackware 10.2 && RP-PPPoE pitt0071 Linux - Networking 3 01-17-2006 06:10 AM
(FreeBSD && Fedora Core 4 && Slackware 10.0) Filesystem Support taylor_venable *BSD 1 07-14-2005 02:24 PM
Japanese canna won't work : Warning: &#12363;&#12394;&#28450;&#23383;&#22793;&am OrganicOrange84 Debian 3 06-30-2005 02:28 PM
Ph&#7909;c h&#7891;i d&#7919; li&#7879;u b&#7883; m&#7845;t???, c&#7913; pollsite General 1 06-27-2005 12:39 PM

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

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