Linux: Can I create directories that don’t exist while creating a new file?
        Posted  
        
            by deb
        on Super User
        
        See other posts from Super User
        
            or by deb
        
        
        
        Published on 2010-05-08T14:04:19Z
        Indexed on 
            2010/05/08
            14:09 UTC
        
        
        Read the original article
        Hit count: 189
        
linux
|command-line
I can do mkdir messages
and then
 touch messages/hello.txt
Is there a command that will do both - create the directory if it doesn't exist, and then the empty file?
something like: touch -p messages/hello.txt 
Thanks in advance
-- Deb
© Super User or respective owner