I'm very new to using UNIX/Bash. I'm currently outputting the product of a random number generator to a text file in a subdirectory using the following:
./generate > ~/workspace/pset3/find/output/output.txt
my current directory in this case would be find
. Is there a way to type the path such that I can briefly specify a sub-directory of the current directory without typing the full path each time?
Best Answer
the reference to a subdirectory of the current directory would be
./subdir/filename
or simplysubdir/filename
. in your example, if you are in~/workspace/pset3/find
and address theoutput.txt
file, you can reference it as./output/output.txt
oroutput/output.txt