Followup on Practice 1

Logging in, File system Basics, Editing Basics

 

Here are answers for the lab questions.

  1. What is the absolute pathname of your home directory?

    To find out your absolute pathname, change to your home directory and then ask for the name of the directory as follows:
    -> cd
    -> pwd

    The absolute pathname should begin with /home/cs-students/. Following this should be your login id.

  2. Use xman to find some interesting commands. For example,
  1. Create a directory. Copy one of your files into the directory. Now remove the directory. What commands did you need to do to accomplish all of these.

    There are a variety of ways of accomplishing this, but your first attempts will probably not succeed. If you type "rm <dirname>", you will be told that the directory is not empty and the remove command fails. If you look at the rm man page, you should find the -r argument. rm -r <dirname> will do the trick. You need to be very careful about the use of this command as you may potentially delete a lot of files. It is always best to do an "ls -a -R" command before an "rm" command using the same arguments so that you can see exactly what will be deleted. -a includes files whose names begin with . and -R recursively lists the contents of directories.
  2. Use Emacs info to find a command that will spell check the file you are creating. Now, run the spellchecker.

    Using info you should find the entry for ispell. If you look at the info for ispell, you should find the command ispell-buffer. You run ispell-buffer by typing M-x ispell-buffer. (Remember that M- means that you should use the Escape key. Also remember that Escape is a separate keystroke from the following character, not chorded like the control character is.) A prompt at the bottom of the screen will you give you more information on how to use the command. Basically, it walks through your buffer from the top, highlighting potentially misspelled words. Hitting the space bar will move on to the next word without changing the current word. r will allow you to type in an arbitrary replacement for the word. If the spell checker has somre reasonable alternatives, they will be shown at the top of the window preceded by a number. If you type in a number that correction will be applied.