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-29-2008, 12:51 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
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, 02: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, 02:27 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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



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

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

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