13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.2 Use <strong>Linux</strong> Features to Make Multiple Java SDKs Play Nicely Together169As you can see, we have a directory with a single file in it, sample. Nowlet’s make a hard link to that file.$ ln sample example$ ls -latotal 16drwxrwxr-x 2 mschwarz mschwarz 4096 Jul 8 10:13 .drwx------ 50 mschwarz mschwarz 4096 Jul 8 10:11 ..-rw-rw-r-- 2 mschwarz mschwarz 45 Jul 8 10:11 example-rw-rw-r-- 2 mschwarz mschwarz 45 Jul 8 10:11 sample$ cat exampleThis is a samplefile to dem<strong>on</strong>stratelinks.$Notice a few things here. First, other than the size and timestamps beingthe same, there is nothing obvious to show that these two files are, in fact, thesame file. Note also the number just ahead of the owning user and groupnames. In the first directory listing, sample had 1 in that positi<strong>on</strong>; now bothsample and example have 2. This number is the link count. It tells you howmany names are linked to the data associated with this name.We have a couple more things to point out before we move <strong>on</strong> to softlinks, which are going to be more important for our purposes.$ chgrp wwwdev example$ ls -latotal 16drwxrwxr-x 2 mschwarz mschwarz 4096 Jul 8 10:13 .drwx------ 50 mschwarz mschwarz 4096 Jul 8 10:11 ..-rw-rw-r-- 2 mschwarz wwwdev 45 Jul 8 10:11 example-rw-rw-r-- 2 mschwarz wwwdev 45 Jul 8 10:11 sample$ chmod o-r example$ ls -latotal 16drwxrwxr-x 2 mschwarz mschwarz 4096 Jul 8 10:13 .drwx------ 50 mschwarz mschwarz 4096 Jul 8 10:11 ..-rw-rw---- 2 mschwarz wwwdev 45 Jul 8 10:11 example-rw-rw---- 2 mschwarz wwwdev 45 Jul 8 10:11 sample$ chgrp mschwarz sample$ ls -latotal 16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!