News for hackers. Stuff that matters.
Re:UNIX tips: Learn 10 good UNIX usage habits by fendale on Friday January 25, 2008 @09:03AM (#104112)
mkdir -p is really useful. If I have a script that needs to be a file in (security concerns aside)

  /basedir/some/path/thats/not/there/
I can just do

  mkdir -p /basedir/some/path/thats/not/there
and not worry about which of the lower level directories exist or not - it will just create them or not complain if they don't exist. Before I knew of the -p switch, I used to split up the whole path and check for/create each directory level in turn - while its not difficult, its not much fun either!

There are no comments on this comment yet.