Unix Concepts   «Prev  Next»

Storing your C Shell Settings - Exercise

Course project: Creating a .cshrc file.

Objective: Create a .cshrc file to store some custom settings.

Exercise scoring

You will receive 5 points for this exercise.

Background/overview

As you work on the eCyberCom Web site, you are likely to perform many file management tasks: copying, moving, deleting, and listing files. To make your job easier, you have decided to customize some of the commonly used commands by creating aliases to them. In addition, you want to save some time at the command line by repeating or modifying previous commands. To do that, you will need to turn on the history feature. Finally, you want to define a different prompt--one that includes some useful information or one that you define just for fun or to reflect your personality.
In this exercise, you will edit a .cshrc file by defining aliases, history, and a system prompt. Then, your custom settings will be stored permanently.

Instructions Part I

  1. Log in to your course account.
  2. In your home directory, use the vi editor to open a new file named .cshrc.
  3. Create at least five aliases that you might find useful.
  4. Start your command history by setting the history variable.
  5. Change your prompt by setting the prompt variable.
  6. When you are finished, save your changes and quit vi. Hint: Use vi’s :wq command.
  7. Log out and log in again.
  8. Notice the new system prompt, and observe that you can use the history feature.
  9. Type the alias command and note the output. The aliases you stored in the .cshrc file should appear.
  10. Log out when you are done.

List the aliases you decided to define and describe why they would be useful.

Exercise Hints

If the .cshrc file contains errors, such as typing mistakes or bad syntax, the C shell may produce error messages when it tries to read the .cshrc file. When you log in again after creating the file, check to see whether any unusual messages appear among the normal system messages. If so, you may need to fix mistakes in your .cshrc file.

Submitting your exercise

Type your answers directly into the text box provided. When you are finished, click Submit button to submit your exercise.