Quote:
Originally Posted by james hanley
you say in many contexts they're the same. But is there any case you can name where /. is not the same as / ? e.g. one works and the other doesn't?
listing /mnt shows the directory mnt in /
$ ls -ld /mnt
drwxr-xr-x 2 bin bin 512 16 Apr 2003 /mnt
listing /.mnt looks for a file called .mnt in /
$ ls -ld /.mnt
ls: 0653-341 The file /.mnt does not exist.
Interestingly
$ ls -ld /./mnt
drwxr-xr-x 2 bin bin 512 16 Apr 2003 /./mnt
and even (ad infinitum...)
$ ls -ld /./././././mnt
drwxr-xr-x 2 bin bin 512 16 Apr 2003 /./././././mnt !!
Quote:
Originally Posted by james hanley
note-
But regarding your use of the term 'current directory'
dot is a pointer to some directory not necessarily the current one. If you're in /home/blob/ and you do ls /. then the current directory is still /home/blob/
(pwd displays current directory, so that defines current directory) The / directory is just the one that ls is called on. I don't know of another term for the directory passed as an argument/parameter to a command. It's not (necessarily) the current/working directory. It could be any directory.
True - I got a bit tied up in definitions in the earlier post - it's only the current directory if it is at the start of a relative path (
.*) and it's not necessarilly the current directory if it's absolute (/
. or /etc/
.) or if it's not at the start of the path (./../
.) (although it could be!).
Tired now - can I have a lie down till my head stops hurting