Listing the largest file or sub-directory in the current directory

OS X Daily posted a tip on how to find the largest file in a directory.  I have my own that uses the du UNIX utility.  The du utility displays the file system usage statistics for each file and directory argument. To use it, type du in a Terminal window. The first column of output is the number of bytes and the second column is the directory path and file. If you run this utility in a directory with lots of files a lot of stuff will scroll off the screen. Not very useful.

However, if I combine du with a few other unix commands like sort and head I get something more useful. The sort utility sorts lines of text files while the head command displays the first lines of a file. We will use these commands together in a UNIX mechanism that involves pipes. Piping simply involves taking the output of one command and sending it as the input to another command. This is one of the things that makes UNIX so powerful.

Fire up your terminal and issue the following commands:

du -ck * | sort -rn | head -11

The -ck * tells du to compute the byte total of all files and sub-directories in the current directory and output the results in kilobytes. The output of du is then fed as input to the sort utility. The -rn tells sort to output the sorted results with the largest result first. The output of sort is then fed as input to the head command. The -11 tells head to display the top 11 results. The first line will be the total bytes computed.

You can find out more about these commands by using the man command followed by the command you want information on. For example, man du, will return a description of the du command and how to use it.

Thousands Take The Big Blue Test On World Diabetes Day

 

World Diabetes Day Logo
World Diabetes Day Logo

 

BERKELEY, CA: October 21, 2009 – November 14 is World Diabetes Day. On that day, at 14:00 hours (2 pm, local time), thousands of people with diabetes will test their blood sugar, do 14 minutes of exercise, test again and share their results online.

The event is called The Big Blue Test because the blue circle is the international symbol for diabetes. The idea of a shared "blood sugar test-in" started with an activity organized in July 2009 by TuDiabetes.org, a community for people touched by diabetes. More than a thousand people participated then. Now, we seek to reach thousands of people with diabetes through eight diabetes social networks* and Twitter. The activity incorporates 14 minutes of physical activity to reinforce the importance of exercise.

“People with diabetes have to test their blood sugar routinely. It can be a very lonely activity.” said Manny Hernandez, co-founder of TuDiabetes and a person with diabetes himself. “We want people to take The Big Blue Test, to shed light on this chronic condition and the importance of exercise on World Diabetes Day.”

Currently, more than 250 million people have diabetes worldwide. Millions more have diabetes but do not know it yet. People with diabetes need to test their blood sugar levels several times a day and exercise regularly.

Participating in this event to raise diabetes awareness on November 14 is easy:
Test your blood sugar.
Run, jog, walk the dog or do anything you’d normally do as part of your exercise routine for 14 minutes.
Test your blood sugar again.
Go to http://bigbluetest.org (or your preferred diabetes social network*) and post your readings and what physical activity you did. If you have a camera, you can also add a photo of your reading(s) or you exercising.
If you have a Twitter account, you can also post your readings on Twitter (use the #bigbluetest hashtag) and link back to http://bigbluetest.org.

“We hope to see most readings posted at 14 hours (2 pm) local time, on November 14. If you are early or late, it’s OK,” said Hernandez. “What matters most is that you test your blood sugar often and that you exercise regularly. If you don’t have diabetes, you can take The Big Blue Test. Either way, tell others to test, exercise and share on Nov. 14.”

(*) Participating diabetes social networks:

  • TuDiabetes (campaign organizer)
  • Children With Diabetes
  • Diabetes Daily
  • Diabetic Connect
  • Diabetic Rockstar
  • dLife
  • Juvenation
  • My Diabetes Central

About TuDiabetes.org
TuDiabetes.org was co-founded in 2007 by Manny Hernandez, a diabetes advocate and social media expert diagnosed with type 1 diabetes in 2002. The community is run by the Diabetes Hands Foundation, a 501c3 nonprofit that connects people touched by diabetes and raises diabetes awareness.

TuDiabetes has been featured on Regis Philbin’s Hallmark Heroes, NPR’s Diane Rehm Show, Sabado Gigante with Don Francisco, Diabetic Living magazine, Diabetes Positive magazine, El Pais (Spain), Diabetes Hoy (Mexico), the Office of Minority Health web site and many other media outlets and blogs.

For more information please visit: www.TuDiabetes.org.

For information about the Diabetes Hands Foundation, visit: www.DiabetesHandsFoundation.org, email PR@tudiabetes.org or call 650.283.4862.

###
diabeteshandsfoundation.org - P.O. Box 9421, Berkeley, CA 94709 - 650.283.4861 - EIN: 26·2274537
www.tudiabetes.org - estudiabetes.org