Quote:
Originally Posted by justin12
i have typed this out and it works fine i was just wondering how come touch ../logs/black.c red.pdf blue.txt won't work
|
That will "work", but red.pdf and blue.txt will be in your current directory, while black.c will be in the directory ../logs/. The difference is the path specification that precedes the filenames, none (same as ./) in the case of red.pdf and blue.txt.
You should read up on file paths and how the shell interprets things like ../ (parent directory), ./ (present directory, same as no path) and /.. (absolute path from filesystem root).
Follow the link in rtmistler's sig to his Bash Blog for some helpful tips. Also, explore
wolledge.org, one of the best bash shell scripting guides around!
Here is an alternate syntax which will put all files in the same directory, see why that works>:
Code:
touch ../logs/{black.c,red.pdf,blue.txt}