Sponsored Content
Top Forums UNIX for Dummies Questions & Answers is /. superfluous? why not just say / ? Post 302079191 by thestevew on Friday 7th of July 2006 10:13:13 AM
Old 07-07-2006
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 Smilie
 

We Also Found This Discussion For You

1. Shell Programming and Scripting

Perl: How to avoid warnings for superfluous values returned?

Hi all, a question for the Perl knowledgeable: I have use warnings; enabled. I use something like: ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); In the further code I only work with some of the returned variables, as the others I have no need for. Though the... (1 Reply)
Discussion started by: zaxxon
1 Replies
VNDCOMPRESS(1)						    BSD General Commands Manual 					    VNDCOMPRESS(1)

NAME
vndcompress, vnduncompress -- compress/uncompress file system images to/from cloop2 format SYNOPSIS
vndcompress [-cd] disk/fs-image compressed-image [blocksize] vnduncompress [-cd] compressed-image disk/fs-image DESCRIPTION
The vndcompress program compresses an existing file system image into a cloop2 compatible compressed file system image. An optional block- size can be given. If omitted, the default of 64kB is used. The vnduncompress command decompress a cloop2-compressed file system image back into a regular image. The file system images that can be handled are not limited to any specific file system, i.e. it is possible to handle images e.g. in ISO 9660 or UFS/FFS format. File system images in the cloop2 format are intended to be used with the vnd(4) driver in compressed mode as configured by the -z option of the vnconfig(8) program, and later mounted with the appropriate -t option to mount(8). OPTIONS
The following options are available: -c Always compress, even if the program was started as vnduncompress. -d Always uncompress (decompress), even if the program was started as vndcompress. EXIT STATUS
The vndcompress and vnduncompress utilities exit with one of the following values: 0 The operation was performed successfully. 1 An error occurred. EXAMPLES
To compress an existing CD-ROM file system image, run the following commands: # vndcompress netbsd.iso netbsd.izo Note that the resulting compressed image cannot be mounted directly via NetBSD's vnd(4) and mount_cd9660(8) commands any longer. Instead, you will have to use the -z option of vnconfig(8). The following example decompresses an existing CD-ROM file system image that was compressed in the cloop2 format into a regular file that can then be mounted: # vnconfig vnd0 KNOPPIX.iso # mount -t cd9660 -o ro /dev/vnd0d /mnt # vnduncompress /mnt/KNOPPIX/KNOPPIX /var/tmp/knoppix.iso # umount /mnt # vnconfig -u vnd0 # # vnconfig vnd1 /var/tmp/knoppix.iso # mount -t cd9660 -o ro /dev/vnd1d /mnt # ls /mnt .rr_moved cdrom floppy lib opt sbin usr bin dev home mnt proc sys var boot etc initrd none root tmp vmlinuz # umount /mnt # vnconfig -u vnd1 As an alternative, if your vnd(4) was compiled with VND_COMPRESSION, you can use vnconfig(8) to access the cloop-compressed image directly, e.g., # vnconfig vnd0 KNOPPIX.iso # mount -t cd9660 -o ro /dev/vnd0d /mnt # vnconfig -z vnd1 /mnt/KNOPPIX/KNOPPIX # mount -t cd9660 -o ro /dev/vnd1d /mnt2 # ls /mnt2 .rr_moved cdrom floppy lib opt sbin usr bin dev home mnt proc sys var boot etc initrd none root tmp vmlinuz # df /mnt /mnt2 Filesystem Size Used Avail Capacity Mounted on /dev/vnd0a 692M 692M 0B 100% /mnt /dev/vnd1a 1.9G 1.9G 0B 100% /mnt2 # umount /mnt2 # vnconfig -u vnd1 # umount /mnt # vnconfig -u vnd0 Note how the 1.9GB big filesystem on /mnt2 is mounted from the compressed file stored on the 692MB CD mounted on /mnt. To create a com- pressed file system image of an existing directory and mount it, run: # makefs -t ffs include.fs /usr/include # vndcompress include.fs include.fs.cloop2 # vnconfig -z vnd0 include.fs.cloop2 # mount -o ro /dev/vnd0a /mnt # ls /mnt To undo the steps, run: # umount /mnt # vnconfig -u vnd0 # rm /tmp/include.fs.cloop2 # rm /tmp/include.fs SEE ALSO
gzip(1), vnd(4), mount(8), mount_cd9660(8), vnconfig(8) AUTHORS
The vndcompress utility was written by Florian Stoehr <netbsd@wolfnode.de>. The vndcompress manual page was written by Florian Stoehr <netbsd@wolfnode.de> and Hubert Feyrer <hubertf@NetBSD.org>. BSD
December 12, 2005 BSD
All times are GMT -4. The time now is 10:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy