|
We will learn to do these operations and more....
|
|
Example:
The path for the indicated file (myFile2) is:
|
|
Example 1:
If the current directory is /home/cheung, then the path for the indicated file (myFile2) is:
|
Example 2:
If the current directory is /home/cheung/cs170, then the path for the indicated file (myFile2) is:
|
|
|
(An editor in computer lingo is a program !!!)
|
cat FILE-PATH |
(cat is an abbreviation of the word catenate)
Example:
Example: catenate myFile1 and myFile2 to the terminal:
Also, the input that an application reads from the keyboard, can be read from a file
This feature is called:
|
|
You can see that myFile3 contains the catenation of the files myFile1 and myFile2
So the cat command can be used to catenate multiple files together !!!
(Hence the name cat)
lpr File-Path |
When you print a file from a computer in the MathCS lab, the default printer is the printer located inside the area where the Lab assistant(s) sits
lpr myFile1 |
will print the file named myFile1 in the current directory to the printer
rm File-Path |
The word rm is an acronym for remove
All files with names matching the File-Path will be removed
rm myFile1 (will delete the file named "myFile1" in the current directory) rm /home/cheung/cs170/myFile1 (will delete the file "myFile1" in the directory /home/cheung/cs170) |
Important note:
|
|
|
mv old-File-Path new-File-Path |
Important:
|
Example:
mv myFile2 decl-of-indep |
will rename the file named myFile2 to the new name decl-of-indep
Notice that after the file is renamed, the content of the file remains unchanged !
mv file-Path dir-Path |
Important:
|
mv command with non-existing directory | mv command with existing directory |
---|---|