|
|
|
While the ILL's neutron source has remained essentially unchanged during the lifetime of the Institute, the ILL's instruments and their components have been continually developed and improved to increase their effectiveness.

Commands 120 - Intermediate unixdu (-as) [directory]Displays the amount of disk space used by directories. Without any arguments, 'du' will display the amount of disk space, in kbytes, used by each subdirectory in the current directory. -a displays totals for all files and subdirectories To figure out how much total disk space you are using, type "du -s" in your home directory. grep (-iv) [pattern] [file-list] Searches [file-list] for [pattern]. This is useful for finding some expression in a bunch of files. 'grep' searches for an expression that contains [pattern], so "grep foo *" would return all the lines in all the files that contain foo or anything with foo in it, for example foobar or foofoo. The [pattern] can also be enclosed in single quotes (') to restrict the search. Thus, "grep ' foo ' *" would only return the lines in all the files that contain foo as an isolated word. The pattern cannot contain special characters like * or /, so wildcards do not work. However, 'grep' will match any characters enclosed in square brackets. So entering "grep [Cc]arrot foo.bar" would find Carrot and carrot. Entering "grep [A-Z]arrot foo.bar" would find anything that starts with an uppercase character and is followed by 'arrot', such as Parrot or Tarrot. A period will match any single character (like ?) and a caret indicates any character except those in brackets, so [^0-9] matches any non-numeric character. 'egrep' is an extended version of grep that has some additional features. 'fgrep' is 'fast grep' and searches for a literal string and the [pattern]should always be enclosed in single quotes ('). The 'grep' commands are actually very, very powerful and are far more extensive than what is presented here. They can do some pretty cool tricks. Please read the appropriate man pages for more details. -i ignores any distinction between upper and lower cases zgrep (-iv) [pattern] [gzipfile]Searches for [pattern]in a 'gzip'ped. Basically, this command temporarily expands [gzipfile]and runs 'grep' on the result. The options are the same as for 'grep'. psgrep [pattern] {SACL}Finds all the processes with [pattern] in it. This is a custom SACL-system script that passes the output of a 'ps' command to 'grep'. rehashUpdates the internal hash table. This is how the computer keeps track of which files are in the path and their status. Sometimes, due to system maintenance, a command you know should work, won't. When this happens, try 'rehash'ing first. It's easier than logging out and logging back in. source [file] Reads and executes a C shell script. If you make changes to your dot files, say .cshrc or .aliases, you can just 'source' it to put the changes into effect instead of logging out and back in. 'so' is just an SACL-defined alias for 'source'. which [command] Displays the path to a command. It's like the Pac Bell Yellow Pages, if 'where' or 'which' can't find the command, it probably doesn't exist, or at least isn't in the path. These commands also indicate if a program is in the path. Just 'which [filename]' and see if it is found. The two commands are interchangeable, but 'where' is a little more complete. pushd (+) (directory) Pushes [directory] onto the directory stack. Without an argument, it swaps the two directories at the top of the directory stack. The directory stack is like a history of directories. If you are working between several directories, it can be easier to put them onto the stack. If I was in my home directory and I wanted to work with both it and /home/user/bin, then I could just "pd /home/user/bin" and "pd" to switch back and forth between the two. More than two directories can be stacked. 'pd' is an SACL alias that shows the stack in the window frame and is recommended over 'pushd'. +[number] rotates the nth directory from the top of the stack to the top Pops the current directory off of the stack. 'po' is an SACL alias that updates the stack in the window frame and is recommended over 'popd'. +[number] removes the nth directory from the top of the stack dirsLists the contents of the directory stack. chown [owner](:group) [file-list] Changes the user and the group that owns a file. These are related to the file permissions. See the 'chmod' command description for more info. Only the owner can change these settings, so be careful when changing owner. If you make a mistake, only the new owner or root can change it back. uuencode [input file] [input file] > [output file]Encodes a binary file into a text file than can be transmitted via email. The [input file] name needs to be entered twice. The first time is to specify the file to encode. The second time is to tell it what to name the file when is decoded. Note that uuencoded text files are 30 to 35 percent larger than the original binary file. uudecode [input file] > [output file]Decodes a uuencoded text file into a binary file. vacationCreates a default mail to send to people who mail you, letting them know that you are away. It also creates a .forward file to forward all of your incoming email messages to somewhere else. To remove the vacation message, delete ~/.vacation.msg. To get stop mail forwarding, delete ~/.forward. I'm not sure the 'vacation' works since I've never used it. talk [user](@host) (tty)Opens a window to allow you to type messages back and forth with [user]. If [user] is logged in more than once, use [tty] to specify which window the notification message should appear in. Use 'finger' to figure out which terminals are in use. Hit "Ctrl-L" to redraw the screen and "Ctrl-D" to quit. The only trick is that the other person has to realize that he or she is being paged to 'talk' and needs to respond with a 'talk' command to you. ln (-s) [source] [destination]Creates links from [source] which can be a file or a directory to [destination]. This is a good way to make shortcuts to places. So if there is file, /home/dummyuser/tex/example.tex and I want to have a 'copy' of it, I could "ln -s /home/jcjai/tex/dummy.tex /home/dummyuser/tex/example.tex". This way, whenever I look at my dummy.tex, I will actually see dummyuser's example.tex. -s creates a symbolic link I recommend always making symbolic links, as opposed to 'hard' links. Use the '-s' option. To delete a link, use the 'remove' command. script (-a) (file) Saves everything you type in the current login session to (file). If no (file) is specified, everything is saved to the file 'typescript'. When you type "exit" or "Ctrl-D", the 'script' ends. Be aware that 'script' saves EVERYTHING that you type including control characters. 'record_io' is an SACL alias for 'script'. -a appends the current session record to 'typescript' or (file) compress [file]Compresses [file] to use less disk space. The old file is replaced with a new with the same name and a '.Z' extension. If the compressed file would not save any room it is not compressed. uncompress [file]Uncompresses a 'compress'ed [file]. The compressed file must have the extension, '.Z'. The uncompressed file is the same name without the '.Z' extension. znew (-fvK) [file.Z]Converts a 'compress'ed file to the newer 'gzip' format. The file is recompressed and renamed to 'file.gz'. -f forces recompression even if a .gz file already exists zmore [file-list]Displays [zipfile] with 'more'. [zipfile]can be either 'gzip'ped or 'compress'ed. Only works if [zipfile]contains a text file. zcat [file-list]Displays [zipfile] with 'cat'. [zipfile] can be either 'gzip'ped or 'compress'ed. Only works if [zipfile] contains a text file. diff (-birw) [file1] [file2] Displays difference between files, line by line. In the output of 'diff', a '<' precedes lines from [file1]and a '>' precedes lines from [file2]. In the output 'diff3', a '====' indicates that the line is different in all three files, a '====N' indicates that the line in [fileN] is different. 'diff' can also be used to find different files in two directories if [file1] and [file2] are replaced with [directory1] and [directory2]. 'diffr' is an SACL alias for 'diff -r'. -b ignores blanks and tabs at the beginning and end of lines zdiff (-biw) [gzipfile1] [gzipfile2]Displays line by line differences of the contents of two 'gzip'ped files. The options are the same as for 'diff'. sort (-bcdfMnoru) [file-list]Sorts the text files in [file-list], line by line. The output is sent to the screen by default, unless redirected (see '>' below) or with the '-o' option. The sort is in ASCII order, so it treats upper and lowercases as different with uppercase characters coming before lowercase ones. Punctuation marks also have values in this scheme.
Displays the list of commands in the history. On the SACL system, all of the commands since logging in are stored in the history stack. 'h' is an SACL system alias for 'history' that displays the output one page at a time. The history is displayed from oldest to newest unless the '-r' option is specified. -r reverses the order of output to go from newest to oldest !!Executes the last command. Same as the up arrow or 'Ctrl-P'. ![number]Executes command [number] from the history list. If [number] is negative, '!' (pronounced 'bang') will execute the [number] commands back from the current one, so '!-1' is the same as '!!'. ![pattern]Executes the last command that begins with [pattern]. ^[pattern1]^[pattern2]Executes the last command, replacing [pattern1] with [pattern2]. ![number]:s/[pattern1]/[pattern2]Executes command [number]from the history list, replacing [pattern1] with [pattern2]. Instead of ![number], !! or ![pattern] will also work. There are also several other options that work with recalling previous commands. Check "man tcsh" for more information. spell [file-list]Checks the spelling of the files in [file-list]and lists the words that it thinks may be misspelled. It doesn't tell you where the error is, just that it's there. It's not best way to spell check, but it's only way I know of. I also don't know how comprehensive the dictionary is. Proceed with caution. webster (-dst) [words]Looks up the [words] in the online Webster's dictionary. The wildcard symbol, '*' is valid and '%' represents any one character. -d looks up the definition of the [words] gw [pattern] {SACL}Searches for [pattern]in words in the online dictionary. This is an SACL-written alias that just 'grep's the file /usr/dict/words for [pattern]. write [user](@host) (tty)Sends a message to [user]. If the user is logged in more than once, the [tty] argument can be used to specify which window the message appears in. Use 'finger' to determine the terminals that the user is logged into. Once the command is issued, [user] receives a message that you are about to send a message. Just type your message and hit "Ctrl-D" to send it. These symbols are used for quoting things. Anything enclosed in double quotes (") is interpreted symbolically, so "$PATH" would be the contents of the path variable. Anything enclosed in single quotes (') is interpreted literally, so '$PATH' would be $PATH. The backslash (\) quotes the next character literally. Thus, \* isn't the wildcard star but a literal star. Use these symbols in command arguments that include strange characters or strings that have multiple meanings. [command1] | [command2]Pipes the output of one program to another program. One common use is with the 'more' command. In some cases, the output of some command exceeds one page and is hard to read as it flies by on the screen, somewhere near the speed of sound. Just 'pipe' the output to more and read at your leisure. For example, I want to 'grep' a file for some phrase and there are lots of lines that contain that phrase. I can pipe the output to more with "grep phrase datafile | more". Technically, '|' redirects standard output from one process to the standard input of the next process. tee (-a) [file-list]Takes the standard input and redirects it to all the files in the [file-list]. This is most useful with '|'. To continue the previous example, say that I wanted to save the results in two files, 'out1' and 'out2'. I would enter "grep phrase datafile | tee out1 out2". One of the files can also be another pipe to another command, so I could store the result in the two files and print it with "grep phrase datafile | tee out1 out2 | lpr". -a appends the output to files in the [file-list] instead of overwriting [command] > [file] Redirects standard output to [file]. These are like pipe (|), but instead of feeding the output to the input of another command, it stores the output in a file. > will fail if [file] already exists These can be used with 'echo' to add text to a file. "echo [text] >> [file]" will add [text] to the end of [file]. [command] < [file]Redirects standard input to come from [file]. Thus, any input that was expected for [command] will come from [file] instead of the standard input (which is usually the keyboard). This may be useful for some batch type operations. split (-) [infile] (outfile)Splits the [infile] into pieces and saves them in a series of files. The output files are named 'outfileaa', 'outfileab', and so on. If no [outfile] is specified, the default output file name prefix is 'x'. -[number] specifies the number of lines each output file contains. The default is 1000 lines. csplit (-f) [file] [arguments]Breaks [file] into pieces at the points specified in the [arguments]. The arguments can be: /[pattern]/+[number] saves everything in [file] up to [number] lines above [pattern]
|