Bash output redirection to sub directory of current directory
the reference to a subdirectory of the current directory would be ./subdir/filename
or simply subdir/filename
. in your example, if you are in ~/workspace/pset3/find
and address the output.txt
file, you can reference it as ./output/output.txt
or output/output.txt
You specify the path to a desired destination from your working directory, so in your case you could just put:
> output/output.txt
Paths are always taken from your current/working directory, unless they start with '/' or '~'. In these cases, the rest of the path is relative to the root or your home directory respectively. (There may be other examples of this too)