Within a directory, you can tag a number of files to operate on.
Common operations include deleting files, and displaying images on
the screen. The files that are tagged will have a + to the left of
the name. This section describes how to tag and untag files. Later
you will see how you can use the
% character in unix commands as a
shorthand notation for the tagged files.
Selecting A File
T Toggles the tag on the current file on/off. The second line of the spy window shows the number of selected file in brackets:
john@pisa: /n/berne/Documentation/Images/ Page 2/2 (+9)
Selecting All the Files
Ctrl + T Tags or untags all files in the current directory.
Selecting Specific Files
⇧ Shift + T Prompts you with a file name pattern used to toggle the tags on the files which match the pattern:
tags all files starting with the letter g
tags all files names ending with
tags all files starting with any two characters and ending
Copy, Rename, and Delete Files
Following are the spy commands for basic file management.
C Copies the tagged files to a new name or a new directory. When invoked, it asks you for place to copy the selected file to. If you specify a unix directory path, it will copy the file there. If a filename is entered (i.e. you didn’t have any “/” characters in what you typed), then the copy is named to whatever you entered.
Renaming and Moving Files
M Moves the tagged files to a new name or a new directory. When invoked, it asks you for place to move the selected file to. If you specify a unix directory path, it will move the file there. If a filename is entered, the file is renamed.
⇧ Shift + R Removes the tagged files after prompting you for a confirmation. To delete all the contents of a directory, use the unix command: rm.
Copying and Pasting Files between Directories
There is a directory in your home directory called spy.take. It is used to store copies of files which you later put elsewhere. It is known as the copy buffer.
Copying Files to the Copy Buffer
Y Copies ( y stands for the archaic term “yank”) tagged files into the copy buffer (spy.take). You can copy as many files, on as many occasions as you want into the copy buffer. Files in the copy buffer remain there, even between sessions.
Pasting FIles from the Copy Buffer
P Pastes all the files from the copy buffer (spy.take) into the current directory, and empties the copy buffer.
Inventory of Files in the Copy Buffer
I Displays an Inventory of files currently in the copy buffer.
Clearing the Copy Buffer
Z Empties the copy buffer (the spy.take directory in your home directory).
A useful trick is to use the XWsh pop-up menu of the spy window (click in the window with ) to clone your current window. You can then Copy( Y) your files from the first window, and then Put( P) them into the directory displayed in the second window.
Creating New Directories
mkdir directoryName Makes a new directory with the given
name. You can put several names separated by spaces on the same
line. For example:
Fmkdir myDirectory anotherDirectory
You can delete the directories with the same spy command (S r) that you use to remove files. You will need to ensure that you have deleted all files from the directory before you do this. You can also use the unix command rm with the -r option.
Listing Files with Detailed Information
Sl Lists all tagged files. If none are tagged, this command lists information for the current file. The list shows detailed information about the files.
-rwxrw-r-- john prisms 265535 12:29 Mar 21 96 testFile
The permissions of a file are displayed in the first ten characters. They provide the following information:
The first character tells you if it is a file, directory, or symbolic link. Then come three sets of three characters. These show the Read/Write/Executable (rwx) permissions of the file for the owner, the group to which the file belongs, and for all other users.
If a person or group has permissions to read a file, they will be able to open, read, and make copies of the file. If a person or group has permissions to write to a file, they can also modify and delete the file. If they if have permissions to execute a file, and it is an application that can be run, they will be able to run the application. If it is a directory, they will be able to go into it.
After the first ten characters, the following information is displayed:
The name of the owner of the file (the person who created it).
The name of the group to which the file belongs.
The size of the file in bytes.
The time and date on which it was last modified.
The name of the file itself.
If the file is a symbolic link, in place of the name of the file, it will show the pathname of the file or directory to which the link points.
What is a symbolic link?
A symbolic link is simply a pointer to another file or directory. Opening the link is the same as opening the original file or directory, except you don’t have to navigate to where it actually resides in order to open it. This saves a great deal of time jumping back and forth between directories.
You can create a symbolic link with the ln(link) command. For example:
ln -s /usr/staff/john/Papers link_to_Papers...creates a link in the current directory (called “link_to_Papers”) which automatically opens the directory /Papers whenever you open the link.
If a link is deleted, the original remains intact.
Determining the Contents of a File
F This command tries to determine the type or contents of the file, such as: ascii, binary, etc.
Making a File Writable
Ctrl + W makes the currently highlighted file writable. You can only do this if you have owner or group permissions to write (make changes) to the file.
Making a File Executable
Ctrl + X makes the currently highlighted file executable. You can only do this if you have owner or group permissions to write (make changes) to the file.