210 likes | 434 Views
UNIX File System. by Tero Toikkanen, CAP02S. UNIX. Multi-user system Multi-tasking system Wide selection of tools for software development Open architecture. Some UNIX variants. LINUX (Caldera, Debian, Mandrake, RedHat, Slackware, SuSE...). BSD (FreeBSD, NetBSD, OpenBSD). HP-UX.
E N D
UNIX File System by Tero Toikkanen, CAP02S
UNIX • Multi-user system • Multi-tasking system • Wide selection of tools for software development • Open architecture
Some UNIX variants • LINUX (Caldera, Debian, Mandrake, RedHat, Slackware, SuSE...) • BSD (FreeBSD, NetBSD, OpenBSD) • HP-UX • Solaris • IRIX • Compaq Tru64 UNIX (discontinued)
KISS • The general principle: ”Keep It Simple, Stupid” • Programs perform one well defined task properly • Almost all data is presented as text • Programs can be combined like LEGO-blocks
RTFM • Learn to use the documentation • manand infocommands • Internet resources • Website of the variant or distribution • HOW-TO’s • Tutorials
The Basics of UNIX File system • Hierarchical tree -structure • File-spesific security rights • Files may be shared • 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 • Case-sensitive file names
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. • 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.
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
File types • A file can be e.g.: • Text file • Data file • Source Code file • Executable file • Shell program • Link • Device file
file-command • Used to determine file type • Usage: • file file • e.g: • file * • file /dev/hda1 • Output examples • ASCII text • c program text • character special(Device file)
cd,ls- and pwd-commands cd cd ~ ls ls -a ls -l la -p pwd
Root-directory / /dev /net /etc /opt /export /sbin /home /stand /kernel /tmp /lost+found /usr /mnt /var
Security rights • 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 ---
File tools • rm - remove file (or directory) • cp - copy file to another location • mv - move file to another location • mkdir - create new directory • rmdir - remove directory
ch-commands • chmod • Change permission mode for file • chown • Change owner for file • chgrp • Change group for file
chmod • Usage: • chmod o+r datafiles chmod [augo][+-=][rwx] file
cat and more • 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 • Usage: more [option] file
More info • http://cit.evitech.fi/unix/ostart.htm