Linux for Dummies

Embed Size (px)

Text of Linux for Dummies

. . . . - , , root. . GPL, , . , . . UNIX. UNIX 1969 Bell Laboratories Multics. UNIX . , UNIX , . UNIX . UNIX , . Windows , . MINIX UNIX. MINIX . 1991 . http://www.kernel.org/pub/linux/kernel/Historic Windows , . , Open Source . OSD (Open Source Definition ) , , . , , . . , . . , . . http://opensource.org/docs/definition.php . GNU . GNU "GNU's Not UNIX" " UNIX". GNU e , 1983 , UNIX , . GNU 1984.

2

, . , . GNU General Public License (GPL) , GPL . , , , . GPL . Artistic License BSD . : . . ( ). , . , . , . , , , , . . . , . Windows DOS , . , . , . , , . - , . , , , , , .. - : Debian: Debian , . - ( 7 ). ( ). , . Red Hat: Red Hat - . . Red Hat . Red Hat . Red Hat , . Red Hat . Fedora.

3

SUSE: , ( , , . ). . SUSE e . SUSE Novel . Slackware: Slackware - , . "" "" Slackware . , . Slackware , . Mandrake: Mandrake e Red Hat. , . Mandrake . - . , , . . . : . , . 1 2. 3. . , , (testing kernels) . . - 2.4. 2.6.. 2.4.24 2.6.3. . , , . , , . . . /dev. , . Linux . - (kernel). , , , ,

4

. (process). , (networking). , , . ' ' ( TCP ), . , - ( ). , , . 2.6 (preemptible). , . 2.6 , . . , . , ( ), . root. . , . ( ) . , - , . Linux , . . Linux ext ext2, msdos, ntfs vfat, xia, minix, umsdos, iso9660, ufs, proc, sysv, ncp, smb, affs, hpfs, raiserfs . Linux, UNIXTM ( C:\ D:\) , . , Linux -. () Linux. , . . Windows. : IDE0 IDE1 master hda hdc slave hdb hdd . 1 4 5 . master IDE (IDE0) hda1.

5

. , . , . Linux : / |-- bin |-- boot |-- dev |-- etc |-- hom | '-- dino |-- lib |-- lost+found |-- mnt | |-- cdrom | |-- fat | '-- floppy |-- proc |-- root |-- sbin |-- tmp |-- usr | |-- X11R6 | |-- bin | |-- doc | |-- etc | |-- games | |-- include | |-- lib | |-- local | | |-- bin | | |-- doc | | |-- etc | | |-- games | | |-- lib | | |-- man | | |-- sbin | | '-- src | |-- man | |-- sbin | |-- src | | |-- linux -> linux-2.2.15-5 | | |-- linux-2.2.15-5 | |-- tmp |-- var - . , mount. ,

6

. automounter . , . , Windows. . hda, hdb . /dev. (/dev/dsp), (/dev/eth0 ..), USB .. , ( ). block device character device. , major minor. SCSI /dev/sda2 ( SCSI ), major 8, SCSI minor 2, . , . 2.4. 255 . 2.6. 4096 major minor. : /dev/hdx(y) IDE . , CD/DVD .. /dev/sdx(y) SCSI . , CD/DVD .. USB CD/DVD SCSI, . /dev/tty(x) . /dev/ttyS(x) . /dev/ttyS0 COM1 DOS/Windows. /dev/null . . /dev/zero . - . . , , . , . , init. , (, , ) . , , .. init login, . , login xdm (X Display Manager), . . . , . . .

7

: . , . /dev, /bin, /lib .. , . /home/student .

:/bin , . . . /boot , , . /dev . . /etc . . /home . . , . , . /lib - glibc-solibs. (shared object), . /lib/modules . , .. . , . /mnt . . .

8

/opt KDE GNOME. /proc . , . /root . . /sbin . . root , . /tmp . . , . /usr . , . /usr/X11R6, /usr/X11 , . /usr/bin , . /usr/doc . Linux-HOWTO. /usr/include . C , . /usr/info . info. /usr/local

9

. /usr. /usr/man - . (manual page) . man. /usr/lib , . , . /usr/share . , . /usr/src . . /lib/modules . , . /usr/src linux, . /var , . , , . , . ( /root ) . /tmp . ( ), , . , . . , . : (r) (w) () :

10

-> rwx

-> rwx

-> rwx ls -l.

:

#ls -l drwx------ 40 dino users 1024 Sep 8 14:51 .drwxr-xr-x 7 root root 1024 Aug 18 19:23 ..-rw-r--r-- 1 dino users 30 Sep 8 18:17 sample.txtdrwxr-xr-x 2 dino users 1024 Sep 8 18:19 sample , d , sample.txt . sample.txt : dino , . , . users . . , (execution). , (search). , , . , . SUID GUID. , . . , / chown chmod. sample.txt, , : #chmod +x ./sample.txt : + , . r, w x . . ? + , : u (user) g (group) (others) (all), . . #chmod o-x ./sample.txt

11

, : #chmod u+rwx ./sample.txt , , 0. #ls -l ./sample.txt -rwxr-xr-1 dino users 30 Sep 8 18:45 sample.txt -> r w x -> 1 1 1 -> r w x -> 1 0 1 -> r w x -> 1 0 0 111, 101 100: -> r w x -> 1 1 1 -> 7 -> r w x -> 1 0 1 -> 5 -> r w x -> 1 0 0 -> 1 , 7, 5 4. , chmod e ( UNIX): #chmod 744 ./sample.txt : rwxrwxrwx 111101100 111 101 100 741 -, - . , . : 4 2 1 / . 4+2 =6. , . chown. #chown gosho ./sample.txt #ls -l ./sample.txt -rwxr-xr-- 1 gosho users 30 Sep 8 18:55 sample.txt dino . gosho root. chgrp: #chgrp root ./sample.txt #ls -l ./sample.txt -rwxr-xr-- 1 gosho root 30 Sep 8 19:02 sample.txt

12

chgrp chown. : #chown dino:users ./sample.txt #ls -l ./sample.txt -rwxr-xr-- 1 dino users 30 Sep 8 19:02 sample.txt . (root) . . . , . , , , . , root. root . (), , . , . , prompt . , root, . . ( ). home () . : /home/ime_na_potrebitelia . , . . profile, . /etc/passwd. - , . , . : username:password:userID:groupID:comment:home_directory:login_comm : root:x:0:0::/root:/bin/bash bin:x:1:1:bin:/bin: daemon:x:2:2:daemon:/sbin: adm:x:3:4:adm:/var/log: lp:x:4:7:lp:/var/spool/lpd: sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/: news:x:9:13:news:/usr/lib/news:

13

uucp:x:10:14:uucp:/var/spool/uucppublic: operator:x:11:0perator:/root:/bin/bash games:x:12:100:games:/usr/games: ftp:x:14:50::/home/ftp: smmsp:x:25:25:smmsp:/var/spool/clientmqueue: mysql:x:27:27:MySQL:/var/lib/mysql:/bin/bash rpc:x:32:32:RPC portmap user:/:/bin/false gdm:x:42:42:GDM:/var/state/gdm:/bin/bash pop:x:90:90OP:/: nobody:x:99:99:nobody:/: sshd:x:33:33:sshd:/: dino:x:1000:100inko,,,:/home/dino:/bin/bash www:x:1001:102:,,,:/home/www:/bin/bash ffsearch:x:1002:103::/home/ffsearch: stinger:x:1003:100:,,,:/home/stinger:/bin/rzsh postfix:x:1004:100::/home/postfix: , . , . : username password userID(UID) , groupID(GID) , comment ( ..) home_directory login_comm , . - . , , UNIX . -, . , . , shadow password fail, /etc/shadow. , x. shadow : root:$1$EnI1gPEs$LwH91OIgMRGwPcdqlleU21:12209:0::::: bin:*:9797:0::::: daemon:*:9797:0::::: adm:*:9797:0::::: lp:*:9797:0::::: sync:*:9797:0::::: shutdown:*:9797:0::::: halt:*:9797:0::::: mail:*:9797:0::::: news:*:9797:0::::: uucp:*:9797:0::::: operator:*:9797:0::::: games:*:9797:0::::: ftp:*:9797:0::::: smmsp:*:9797:0::::: mysql:*:9797:0::::: rpc:*:9797:0:::::

14

gdm:*:9797:0::::: pop:*:9797:0::::: nobody:*