Go Back   The macosxhints Forums > OS X Help Requests > UNIX - Newcomers



Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Old 04-14-2012, 04:34 PM   #1
kookyklw
Prospect
 
Join Date: Apr 2012
Posts: 3
Using Unix Terminal to free disk space?

Hello,
I am new to this forum but wondered if you might be able to assist please?
I ran very low on disc space (stupid I know) and as a result my Macbook Pro won't boot, it womn't start in safe mode either. If I try and start it using the disk it won't let me repair it because I only have 5MB of space available and it needs 5.3MB...

My question is, can I free any more disc space using terminal via single user mode? I have fun fsck and mounted the disc, I have selected the directory I want to work with but I can't get it to delete files to create about 3mb of space.

I can't FireWire as I don't have another Mac to use.

Thank you very much for your support.

My OS is OS X Leopard
kookyklw is offline   Reply With Quote
Old 04-14-2012, 05:58 PM   #2
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 32,389
By default, the disk is mounted as read-only in single-user mode.
To mount it as read/write, run the following command:

/sbin/mount -uw /

(I think this is mentioned in the text that you see when you start up in single-user mode)

After that, you will be able to remove files using 'rm'.
Of course you need to be extremely careful as removing the wrong files could render your system unrecoverable.
__________________
hayne.net/macosx.html
hayne is offline   Reply With Quote
Old 04-15-2012, 01:57 AM   #3
kookyklw
Prospect
 
Join Date: Apr 2012
Posts: 3
Thank you, I had already used the /sbin/mount -uw / code but I couldn't get it to actually delete files, or at least if it was then when I checked disc space is wasn't increasing? Is there a way to find the largest files using Unix and then what do the different codes refer to e.g. rm -r rm -f and do I need a different code for say a file than a folder?

Thank you
kookyklw is offline   Reply With Quote
Old 04-15-2012, 01:59 AM   #4
kookyklw
Prospect
 
Join Date: Apr 2012
Posts: 3
Oh! And do I need to refer to the full file location or can I simply use rm filename ?
kookyklw is offline   Reply With Quote
Old 04-16-2012, 06:23 AM   #5
acme.mail.order
League Commissioner
 
Join Date: Sep 2003
Location: Tokyo
Posts: 6,299
Quote:
Originally Posted by hayne
Of course you need to be extremely careful as removing the wrong files could render your system unrecoverable.

What he said.

Clearing out disk space with the Terminal is a great way to break your computer - it's one of those "if you have to ask how..." deals.

The following should make enough space to enable the machine to boot. You can't copy-paste so type carefully - A single misplaced space will wipe out your entire drive. There are NO spaces between the first / and the final *

Code:
rm /var/tmp/*

rm /var/spool/cups/*

rm /var/log/*
Ignore the "...... is a directory" errors - I have deliberately left out the "remove directory" option.

Once it boots, empty the trash, and clear the caches in all your browsers. Then see what's left.
acme.mail.order is offline   Reply With Quote
Old 04-20-2012, 03:46 AM   #6
aurora72
Triple-A Player
 
Join Date: Mar 2009
Location: Turkey
Posts: 247
Under /Users/Whatever-your-account-name-is/

directory

Downloads or Documents or Movies or Music, etc...

are likely to hold big files you might go after and delete them too
__________________
http://j1307.hizliresim.com/1c/z/qyw5h.png
Mac mini G4 1.25GHzLeopard 10.5.8, Mac mini C2Duo 2.0GHz Lion 10.7.2
aurora72 is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 08:42 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.