Friday, February 19, 2010

Blog 4

Lab week 4

1. What is your pwd?

The command 'pwd' lists the working directory. Currently it is /home/mminten.

2. Using an absolute path, go to the/etc/gimp directory. How did you do this?

I did this by typing 'cd /etc/gimp'.

3. Using a relative path, go back to your home directory (your pwd). How did you do this?

I can go straight to my home directory by typing 'cd' or 'cd ~'. If I want to go back a step I can type 'cd ..' but this will not get me back to my home directory.

4. What is you PATH set to? How did you find this out?

I found my PATH by typing 'echo $PATH' and my PATH is set to: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

5. From your home directory (make sure you are there using pwd) use the ls –a command to see how many files you have, including the hidden files. How did you do this?

I have 6 files (.bash_history .bash_logout .bashrc Examples .lesshst .profile) in total. I found this by typing pwd to check that I was in my home directory and then typing ls -a to see the hidden files (which have a . in front of them).

6. Create a directory called week4 using the following syntax:

mkdir week4
Check using ls to be sure it is there.

7. Copy the file .profile to your new directory and rename it when you do, using the following command:

cp .profile week4/profilenew

8. See if it worked first by making sure your original file is there and then that he new file is there:

ls –a

Do you see the .profle file? Yes

ls week4
Do you see the new file? Yes

9. Change into your week4 directory using the cd command:
cd week4
Confirm you are there by typing: pwd

10. Once you are in your new directory, you will create a subdirectory inside of it:

mkdir lab

FYI, your absolute path to that directory is: /home/your_login_name/week4/lab.

11. We will now move the file profilenew to our new directory called lab. You need to be inside of your week4 folder for these commands to work:

ls

Do you see the profilenew file? Yes

mv profilenew lab

ls

Do you see the profilenew file? No

ls lab

Is it in the new folder called lab? Yes

12. Let’s try to remove the directory called lab. You should still be in the week4 directory:

rmdir lab

What happens? Why?

Nothing happens, it give an error message telling me it can't remove the 'lab' directory because it is not empty.

Go back to your home by typing:
Cd ~

13. I have told you how helpful the man pages can be. Pretend we just installed a new sound card and cannot remember the command we need that will run the sound volume meter. Le’s use either man –k or apropos to find out what that is:

man –k sound

You can see you can scroll through and find the command you are looking for. What is it?

'vumeter'

Sometimes too much info confuses it. Type:

man –k sound volume meter

Did you get the results you wanted?

I can find the 'vumeter' command in the list but the list is much longer than when I just typed 'apropos sound'.

No comments:

Post a Comment