There is no command available for creating a file and the parent directories in one step. Nevertheless you can help yourself with a simple bash script. Just add the following snippet to your ~/.bashrc
.
mktouch() { mkdir -p $(dirname $1) && touch $1; }
Afterwards you can run this command like this: mktouch /home/demo/newdirectory/newfile1.txt
Source: https://unix.stackexchange.com/a/305850 -> Comments