Unix Geek needed

Posted:
in macOS edited January 2014
can someone tell me if that phrase does what she should do ?



[code] sudo find / -name .DS_Store -exec rm {} \\; </pre><hr></blockquote>



it should delete every file called .DS_Store on my Harddrive.



<a href="http://forums.appleinsider.com/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=5&t=001066"; target="_blank">Original Thread</a>

Comments

  • Reply 1 of 13
    Yea maybe. You may want to put .DS_Store in quotes and also look at the man page for rm to see what flag forces it to remove stuff no matter what file protection.
  • Reply 2 of 13
    defiantdefiant Posts: 4,876member
    yeah well, i'm not that unix geek that's why I posted it here, instead of finding it out for myself
  • Reply 3 of 13
    Well? If you're not going to read the man pages then you should stay away from the command line. Use Sherlock to find the files and then trash them.
  • Reply 4 of 13
    cubedudecubedude Posts: 1,556member
    Will Sherlock find invisible files? I don't think so...
  • Reply 5 of 13
    [quote]Originally posted by Defiant:

    <strong>can someone tell me if that phrase does what she should do ?



    [code] sudo find / -name .DS_Store -exec rm {} \\; </pre><hr></blockquote>



    it should delete every file called .DS_Store on my Harddrive.

    </strong><hr></blockquote>



    It should do that. However, do this first.



    [code] sudo find / -name .DS_Store -print </pre><hr></blockquote>



    This will allow you to see what it will delete. If you are happy with that list, you should then run your command.



    Note, that when you do the "rm" command, the files are lost forever - there's no "Trash" that lets you fix your mistake. This is why you would want to do the print to make sure that you are deleting what you are expecting to delete.



    Similary, the root user usually has "rm" aliased to "rm -i", which means that it will prompt you on every delete to ensure that you really want to delete that file. If you know that you want to delete all of those files, do the following:





    [code] sudo find / -name .DS_Store -exec rm -f {} \\; </pre><hr></blockquote>
  • Reply 6 of 13
    defiantdefiant Posts: 4,876member
    [quote]Originally posted by scott_h_phd:

    <strong>Well? If you're not going to read the man pages then you should stay away from the command line. Use Sherlock to find the files and then trash them.</strong><hr></blockquote>



    a$$.

    sherlock doesn't find invisible files. and if i check that option under advanced i find them, but can't delete them.



    thank you for your reply Brian Paulsen. Old Un*x geek ?



    [ 08-03-2002: Message edited by: Defiant ]</p>
  • Reply 7 of 13
    defiantdefiant Posts: 4,876member
    or was it *nix ?

    anyway, thank you very much !
  • Reply 8 of 13
    [quote]Originally posted by Defiant:

    <strong>



    a$$.

    sherlock doesn't find invisible files. and if i ceck that option under advanced i find them, but can't delete them.



    thank you for your reply Brian Paulsen. Old Un*x geek ?</strong><hr></blockquote>



    Go **** yourself then. Don't come crying when you've rm -r /* your drive.
  • Reply 9 of 13
    defiantdefiant Posts: 4,876member
    [quote]Originally posted by scott_h_phd:

    <strong>



    Go **** yourself then. </strong><hr></blockquote>



    always the same with you scott_isthata_phd.



    [quote]Originally posted by scott_h_phd:

    <strong>



    Don't come crying when you've rm -r /* your drive.

    </strong><hr></blockquote>



    that was why I was asking, stupid.
  • Reply 10 of 13
    I have to agree with Scott here. If this fellow isn't willing to read the man pages, he really ought to stay away from the term for his own good.



    -DisgruntledQS733Owner
  • Reply 11 of 13
    defiantdefiant Posts: 4,876member
    [code]

    #### #### ##### ##### # #

    # # # # # # # # #

    #### # # # # # # #

    # # # ##### ##### #

    # # # # # # # # #

    #### #### # # # # #



    </pre><hr></blockquote>



    [code] FIND(1) System General Commands Manual FIND(1)



    NAME

    find - walk a file hierarchy



    SYNOPSIS

    find [-H | -L | -P] [-Xdx] [-f file] [file ...] expression



    DESCRIPTION

    find recursively descends the directory tree for each file listed, evalu-

    ating an expression (composed of the ``primaries'' and ``operands''

    listed below) in terms of each file in the tree.



    The options are as follows:



    -H The -H option causes the file information and file type (see

    stat(2)), returned for each symbolic link encountered on the com-

    mand line to be those of the file referenced by the link, not the

    link itself. If the referenced file does not exist, the file

    information and type will be for the link itself. File informa-

    tion of all symbolic links not on the command line is that of the

    link itself.



    /tmp/man.000340 (7%)

    </pre><hr></blockquote>



    [ 07-27-2002: Message edited by: Defiant ]</p>
  • Reply 12 of 13
    eugeneeugene Posts: 8,254member
    I'm not sure how safe that is compared to



    [code]sudo find / -name .DS_Store -print0 | xargs -0 rm -rf</pre><hr></blockquote>



    I know this incantation will not mess up if you hit paths with spaces in its name and stuff like that. No iTunes installer fiasco for instance.
  • Reply 13 of 13
    defiantdefiant Posts: 4,876member
    [quote]Originally posted by Eugene:

    <strong>I'm not sure how safe that is compared to



    [code]sudo find / -name .DS_Store -print0 | xargs -0 rm -rf</pre><hr></blockquote>



    I know this incantation will not mess up if you hit paths with spaces in its name and stuff like that. No iTunes installer fiasco for instance.</strong><hr></blockquote>



    [code] #######

    # # # ## # # # #

    # # # # # ## # # #

    # ###### # # # # # ####

    # # # ###### # # # # #

    # # # # # # ## # #

    # # # # # # # # #



    # #

    # # #### # #

    # # # # # #

    # # # # #

    # # # # #

    # # # # #

    # #### ####



    </pre><hr></blockquote>



    I like banner...
Sign In or Register to comment.