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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1.3 Basic <strong>Linux</strong> C<strong>on</strong>cepts and Commands21Table 1.3 Some find predicatesOpti<strong>on</strong>-type d-type f-mtime -5-atime -5-newer myEx.class-size +24kExplanati<strong>on</strong>Is true if the file is a directory.Is true if the file is a plain file (e.g., not a directory).Is true if the file is less than five days old, that is, has beenmodified within the last five days. A +5 would mean older thanfive days and a 5 with no sign means exactly five days.Is true if the file was accessed within the last five days. The +and - mean greater and less than the specified time, as in theprevious example.Is true if the file is newer than the file myEx.class.Is true if the file is greater than 24K. The suffix c would meanbytes or characters (since b stands for 512-byte blocks in thisc<strong>on</strong>text). The + and - mean greater and less than the specifiedsize, as in the other examples.$ find . -name '*.java' -mtime +90 -atime +30 -print./MyExample.java./old/sample/MyPrev.java$This command printed out the names of two files that end with .java foundbeneath the current directory. These files hadn’t been modified in the last90 days nor accessed within the last 30 days. The next thing you might wantto do is to run this command again adding something at the end to removethese old files.$ find . -name '*.java' -mtime +90 -atime +30 -print -exec rm '{}' \;./MyExample.java./old/sample/MyPrev.java$1.3.10 The Shell RevisitedMost <strong>Linux</strong> shells—the command interpreters—can be c<strong>on</strong>sidered programminglanguages in their own right. That is, they have variables and c<strong>on</strong>trolstructures—if statements, for loops, and so <strong>on</strong>. While the syntax can be subtlydifferent between shells, the basic c<strong>on</strong>structs are all there.

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

Saved successfully!

Ooh no, something went wrong!