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.

16Chapter 1An Embarrassment of Riches: The <strong>Linux</strong> Envir<strong>on</strong>mentis a compiled class file). The l<strong>on</strong>g listing ls -l will tell us more: permissi<strong>on</strong>s,links, owner, group, size (in bytes), and the date of last modificati<strong>on</strong>.$ ls -ltotal 2414-rw-r--r-- 1 albing users 132 Jan 22 07:53 ReadMe.txt-rw-r--r-- 1 albing users 637 Jan 22 07:52 Shift.class-rw-r--r-- 1 albing users 336 Jan 22 07:55 Shift.java-rw-r--r-- 1 albing users 1374 Jan 22 07:58 anIc<strong>on</strong>.gif-rw-r--r-- 1 albing users 8564 Jan 22 07:59 dispColrs-rw-r--r-- 1 albing users 1943 Jan 22 08:02 jam.jardrwxr-xr-x 2 albing users 48 Jan 22 07:52 moresrc-rw-r--r-- 1 albing users 2435522 Jan 22 07:56 moresrc.zip$While ls is <strong>on</strong>ly looking at the “outside” of files, 5 there is a command thatlooks at the “inside,” the data itself, and based <strong>on</strong> that, tries to tell you whatkind of file it found. The command is called file, and it takes as arguments alist of files, so you can give it the name of a single file or you can give it a wholel<strong>on</strong>g list of files.NOTERemember what was said about pattern matching in the shell: we can let theshell c<strong>on</strong>struct that list of files for us. We can give file the list of all the filesin our current directory by using the “*” <strong>on</strong> the command line so that the shelldoes the work of expanding it to the names of all the files in our directory (sinceany filename will match the star pattern).$ file *ReadMe.txt: ASCII textShift.class: compiled Java class data, versi<strong>on</strong> 45.3Shift.java: ASCII Java program textanIc<strong>on</strong>.gif: GIF image data, versi<strong>on</strong> 89a, 26 x 26,dispColrs: PNG image data, 565 x 465, 8-bit/color RGB, n<strong>on</strong>-interlacedjam.jar: Zip archive data, at least v2.0 to extractmoresrc: directorymoresrc.zip: Zip archive data, at least v1.0 to extract$5. Technically, ls (without arguments) need <strong>on</strong>ly read the directory, whereas ls -l looks atthe c<strong>on</strong>tents of the inode in order to get all the other informati<strong>on</strong> (permissi<strong>on</strong>s, size, and so<strong>on</strong>), but it doesn’t look at the data blocks of the file.

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

Saved successfully!

Ooh no, something went wrong!