1 / 12

Lab 2 N avigating the File system

Lab 2 N avigating the File system. bin. vue. lib. sbin. contrib. local. share. Layout of UNIX’s File Systems. / /. sbin. usr. dev. etc. opt. var. stand. tmp. home. vmunix. user1. group. passwd. profile. user2. mail. news. tmp. vue. man. man. ls. cp. sh. tar. vi.

Download Presentation

Lab 2 N avigating the File system

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 2Navigating the File system

  2. bin vue lib sbin contrib local share Layout of UNIX’s File Systems / / sbin usr dev etc opt var stand tmp home vmunix user1 group passwd profile user2 mail news tmp vue man man ls cp sh tar vi

  3. / home tmp usr bin F1 user1 user2 user3 cp ls vi man F1 F1 F1 memo F1 Path Names • Absolute Pathname – The name of a file or directory with respect to the root (/) directory • Relative Pathname – The name of a file or directory with respect to the user’s present working directory (pwd) 4 2 1 3

  4. Basic File System Commands

  5. pwd: Your Present Working Directory • pwd – Command that tells your present working directory • Example: / $ pwd /home/user3 You are here home user1 user2 user3 F1 F1 F1 memo F1

  6. ls: List the Contents • ls– Command used to list the names of files and directories • Example: / home $ ls f1 f2 memo $ ls –F F1 F2* memo/ $ ls –aF .profile F1 F2* memo/ $ ls memo F1 F2 user1 user2 user3 F1 F1 .profile F1 F2 memo F2 F1

  7. cd: Changing your Current Directory • cd – Command that will allow you to change directory, and move to some other location in the hierarchy • Example: / $ pwd /home/user3 $ cd memo; pwd /home/user3/memo $ cd ../.. ; pwd /home $ cd /tmp; pwd  /tmp tmp home F1 user1 user2 user3 F1 F1 .profile F1 F2 memo F2 F1

  8. mkdir: Making Your Own Directories • mkdir– Command that will allow you to make a directory • Example: / $ pwd /home/user3 $ mkdir fruit $ mkdir fruit/apple $ cd fruit $ mkdir grape orange home user1 user2 user3 F1 F1 fruit .profile F1 F2 memo F2 F1 apple grape orange

  9. rmdir: Deleting Directories • rmdir – Command used to remove directories • Example / $ rmdir orange $ cd .. $ rmdir fruit rmdir: fruit not empty home user1 user2 user3 F1 F1 memo .profile F1 F2 fruit F2 F1 apple grape orange $ rmdir fruit/apple fruit/grape fruit

  10. touch: Creating an empty file • Example $ pwd /home/user3/fruit $ touch kiwi $ ls apple grape orange kiwi / home user1 user2 user3 F1 F1 memo .profile F1 F2 fruit F2 F1 grape orange kiwi apple

  11. mv: Moving and Renaming Files

  12. rm: Deleting Files

More Related