UNIX Advice Needed

The machines we love to hate

Moderator: Wiz Feinberg

User avatar
Joey Ace
Posts: 9791
Joined: 11 Feb 2001 1:01 am
Location: Hamilton, Ontario, Canada
State/Province: -
Country: United States

UNIX Advice Needed

Post by Joey Ace »

What's the terminal command to search for a hidden file or directory?

Background/Long Story:
I clone my Mac Powerbook's internal drive to an external drive, using a the "Carbon Copy Clone" utility. That's my backup stategy, and it has worked quite well in the past.

My internal 74 GB drive had about 20 GB free.

Last night while doing this, the ext HD cable become disconnected. When it was reattached the backup continued, but failed with the message that my "SOURCE DRIVE IS FULL"! Image

Checking the internal drive indicated that it was indeed full, but I could see no additional files.

I copied my DOCUMENTS folder to an external hard drive to free up space. When it was copying I noticed a very large file name "untitled 0001" being copied.

I suspect there's some hidden files like that are taking up my previously free 20 GB.
They were probably created by the botched clone job.

Thanks for any advice.

Joey



User avatar
Joey Ace
Posts: 9791
Joined: 11 Feb 2001 1:01 am
Location: Hamilton, Ontario, Canada
State/Province: -
Country: United States

Post by Joey Ace »

It's also worth mentioning, for you UNIX gurus who aren't familiar with Mac OS-X:

It has a teminal program that allows command line interface to the UNIX OS.

<font size=1> You probably already know that....</font>
Garth Highsmith
Posts: 173
Joined: 17 Mar 2003 1:01 am
State/Province: -
Country: United States

Post by Garth Highsmith »

" ls -a " will list all files, including the hidden files in your current directory.

I think Tinkertool allows one to configure the finder to display hidden files as well.
User avatar
Joey Ace
Posts: 9791
Joined: 11 Feb 2001 1:01 am
Location: Hamilton, Ontario, Canada
State/Province: -
Country: United States

Post by Joey Ace »

"current directory" !!!

That might be the key.
I tried ls-a at the root and found nothing.

We'll see tonight. My Powerbook isn't with me now.
Garth Highsmith
Posts: 173
Joined: 17 Mar 2003 1:01 am
State/Province: -
Country: United States

Post by Garth Highsmith »

.<font size="1" color="#8e236b"><p align="center">[This message was edited by Garth Highsmith on 06 January 2006 at 08:07 AM.]</p></FONT>
Don Walters
Posts: 1355
Joined: 4 Aug 1998 11:00 pm
Location: Saskatchewan Canada
State/Province: -
Country: United States

Post by Don Walters »

There are very helpful switches with ls. I use the following often:

ls -l :I always use this. ls by itself just gives you file names in columns. I like more info.

ls -la :all files with details

ls -lt :by time modified, latest first

ls -lS :by size, largest first

if you use these examples, remember case is significant.

User avatar
Will Holtz
Posts: 335
Joined: 5 Mar 2004 1:01 am
Location: San Francisco, California, USA
State/Province: California
Country: United States

Post by Will Holtz »

The following will search your whole file system for the desired file and print out its location if found:
find / -name "untitled 0001" -type f -print
User avatar
Chris Lasher
Posts: 469
Joined: 6 Sep 2003 12:01 am
Location: Blacksburg, VA
State/Province: -
Country: United States

Post by Chris Lasher »

Try

Code: Select all

du / -h | grep '\(\([[:digit:]]\{2,\}M\)\|\([[:digit:]]\+G\)\)[[:space:]]'
to see what folders are the largest, then go into those folders and issue

Code: Select all

ls -hl | | grep '\(\([[:digit:]]\{2,\}M\)\|\([[:digit:]]\+G\)\)[[:space:]]'
This will list any files that are 10MB or larger, starting from the directory you issue the command from. If you would like for this to look in directories lower than the current, issue -hlR instead of -hl. Also note that these commands could possibly print very many lines to your screen. I recommend that you pipe to the program 'less' to view the lines. To do so just add ' | less' to the end of those commands, like the following:

Code: Select all

ls -hl | | grep '\(\([[:digit:]]\{2,\}M\)\|\([[:digit:]]\+G\)\)[[:space:]]' | less
You can use the up and down keys, page up and page down keys, etc. to scroll up and down. Press the 'q' key to quit and return to the prompt.

You could also have them print to a file instead using the right-angle bracket followed by the name of the file, like:

Code: Select all

du / -h | grep '\(\([[:digit:]]\{2,\}M\)\|\([[:digit:]]\+G\)\)[[:space:]]' > mylistofbigfiles.txt
Also note that the first command starts at the very top directory, and as such, will take an a large amount of time to run if you have plenty o' Gigs worth of stuff. You may want to change the '/' part to a specific directory, like '/home/', for example.<FONT SIZE=1 COLOR="#8e236b"><p align=CENTER>[This message was edited by Chris Lasher on 10 February 2005 at 08:37 PM.]</p></FONT>
User avatar
Jon Jaffe
Posts: 1153
Joined: 15 Nov 2004 1:01 am
Location: Austin, Texas
State/Province: Texas
Country: United States

Post by Jon Jaffe »

Joey,
I suspect it is one of the log files that was created. They can be managed with the Console program in the utilities folder. I have had them really bloat at times when problems have been detected. See: http://docs.info.apple.com/article.html?artnum=152036