Você está na página 1de 4

Linux File Management Activity Exercises

I. The vim editor

1. Using the vim editor, create a file named vim_exercise.txt and enter the exactly following
contents.

Hot Supplies, Inc.


123 Main Street
Big Town, CA 95222
(408) 555-1212

Febeuary 18, 1999

Mr. John Bigfoot, Mgr.


Dotcomiposrus, Inc.
999 Fast Lane
Bigger Town, CA 95333

Dear Mr. Bigfoot,

Thank you for placing your order with us. Here is a list of
appetizers we will send to your March 25 celebration party:

QTY. ITEM
--- ----
20 Sales Enginer Special (lemon grass crow)
120 The Morning After (deep fried habaneros)

We will also be delivering the following drinks:

QTY ITEM
--- ----
60 Early Release (baked bananas stuffed with thai peppers)
40 PR Special (Pink Squirrel)
40 Day in TAC (Ping-Pong Cocktail)
200 Stock Option (Moscow Mule with Everclear)

All items will be serVEd on silver platters in a conference room


designated by your representative. Delivery will be completed at
5 pm. We will pick up the plates and leftovers at 10 pm.

We are looking forward to serving your catering needs in the


future.

Sincerely Yours,
Tony Thomas

2. Execute the following and specify what it does and state the outcome. At this point make sure
that your cursor is on top of your file.

2.a) Press j three (3) times.

2.b) Type 8j

2.c) Press k twice.

2.d) Type :set number and press the <Enter> key

2.e) Type 33G

2.f) Type :set nonumber

3. Referring again with the file above, make sure that you are at the top of the file.

3.a) Press /, type your and press <Enter>

3.b) Press n

3.c) Press G

3.d) Press ?, type ( and press <Enter> key

3.e) Type d$

3.f) Press n
3.g) Press . (period)

3.h) Press :w modified_exercise.txt

II. File Management Commands

Supply the command that will satisfy the condition/requirements. Write also the output of the command
you used. (use the back of your paper for your answers)

1. What are the current permissions for your home directory?

2. Determine the contents of your .profile file.

3. Make a backup copy of your .profile file. Name the backup file as .profile_backup

4. How many lines are contained in your .profile file?

5. Make a directory in your home directory called programs. Make other directories in your home
directory called classmates, works and misc.

6. Move into the classmates directory. Make a directory called Tet and another directory named
Dan.

7. Move in to the Tet directory. What is the full path (absolute path) of your current directory.

8. Create five (5) text files with a .dat extension in your current directory.

9. Move in to the /bin directory. What type of file is: mount, gzip, kill, date.

10. Referring to the information you gather in procedure 9, it is safe to assume that the /bin
directory contains what type of files?

11. Use the df command with the -k option to find out how full the “/” filesystem is. What is its
capacity? How much space is available?

12. Concatenate .profile and vim_exercise.txt.

13. What are the default permissions when you create a new file and a new directory?

14. How would you create a new file or directory that contains a space in the filename? (Example:
'new dir')

15. Move into your home directory. Try creating the dog/cat/mouse directory structure with one
command.
16. Copy the file /etc/passwd file to your home directory and then rename it to users.

17. Make a directory called “program files” and copy all the contents of /sbin. Were you able to
copy the contents? If not, why?

18. Make a directory called “user programs” and copy all the contents of the /bin directory.
18.a) Verify if you have copied the contents of the /bin directory.

18.b) Delete the “user programs” directory.

19. Create a file named “beginning lnux.txt”.

19.a) Try setting the timestamp on the file to a value in the future.

20. Delete all the files and directories you have created.

Você também pode gostar