terminal again;)

Posted:
in Genius Bar edited January 2014
folks,



actually, does anybody know, how to delete cache related files (cache, memory, swap etc pp) quickly via terminal?



help appreciated

best

Comments

  • Reply 1 of 8
    Advanced Warning:



    ALWAYS verify that you are using the correct syntax and path before using the "rm" command. This command could irrevocably wipe your hard drive if used improperly or incorrectly. You take full responsibility for use of this command.



    That said, the command you want is:



    rm -rf <path to folder or file>



    The -rf flags tell the rm command to use a recursive delete that removes the contents of subdirectories without asking for confirmation.



    An example for your caches:



    rm -rf /Library/Caches



    and:



    rm -rf ~/Library/Caches
  • Reply 2 of 8
    [QUOTE]Originally posted by Brad

    ... and originally (meta-)transformed into

    Advanced greetings
  • Reply 3 of 8
    [QUOTE]now originally posted by Vox Barbara

    Quote:

    Originally posted by Brad

    ... and originally (meta-)transformed into

    Advanced greetings





    i just forgot to ask: is it a good idea to log in as root, perform a .DS_Store finder search and drag all results entirely to the trash bin?



    best
  • Reply 4 of 8
    Here's a blanket answer just after reading the first few words of your question:



    It is never a good idea to log in as root!



    Never! Logging in as root, especially in the GUI, is very dangerous and can cause problems indirectly without your knowledge.



    If you need to perform an operation as the root user, preface that operation with the "sudo" command. That runs the proceeding command in "super user" mode, equivalent to root but without needing to enable the root user.



    Disable the root user ASAP (/Applications/Utilities/NetInfo Manager, Security menu, Disable Root User) and kick the person that told you to enable it in the first place!



    An example:



    sudo rm -rf /Library/Caches



    That runs the previously mentioned command as the root user.



    BE CAREFUL, though. sudo can be just as powerful as root and runs command WITHOUT SAFEGUARDS. Only use it when a) you know exactly what you're doing and b) there is no alternative.



    If you want to find and kill all .DS_Store files, I believe there is a utility for that on MacUpdate. edit: Here's one: DS_Store Cleaner 1.1. I'm sure there are others that work too.



    Alternatively, there's a terminal command for this too:



    find . -name .DS_Store -exec rm {} \\;



    If you want it to do the whole drive rather than just the home directory, use:



    sudo find / -name .DS_Store -exec rm {} \\;
  • Reply 5 of 8
    [QUOTE]now originally posted by Vox Barbara

    Quote:

    Originally posted by Brad

    ... and originally (meta-)transformed into

    you are my guide to become a master





    Quote:

    Originally posted by Brad

    ...



    you are root
  • Reply 6 of 8
    Consider me thoroughly confused after that last post of yours.



    Congratulations.
  • Reply 7 of 8
    Quote:

    Originally posted by Brad

    Consider me thoroughly confused after that last post of yours.



    Congratulations.




    oh well, brad, it is always a pleasure, believe me ...
  • Reply 8 of 8
    torifiletorifile Posts: 4,024member
    Quote:

    Originally posted by Brad

    Consider me thoroughly confused after that last post of yours.



    Congratulations.




    She was goading you. You're too predictable.
Sign In or Register to comment.