Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Pathname safety' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Pathname safety
Authored by: ManxStef on Feb 14, '06 01:03:03PM

Personally, if I'm doing an operation deemed "risky" such as rm -rf I always navigate down to the parent directory first, then use a relative path instead of an absolute e.g.

cd /path/to
sudo rm -rf delete

(Using tab-completion for the paths, too.) This is a fair bit safer IMO as you're a lot less likely to kill everything with a relative path than an accidental slash in an absolute.

[ Reply to This | # ]
Pathname safety
Authored by: sjk on Feb 16, '06 03:32:43PM

Good meta-hint!

[ Reply to This | # ]