LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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-29-2008, 01:51 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 30
what is the difference of the commands


1) >& /dev/null

2) > /dev/null


what is the difference of the commands above ? thx
 
Old 04-29-2008, 03:12 AM   #2
smus
Member
 
Registered: Nov 2005
Location: Turkey
Distribution: Suse
Posts: 104

Rep: Reputation: 16
if i am not wrong & means command executed in the background (at low-priority) one of them is in foreground one of them is background
 
Old 04-29-2008, 03:27 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
The ampersand stats for "execute in background" when you put it at the end of the command line. The difference between the two is formal. They do exactly the same, but you use > when you redirect to a file, >& when you redirect to a file descriptor pointing to a file. However the latter works even when you specify a filename.

We can tell that the >& or <& syntax refers to file descriptors, whereas > and < refer to files. There is also &> which means redirect both stdout and stderr to a file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
what is the difference between these commands ls * and echo * izrafel Linux - General 5 06-12-2007 01:49 PM
what's the difference between the two commands? edenCC Linux - General 4 01-05-2007 10:34 AM
what's difference between commands man and info? xcore_on Linux - Newbie 2 05-23-2006 10:18 AM
what is difference between "reset" and "clean " commands? zameer_india Linux - Newbie 2 01-10-2005 07:23 AM
I can't see the difference between the two commands xailer Linux - Newbie 3 11-21-2003 03:14 PM


All times are GMT -5. The time now is 04:45 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration