To modify your UNIX shell environment, the two main files to work on are the .cshrc and .alias files. The first file is in your home directory, and you must create your .alias file. These files contain several settings that affect your workspace.
To make changes to these files, change to your home directory and open them in your text editor of choice. To do this, simply enter the editor's command, followed by a space and the file name (.cshrc). For example: pico .cshrc opens the .cshrc file for editing in Pico.
If you are new to UNIX, you may feel a little intimidated by the complex appearance of this file, not to mention the idea that "it sure seems like I shouldn't be messing with this." However, this is actually a simple file to edit; just remember the following points
How to change your default printer
Open the .cshrc file in an editor and look for the following words:
setenv PRINTER
These two words will be followed on the same line by the name of a printer. This is your default printer--the one your documents will be sent for printing, unless you specify otherwise. If your default printer breaks down, you can alter this line to change your default printer at least temporarily.
Once you have found the above phrase, you need to find out the network name of the printer you want to use. This will either appear in the printer's message window or will be written on the body of the printer. Place this name after setenv PRINTER on the same line and then save the change to the file. You will need to log out and then log back in to affect the change.
How to change your prompt to reflect the working directory
It is quite useful to make your prompt list your current location in the system. To arrange for this, you first need to create a .alias file in your home directory. To do this, type the command of a text editor, followed by a space, then ".alias" (Example: pico .alias). This creates a new file, in which you should add the following two lines:
alias back 'set back=$old; set old=$cwd; cd $back; unset back; dirs'
alias cd 'set old=$cwd; chdir \!*; set prompt = "`pwd` % "'
Once you have entered these lines, save the changes to the new file, and then you will need to log out and log back in to affect the change to your environment.
How to make commonly-used commands easier to use.
As you spend more time working with UNIX, you will find that there are several commands that you use quite frequently. For example, people who use Pine to check their mail can enter the pine command a hundred times in a week. Also, if you need to change to and from directories on remote file systems, you may find yourself constantly typing in cd followed by cumbersome paths.
To avoid this, you can create "aliases" for frequently-used or cumbersome commands.
An alias is a word or phrase which you designate to represent commands or other
phrases (such as directory paths or filenames). For example, you can designate
p to represent the pine, command then to access your email in Pine,
you would simply need enter a p by itself.
To create aliases for commands or other significant phrases, follow these steps:
alias web cd /auto/csecvs/unprotected/People/echernof
Use the aliases as if they are commands--simply type them and press Enter. You can create as many aliases as you wish.
Creating links to files and directories
To avoid typing long paths with the cd command is to create "links" to files and directories. Links are essentially secondary names for files, but they also allow you to "jump" around the system easily. You can create a link in your home directory to a file which is on another file system, and the new link makes it seem as if the file is in your home directory without having to type a long, cumbersome path to that file.
Rather than creating links to all your important files, it may be simpler to create links to your frequently-visited-but-still-a-pain-to-type-the-full-path directories. To create a link to a file or directory, simply change to the directory in which you would like the link to reside (links are like files), and then enter ln -s linkname pathname. For example, if you change to your home directory and type:
ln -s folks /auto/csecvs/unprotected/People/
you will have a new link in your home directory to the People directory. To use this link, simply type cd folks.
![]() |
![]() |
This site was created especially for students of the UNC School of Journalism's JOMC 050 Class, and anyone else who may be interested. For more information, please contactdaikat@email.unc.edu |