UNIX for ALEPH Users
All of the information in this document is the property of Ex Libris Ltd. It may NOT, under any circumstances, be distributed, transmitted, copied, or displayed without the written permission of Ex Libris Ltd.
The information contained in this document has been prepared for the sole purpose of providing information for the System Librarian‘s training. The material herein contained has been prepared in good faith; however, Ex Libris disclaims any obligation or warranty as to its accuracy and/or suitability for any usage or purpose other than that for which it is intended.
© Ex Libris Ltd., 2006
Unix for ALEPH Users 2
1 This presentation This presentation will present the major UNIX commands useful for working with ALEPH 500.
This will in no way attempt to cover all UNIX commands but rather only those useful for working with ALEPH.
The last slide in this presentation gives a comparison of VMS and UNIX commands, and thus will be useful for those individuals familiar with VMS.
Unix for ALEPH Users 3
Getting help Help may be obtained at any time while working with UNIX via the —man“ command. This will give pages of the manual relevant to the requested string written after —man“. For example to receive information about the command —ls“, one could write —man ls“
Unix for ALEPH Users 4
2 pwd pwd: return working directory name. States in what directory the user is currently present
This user is currently located in the $alephe_scratch directory
Unix for ALEPH Users 5
cd cd: change working directory. Allows the user to move from one working directory to another
This user changed to $alephe_scratchand then to $data_scratch. After each change of directory he checked his location.
Unix for ALEPH Users 6
3 ls ls: list contents of directory. Allows the user to view the files in the current directory. Additional parameters may be added to view only particular files or view them in a particular order
These are the files present in the current working directory. Unless otherwise indicated they appear in alphabetical order
Unix for ALEPH Users 7
ls -lrt ls -lrt: gives list of files in directory with date and size. -l: The parameter -l lists in long format, giving mode, ACL indication, number of links, owner, group, size in bytes, and time of last modification for each file -r: The parameter œr reverses the order of sort to get reverse alphabetic -t: The parameter œt sorts by time stamp (latest first) instead of by name.
Unix for ALEPH Users 8
4 ls -lrt | tail tail: delivers the last part of a file or list of files.
These are the 10 most recently created or updated files files present in the current working directory. They appear in reverse (-r) chronological order.
Unix for ALEPH Users 9
WILDCARD * *: Represents none, one or more characters when searching for files
This is a list of all files in the $alephe_scratchdirectory which contain the string —usm30“.
Unix for ALEPH Users 10
5 WILDCARD ? ?: Represents one character when searching for files
This is a list of all files in the current directory directory which contain the string —usm“, followed by one character, then followed by the string —0“, and then anything else ( * ).
Unix for ALEPH Users 11
more more: browse or page through a text file
The file run_b.3260is opened in non-editing format, one page at a time.
Unix for ALEPH Users 12
6 cat cat: concatenate and display files in their entirety
The entire file usm01_p_ret_01.00023has been opened
Unix for ALEPH Users 13
tail tail: delivers the last part of a file or list of files.
These are the 10 last lines of the —license“ file
Unix for ALEPH Users 14
7 vi vi: opens the file in the screen-oriented (visual) display editor
The file tab01.engmay now be edited in —vi“ mode
Unix for ALEPH Users 15
cp cp: copies files to a new name and / or to a new directory
The file tab01.enghas now been copied to a new file tab01.eng_20060411. If editing errors are now done on tab01.eng, the user can copy tab01.eng_20060411back to tab01.engand thus again have the original file
Unix for ALEPH Users 16
8 cp Files may also be copied to a different directory
The file tab00.enghas now been copied to the directory $data_root/private/ and given the name tab00.eng_old
Unix for ALEPH Users 17
mv mv: renames or moves files, either to a new directory or to a new name
The file tab00.eng_orighas been renamed to tab00.eng_without_new_fields
Unix for ALEPH Users 18
9 rm rm: removes files
The file tab00.eng_old in the directory $data_root/private/ has been deleted
Unix for ALEPH Users 19
mkdir mkdir: creates a new directory
A new directory has been created called private_testin the $data_root directory
Unix for ALEPH Users 20
10 rmdir rmdir: removes a directory
The directory called private_testin the $data_root directory has been deleted. As a security precaution the —rmdir“ command will not allow one to delete a directory with files or more directories in it. The message —Directory not empty“ will be given.
Unix for ALEPH Users 21
df df: displays number of free disk blocks and files. If used with -k it will print the allocation in kbytes. The output consists of one line of information for each specified file system.
Unix for ALEPH Users 22
11 grep grep: searches a file for a pattern
The tab11_ind table in the $data_tab directory was searched for occurrences of —LOC“.
If you are currently in the $data_tabdirectory there is no need to include it in the grep command.
Unix for ALEPH Users 23
>
>: sends output to as specific file
The file tab11_ind has been searched for the string LOC. Rather than sending the output to the screen (as in the previous case) it is being sent to a file called test. This file can be viewed, sorted, analyzed or an additional grep may be performed.
Unix for ALEPH Users 24
12 cat and >
Here the files test1 and test2are being opened via cat, and not sent to the screen but rather to a new inclusive file called test3. This file can be viewed, sorted, analyzed or an additional grep may be done on it.
Unix for ALEPH Users 25
diff diff: display line-by-line differences between pairs of text files
The file tab100has been compared to tab100_good and it was found that the —BROWSE-NO-MATCH=Y“ variable that is present in the in tab100file is not present in the tab100_good file.
Unix for ALEPH Users 26
13 date date: write the date and time
This is often useful for checking when log files have completed. If it appears as though there is a problem, the user should be sure the UNIX clock is correct. This also works with ALEPH programs, such as the circulation module.
Unix for ALEPH Users 27
history history: process command history list
This is often useful for seeing what previous commands have been done, when one is unsure for example what files he has changed or viewed. May also be done via —h“.
Unix for ALEPH Users 28
14 UNIX and VMS commands pwd sh def mkdir create/dir cd set def rmdir delete [directory_name] ls dir grep search ls œlrt dir/dat/siz > /out=newfile more type/p cat type cp copy diff different mvrename date show time rm [delete file_name] history recall/all
Unix for ALEPH Users 29
15