3 ms·
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 mkd
by fendale 19y ago
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!