Author |
Topic: UNIX Advice Needed |
Joey Ace
From: Hamilton, Ontario, Canada
|
Posted 10 Feb 2005 11:55 am
|
|
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"!
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
|
|
|
|
Joey Ace
From: Hamilton, Ontario, Canada
|
Posted 10 Feb 2005 11:59 am
|
|
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.
You probably already know that.... |
|
|
|
Garth Highsmith
|
Posted 10 Feb 2005 12:10 pm
|
|
" 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. |
|
|
|
Joey Ace
From: Hamilton, Ontario, Canada
|
Posted 10 Feb 2005 12:17 pm
|
|
"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
|
Posted 10 Feb 2005 1:03 pm
|
|
. [This message was edited by Garth Highsmith on 06 January 2006 at 08:07 AM.] |
|
|
|
Don Walters
From: Saskatchewan Canada
|
Posted 10 Feb 2005 3:39 pm
|
|
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.
|
|
|
|
Will Holtz
From: San Francisco, California, USA
|
Posted 10 Feb 2005 6:26 pm
|
|
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 |
|
|
|
Chris Lasher
From: Blacksburg, VA
|
Posted 10 Feb 2005 8:04 pm
|
|
Try
Code: |
du / -h | grep '\(\([[:digit:]]\{2,\}M\)\|\([[:digit:]]\+G\)\)[[:space:]]' |
to see what folders are the largest, then go into those folders and issue
Code: |
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: |
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: |
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.[This message was edited by Chris Lasher on 10 February 2005 at 08:37 PM.] |
|
|
|
Jon Jaffe
From: Austin, Texas
|
Posted 11 Feb 2005 11:39 am
|
|
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 |
|
|
|