Suppose I'm in /path/to/dir.  Within this dir is another dir called subdir.Is there a command I can issue which outputs the full path to subdir, no matter how it is identified? For example:$ cmd subdir/path/to/dir/subdir$ cmd /path/to/dir/subdir/path/to/dir/subdir
Getting the full path name of a given directory
bash;directory
coreutils' realpath does the trick:realpath subdirand it works however the directory (or file) is specified:realpath /blah/blah2/subdirrealpath ../blah2/subdir