==================== Unix/Linux Pathnames ==================== -IAN! idallen@freenet.carleton.ca Ref: Chapter 4 Floppix Lab 3: (logical organization of the Linux filesystem) Floppix Lab 4: (navigating the filesystem) Given this directory structure and current directory: $ pwd /tmp/idallen $ ls -l drwxr-xr-x 2 idallen idallen 4096 Feb 3 20:33 dir1 -rw-r--r-- 1 idallen idallen 0 Feb 3 20:33 file1 All the pathnames below give the same output, because all these pathnames refer to the same (current) directory: $ ls $ ls . $ ls ./. $ ls ././././././. $ ls dir1/.. $ ls ./dir1/.. $ ls dir1/../. $ ls dir1/../././././. $ ls ../idallen $ ls ./../idallen/./././. $ ls ../../tmp/idallen $ ls ../idallen/dir1/.. $ ls ../idallen/dir1/.././././. $ ls dir1/../../idallen $ ls ./dir1/../../idallen/. $ ls /tmp/idallen $ ls /tmp/idallen/././. $ ls /tmp/idallen/dir1/.. $ ls /tmp/../tmp/idallen/../idallen/dir1/.. $ ls /././tmp/./././../tmp/./././idallen/./././../././idallen/./dir1/./.. All the pathnames below give the same output, because all these pathnames refer to the same sub-directory "dir1": $ ls dir1 $ ls dir1/. $ ls ./dir1 $ ls ./dir1/. $ ls ././././dir1/././././. $ ls ../idallen/dir1 $ ls ../idallen/dir1/../dir1/. $ ls ../../tmp/idallen/dir1/../../idallen/dir1/. $ ls /tmp/idallen/dir1 $ ls /././tmp/./././idallen/./././dir1/./. All the pathnames below give the same output, because all these pathnames refer to the root directory: $ ls ../.. $ ls ../../../../.. $ ls dir1/../../.. $ ls dir1/../dir1/../../.. $ ls ../idallen/../.. $ ls ../../tmp/.. $ ls / $ ls /. $ ls /./././. $ ls /tmp/.. $ ls /tmp/idallen/../.. $ ls /tmp/idallen/dir1/../../.. These patterns match all non-hidden names in the /tmp/idallen directory: $ echo * $ echo ./* $ echo dir1/../* $ echo ../idallen/* $ echo ../../tmp/idallen/* $ echo /tmp/idallen/* $ echo /tmp/idallen/dir1/../* These patterns match all non-hidden names in the /tmp directory: $ echo ../* $ echo ./../* $ echo .././* $ echo /tmp/* $ echo /tmp/./* $ echo /././././tmp/./././* These patterns match all non-hidden names in the root directory: $ echo ../../* $ echo ../../../../../../* $ echo /* $ echo /tmp/../* $ echo /tmp/idallen/../../* $ echo /tmp/idallen/dir1/../../../*