Is there a command line tool in linux that will 'normalize' a filename? i.e. remove all "xx/./xx" parts, or "myfolder/../myotherfolder" parts?
Tell me more
×
Server Fault is a question and answer site for
professional system and network administrators. It's 100% free, no registration required.
|
|
Actually, it is realpath: http://linux.about.com/library/cmd/blcmdl3%5Frealpath.htm There is also a command-line version: cyberciti.biz/faq/unix-linux-bsd-find-real-physical-path/ But on my CentOS 5 it is not available by default. Also there is a "cheating way":
|
|||||
|
|
I believe this is called 'canonicalizing'. |
|||||||
|
|
Are ou asking for the basename command ?
And there is also the other part : dirname
|
|||
|
|
With python line command:
|
|||
|
|