LinuxQuestions.org
Help answer threads with 0 replies.
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-30-2015, 06:44 AM   #16
adel87
Member
 
Registered: Nov 2014
Posts: 37

Original Poster
Rep: Reputation: Disabled

Hi thank you
so the final commande is du -ms /* | sort -nr 2>&1 /dev/null
Thank you.
 
Old 04-30-2015, 06:55 AM   #17
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,122

Rep: Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270
? That is not ok. That command does not work. Probably:
du -ms /* 2>/dev/null | sort -nr
 
Old 04-30-2015, 07:09 AM   #18
adel87
Member
 
Registered: Nov 2014
Posts: 37

Original Poster
Rep: Reputation: Disabled
Hi thank you for your help
 
Old 04-30-2015, 07:17 AM   #19
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,122

Rep: Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270
glad to help you
if you really want to say thanks just click on yes
 
1 members found this post helpful.
Old 04-30-2015, 08:55 AM   #20
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 810

Rep: Reputation: 264Reputation: 264Reputation: 264
Quote:
Originally Posted by T3RM1NVT0R View Post
2 is exit code. What I am doing here is telling the system if there is anything which has got exit status / code (2) in the output then redirect that to /dev/null

You have different exit codes like:

0 = success
1 = warning
2 = errors
Sorry, but I think you may be incorrect. Those are not exit codes, they refer to output streams. 1 refers to stdout, and 2 refers to stderr. If you do no redirection, both outputs will go to your terminal. By using "2> /dev/null", you are redirecting the second output stream (stderr) to /dev/null instead of your terminal.

du outputs the file sizes to stdout and any errors to stderr. So if you were to do "du -sh /* 1> /dev/null" you will only see the output of stderr.

Exit codes are returned by the program when they exit, but you usally don't see it. Usually, an exit code of 0 indicates that there were no problems. A non-zero value indicates a problem. Every program defines its own exit codes for specific errors (the man page for that program usually has more details on this).
 
1 members found this post helpful.
Old 04-30-2015, 09:08 AM   #21
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
No need for sorry infact thank you! I mixed up two different things, I mixed up exit status of the command with standard streams. I was referring to the exit code of the command which you can check using echo $? but now I realized that was totally out of context.

Thanks once again!
 
  


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
L.O.document font prints the size of Firefox default "noto sans 22" instead of "ns12" 1sweetwater! Linux - Software 1 02-11-2015 08:45 AM
What are the options "Nosuid" "mode" "size" in /etc/fstab? tuxfiles.org does not help pstein Linux - Newbie 1 11-16-2012 01:58 AM
How do I increase the size of my "Home " folder. Colin M Linux - Newbie 11 02-15-2010 06:42 PM
How to create a "fixed-space"-a folder that is EXT2 inside and whatever size-50MB? linus72 Linux - Newbie 3 04-08-2009 09:47 AM
How to issue "ls" command start with the largest file size in a folder? fjkum Linux - Newbie 5 07-27-2006 04:28 AM


All times are GMT -5. The time now is 11:00 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration