Re: undo rm -rf *

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2013-03-26 at 17:21 +0100, Reindl Harald wrote: 
> 
> Am 26.03.2013 17:16, schrieb Bruno Wolff III:
> > On Wed, Mar 27, 2013 at 03:11:54 +1100,
> >   Celik <celik.n.00@xxxxxxxxx> wrote:
> >>
> >> Bruno, after such an experience, did you come up with an alternative
> >> solution to using "rm -rf"?
> >> "rm -i" is good as it prompts before deletion however it becomes tedious if
> >> there are a lot of files to be deleted, hence "rm -rf" seems ideal but
> >> dangerous if not cautious :(
> >> Had a look on google, there was one particular recommendation that caught
> >> me attention (sorry I don't have the link). It was recommended to mv the
> >> files (and/or folders) to be deleted into a tmp directory. I'm planning to
> >> try that in my future code, we'll see how things go.
> > 
> > Try to be more careful, especially when there is an asterisk involved. And I keep in mind about '..', so no
> > deleting '.*'
> 
> and how yoill you remove all hidden files of a folder?

rm -rf .??*

This would miss files with only one character after the dot in the name,
like .a, but those can be handled explicitly with less trouble than
recovering from mistakenly deleting the contents of the parent
directory.

> this is safe since a very long time
> 
> [root@testserver:/tmp]$ LANG=c; /usr/bin/rm -rf .*
> /usr/bin/rm: cannot remove directory: '.'
> /usr/bin/rm: cannot remove directory: '..'

Does this not depend on where in the tree you are and what permissions
you have on . and ..?

> 
> 
> 

-- 
Matthew Saltzman
Clemson University Math Sciences
mjs AT clemson DOT edu

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux