Java Reference
In-Depth Information
will make a copy of Classy.java named Nouveau.java , and:
cp Classy.java /tmp
will make a copy of Classy.java in the /tmp directory, and:
cp *.java /tmp
will put the copies of all the Java sources in the current directory to the /tmp
directory.
If you run this command,
ln Classy.java /tmp
you might think that ln copies files, too. You will see Classy.java in your
present working directory and you will see what appears to be a copy of the file
in the /tmp directory. But if you edit your local copy of Classy.java and
then look at the “copy” that you made in the /tmp directory, you will see the
changes that you made to your local file now also appear in the file in the /tmp
directory.
That's because ln doesn't make a copy. It makes a link . A link is just an-
other name for the same contents. We will discuss linking in detail later in the
topic (see Section 6.2.1).
1.3.6
We need to describe shell pattern matching for those new to it. It's one of the
more powerful things that the shell (the command processor) does for the
user—and it makes all the other commands seem that much more powerful.
When you type a command like we did previously:
Seeing Stars
mv /usr/oldproject/*.java .
the asterisk character (called a “star” for short) is a shorthand to match any
characters, which in combination with the .java will then match any file in
the /usr/oldproject directory whose name ends with .java .
There are two significant things to remember about this feature. First, the
star and the other shell pattern matching characters (described below) do not
mean the same as the regular expressions in vi or other programs or languages.
Shell pattern matching is similar in concept, but quite different in specifics.
Search WWH ::




Custom Search