Few things to be achieved 1. Recursively get top 20 largest folders/files 2. Get their sizes in bytes as well as human readable format
How do you sort du -sh /dir/* by size? I read one site that said use | sort -n but that's obviously not right. Here's an example that is wrong.  [~]# du -sh /var/* | sort -n 0       /var/mail 1.2M    /var/www 1.8M    /var/tmp 1.9G    /var/named 2.9M    /var/run 4.1G    /var/log 8.0K    /var/account 8.0K    /var/crash 8.0K    /var/cvs 8.0K    /var/games 8.0K    /var/local 8.0K    /var/nis 8.0K    /var/opt 8.0K    /var/preserve 8.0K    /var/racoon 12K     /var/aquota.user 12K     /var/portsentry 16K     /var/ftp 16K     /var/quota.user 20K     /var/yp 24K     /var/db 28K     /var/empty 32K     /var/lock 84K     /var/profiles 224M    /var/netenberg 235M    /var/cpanel 245M    /var/cache 620M    /var/lib 748K    /var/spool
How much electronics and other valuables can I bring duty-free when going to India? Why won't closing the lid sleep my MacBook Pro with external monitor attached after upgrading to Lion? Why can't I have a non-integral static const member in a class? I noticed C++ will not compile the following:  class No_Good {   static double const d = 1.0; };   However it will happily allow a variation where the double is changed to an int, unsigned, or any integral type:  class Happy_Times {   static unsigned const u = 1; };   My solution was to alter it to read:  class Now_Good {   static double d() { return 1.0; } };   and figure that the compiler will be smart enough to inline where necessary... but it left me curious.  Why would the C++ designer(s) allow me to static const an int or unsigned, but not a double?  Edit: I am using visual studio 7.1 (.net 2003) on Windows XP.  Edit2:  Question has been answered, but for completion, the error I was seeing:  error C2864: 'd' : only const static integral data members can be initialized inside a class or struct How are percentiles calculated in Careers 2.0? I noticed that a percentile is placed at the top of my resume in Careers 2.0.    How are these percentiles calculated? Is there a certain threshold you need to be over in order for it to be displayed? Use of 100K ohm resistor along with 0.1uF capacitor? In the circuit diagram below, why is there a 100K&Omega; resistor (NOT R2) connected to the capacitor? To my understanding the capacitor-resistor act as a high pass filter to block the DC offset of the microphone, but since only the capacitor blocks DC why is the 100k resistor used? According to the author of the video (link below) he said, the 100k is used "not to overload the microphone's un-amplified output". I don't get this part.  Also, can only a capacitor be used in this circuit or any other circuit without the 100k resistor? Integrating Factor Method. Why Can We Set the Constant of Integration to Zero? My textbook gives a demonstration of the use of the integrating factor method for solving first order ordinary differential equations:  $\dfrac{dx}{dt} + p(t)x = r(t)$  $\implies g(t)\dfrac{dx}{dt} + g(t)p(t)x = g(t)r(t)$  $\dfrac{d}{dt}[g(t)x]$  We use the product rule and compare the expression to the left-hand side of the above equation:  $g(t)\dfrac{dx}{dt} + \dfrac{dg}{dt}x = g(t)\dfrac{dx}{dt}+g(t)p(t)x$  $\therefore \dfrac{dg}{dt} = g(t)p(t)$  The above equation is separable.  $\therefore \int\dfrac{dg}{g(t)} = \int p(t) dt$  $\implies ln[g(t)] = \int p(t)dt$  My textbook then says that, "We can set the constant of integration to zero -- any function that satisfies $\dfrac{dg}{dt} = g(t)p(t)$ will do for our purposes". However, it gives no explanation as to why this is the case. Why can we set the constant of integration to zero? Why is any function that satisfied $\dfrac{dg}{dt} = g(t)p(t)$ appropriate for our purposes?  I would greatly appreciate it if people could please take the time to elaborate on this. Why do we use "have" with does and not "has"? Prove: if $a,b\in G$ commute with probability $>5/8$, then $G$ is abelian Suppose that $G$ is a finite group. If $P( ab=ba ) &gt;5/8$, prove $G$ is abelian. Setting Blend Width on Mosaic Dataset using ArcMap How to find an unknown Steam User I was playing with someone on Ark: Survival recently, I CTD'd and couldn't get his information. Are there any means that I could find this user's Steam account even though he hasn't logged in since?  I know of the function View: Players in Steam, but it only shows me the last 24 hours and I haven't played with this player in 3-4 days. Is there a way I could extend the view recent players function on Steam? Is there a record of this somewhere? Or do I have any further options? System.FinalException: Record is read-only: Trigger.updateCompetitors: line 24 I am writing a trigger to get all the Opportunity competitors into a field on Opportunity, however, getting an error while testing it.  Error: updateCompetitors: execution of AfterUpdate caused by: System.FinalException: Record is read-only: Trigger.updateCompetitors: line 24  Can you please check the below code and suggest me what's wrong with this?  trigger updateCompetitors on Opportunity(after insert, after update){    List&lt;Opportunity&gt; OppIds = new List&lt;Opportunity&gt;();     for (Opportunity opp: trigger.new){         OppIds.add(opp);     }  List&lt;OpportunityCompetitor&gt; oppComps = new List&lt;OpportunityCompetitor&gt;();  oppComps= [select id, CompetitorName, Strengths, Weaknesses from OpportunityCompetitor where OpportunityId in: Trigger.newMap.keySet()];  List&lt;Opportunity&gt; OppstoUpdate = new List&lt;Opportunity&gt;();   for (Opportunity opp: OppIds){     String allcomps = null;      if( oppComps.size()&gt;0 ) {       for (integer i = 0; i &lt; oppComps.size(); i++){          allcomps = allcomps + oppComps[i].CompetitorName+',';       }     }    opp.OpportunityCompetitors__c = allcomps;    OppstoUpdate.add(opp);  }    update OppstoUpdate; } Add a linebreak in an HTML text area How can i add a line break to the text area in a html page? i use VB.net for server side coding. Is it acceptable to change the vid column of a term programmatically in the database? Why do we say "is it" when asking a question rather than "it is"? What it says on the tin, a foreign friend of mine has asked and I can't tell him; apart from it sounding horrible.  For example:  "Why is it raining today?"   Instead of:  "Why it is raining today?" Is it possible to boot Ubuntu using the Windows bootloader? As noted by many people, Windows 8's UEFI requirements might will won't get in the way of installing Linux (or whatever), as the replacement bootloader will also need to be signed somehow. Some systems All systems will let you disable the signature requirement, but the feature might be hidden to disable or you might not be willing to give up on the benefits of a secure bootloader.  Is it necessary to replace the bootloader in the first place? To keep ourselves to software that's gone golden, how can I install Ubuntu 11.04 using Windows 7's own bootloader? Is the uncertainty principle a property of elementary particles or a result of our measurement tools? My stance is that these websites are a great boon to the research community and they were certainly extremely helpful for my research. I think they should be applauded rather than persecuted, and while they may be illegal now, I think a way to make them legal should be found (in the same way I can download articles legally through my university's subscription to all the major publishers and journals).  Can I thank them in the acknowledgements section of my thesis? I installed Ubuntu (twice actually) onto the same drive. I wanted to 'try again' since one of them didn't install correctly and the other installed differently, but it worked.   I was getting frustrated with the GRUB menu because it was really sloppy (There were two Windows options - one with the Windows bootloader to go into Ubuntu, and two different versions of Ubuntu from the first install for some reason and memtest, etc.).  In my attempts at getting rid Ubuntu to do a fresh installation, I went ahead and deleted the partitions that weren't swap or main via Windows 7. As I said, I am a noob.  Now, even though I though I completely got rid of Ubuntu, including the GRUB menu, when I boot my PC I am brought directly to GRUB Rescue. And from what I've found from other forums, GRUB rescue isn't even completely functional for me (it doesn't recognize any commands that it should support besides ls. It also returns unknown filesystem for any partition I try to view or boot.)  Is there any way that I can boot straight into Windows? I fear I may have gone about deleting those partitions in the wrong way. If so, what are my options? You see him for a split second in the final scene with the Final Order and he has kind of a white beard. I can't find any reference online except Nien Nunb from ROJ. In Avatar: The Last Airbender, Aang's eyes glow when he goes into the Avatar State. This seems to be the case with all Avatars, but Aang and the other airbending Avatars tattoos glow too.      Is there any reason for why airbending Avatars tattoos glow as well as their eyes?