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.

1.3 Basic <strong>Linux</strong> C<strong>on</strong>cepts and Commands29TIPHere’s <strong>on</strong>e more handy example we know you’ll use:find . -name '*.java' -print | zip allmysource -@This command starts in the current directory (“.”) finding every file that ends in.java and gives their names to zip which will read them from standard in insteadof its argument list (told to do so with the -@ argument) and zip them allinto an archive named allmysource.zip. To put it simply, it will zip up allyour Java source files from the current directory <strong>on</strong> down.1.3.12 The man CommandPrimitive but handy, the man command (short for manual ) was the earlyUNIX <strong>on</strong>line manual. While we’ve come to expect (and ignore) <strong>on</strong>line help,the idea of <strong>on</strong>line manuals was rather revoluti<strong>on</strong>ary in the early days of UNIX.In c<strong>on</strong>trast to walls of printed documentati<strong>on</strong>, UNIX provided terse butdefinitive descripti<strong>on</strong>s of its various commands. When they are d<strong>on</strong>e well, thesedescripti<strong>on</strong>s are an invaluable handy reference. They are not the best way tolearn about a command, but they can be a great guide to using the command’sopti<strong>on</strong>s correctly.The format is simply man followed by the name of the command aboutwhich you want informati<strong>on</strong>. So man man will tell you about the mancommand itself.The most useful opti<strong>on</strong> to man is the -k opti<strong>on</strong>. It will do a keywordsearch in the titles of all the manpages looking for the keyword that you give.Try typing man -k java to see what commands are available. The (1) meansthat it’s a user command—something that you can type from the shell prompt,as opposed to (2) which is a system call or (3) which is a C library call. Thesenumbers refer to the original UNIX documentati<strong>on</strong> volumes (volume <strong>on</strong>e wasshell commands and so <strong>on</strong>), and it all fit into a single three ring binder.TIPOne other way to find out something about a command, if you know the commandname already, is to ask the command itself for help. Most commandshave either a -? or --help opti<strong>on</strong>. Try --help first. If you need to type -?either put it in single quotes or type it with a backslash before the questi<strong>on</strong> mark,as in -\?, since the ? is a pattern-matching character to the shell.

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

Saved successfully!

Ooh no, something went wrong!