Friday, 7 October 2016

Getting useful information from files


which executable_in_PATH
it gives the complete path to the file
which $0
from inside an script it gives the path to the script (if it is not called by source)
readlink link_name
it returns the real file linked by the file link
dirname file_name
it gives the name of the directory where the file is, w/out the remaining '/'

No comments:

Post a Comment