Let's say the directory ~/this_dir
doesn't exist.
I need to be able to run touch ~/this_dir/new.txt
to create new.txt
in ~/this_dir
.
Is there a simple way to make touch also create the directory?
Or an alternative command which would achieve the same thing?
Thanks
touch
, and I don't thinkcp
will do this either. The answer usinginstall
is neat, though, if you want efficiency in a script moreso than being obvious or clear to readers.