Presentation is loading. Please wait.

Presentation is loading. Please wait.

UNIX File System by Tero Toikkanen, CAP02S. UNIX Multi-user system Multi-user system Multi-tasking system Multi-tasking system Wide selection of tools.

Similar presentations


Presentation on theme: "UNIX File System by Tero Toikkanen, CAP02S. UNIX Multi-user system Multi-user system Multi-tasking system Multi-tasking system Wide selection of tools."— Presentation transcript:

1 UNIX File System by Tero Toikkanen, CAP02S

2 UNIX Multi-user system Multi-user system Multi-tasking system Multi-tasking system Wide selection of tools for software development Wide selection of tools for software development Open architecture Open architecture

3 Some UNIX variants LINUX (Caldera, Debian, Mandrake, RedHat, Slackware, SuSE...) LINUX (Caldera, Debian, Mandrake, RedHat, Slackware, SuSE...) BSD (FreeBSD, NetBSD, OpenBSD) BSD (FreeBSD, NetBSD, OpenBSD) HP-UX HP-UX Solaris Solaris IRIX IRIX Compaq Tru64 UNIX (discontinued) Compaq Tru64 UNIX (discontinued)

4 KISS The general principle: ”Keep It Simple, Stupid” The general principle: ”Keep It Simple, Stupid” Programs perform one well defined task properly Programs perform one well defined task properly Almost all data is presented as text Almost all data is presented as text Programs can be combined like LEGO- blocks Programs can be combined like LEGO- blocks

5 RTFM Learn to use the documentation Learn to use the documentation man and info commands man and info commands Internet resources Internet resources –Website of the variant or distribution –HOW-TO’s –Tutorials

6 The Basics of UNIX File system Hierarchical tree -structure Hierarchical tree -structure File-spesific security rights File-spesific security rights Files may be shared Files may be shared Almost everything can be considered to be a file, so a file can contain anything Almost everything can be considered to be a file, so a file can contain anything Even directories are files, they just contain a list of other files Even directories are files, they just contain a list of other files Case-sensitive file names Case-sensitive file names

7 Mounting All UNIX systems usually have at least one permanent non-removable hard disk system. The root directory and the directories below it are stored on this disk. Its structure is known as the root file system. All UNIX systems usually have at least one permanent non-removable hard disk system. The root directory and the directories below it are stored on this disk. Its structure is known as the root file system. If an additional hard disk is added, UNIX creates a separate new filesystem on this disk. Before it can be used, it must be attached to the root file system. This is called mounting an additional filesystem. If an additional hard disk is added, UNIX creates a separate new filesystem on this disk. Before it can be used, it must be attached to the root file system. This is called mounting an additional filesystem.

8 Mounting example 1

9 Mounting example 2 Filesystem blocks Used Available Mounted on /dev/hda8 995115 598998 344711 / /dev/hda10 2974518 2714151 106547 /usr /dev/hda9 995115 174404 769305 /home /dev/hda1 52653 2511 47333 /boot /dev/hdb6 3935495 3051510 680363 /scratch /dev/hdb7 1717427 2076 1626594 /tmp /dev/fd0 1423 288 1135 /floppy

10 File types A file can be e.g.: A file can be e.g.: –Text file –Data file –Source Code file –Executable file –Shell program –Link –Device file

11 file-command Used to determine file type Used to determine file type Usage: Usage: – file file e.g: e.g: – file * – file /dev/hda1 Output examples Output examples – ASCII text – c program text – character special (Device file)

12 cd,ls - and pwd -commands cd cd ~ ls ls -a ls -l la -p pwd

13 Root-directory / /dev/net /etc/opt /export/sbin /home/stand /kernel/tmp /lost+found/usr /mnt/var

14 Security rights Example file Example file -rwxr-x--- 1 ex1 users 512 Sep 11 10:28 a.ps File type indicatior | Permissions for file owner | | Permission for group members | | | Permissions for others | | | | - rwx r-x ---

15 File tools rm - remove file (or directory) rm - remove file (or directory) cp - copy file to another location cp - copy file to another location mv - move file to another location mv - move file to another location mkdir - create new directory mkdir - create new directory rmdir - remove directory rmdir - remove directory

16 ch-commands chmod chmod –Change permission mode for file chown chown –Change owner for file chgrp chgrp –Change group for file

17 chmod Usage: Usage: – chmod o+r datafiles chmod [augo][+-=][rwx] file

18 cat and more cat - Display, combine, append, copy, or create files cat - Display, combine, append, copy, or create files –Usage: cat [option] file more - Display all or parts of a file one screen at a time more - Display all or parts of a file one screen at a time –Usage: more [option] file

19 More info http://cit.evitech.fi/unix/ostart.htm http://cit.evitech.fi/unix/ostart.htm


Download ppt "UNIX File System by Tero Toikkanen, CAP02S. UNIX Multi-user system Multi-user system Multi-tasking system Multi-tasking system Wide selection of tools."

Similar presentations


Ads by Google