You are on page 1of 173

12 1429

13 2008
1




: /

remstereo

:
remstereo555@yahoo.com
remstereo@gmail.com

:
:

. open suse 11
.


. . 2

opensuse 11

openoffice.org 2.4

GNU FDL ) ( GNU Free Documentation License

: .

.
.


3----------------------------------------------------------- :

: 10------------------------------
man

info

xman

manual
whatis

apropos

: 24--------------------------------------------
whereis
locate

: 29-----------------

-a 29------------------------------------------------------
pushd
popd
cd

pwd
ls

dir

-b 45----------------------------------------------
5

touch
cat
tac
file

more
less

head
tail
wc

grep

zgrep
diff

-c 62---------------------------------------------
mkdir
tree

-d 65----------------------------------
rm

cp

mv

# * 73-----------------------------------
ln

: 76-----------------------------------------

-a 76--------------------------------------------------------
tar

#
#

cpio

-b 83--------------------------------------------------------
gzip

: 85-------------------------------------
mcedit

vim gvim

pico

nano

emacs

xemacs


sed

ispell

: 106------------------------------------

-a 106--------------------------------------------
106--------------------------------------------------------

fdisk

cfdisk
7

-b 121-------------------------------------
mkfs

-c ) (123------------------------
#

df

: 130--------------------------
130-----------------------------------------------------------

-a 132---------------------------------------
# groupadd

# groudmod

# groupmod
#
/etc/group

-b 135-------------------------------------
# useradd

# usermod

# userdel

# 143---------------------------------
/etc/passwd

/etc/shadow

# disable /etc/shadow

-a group
8

-b passwd

#
#
id

groups

gpasswd

passwd

-c permission
#

:
:

chmod

-a

-b

chown
chgrp

170-------------------------------------------

174------------------------------------------------------------

# ) manual (

# : man
: )
-
........... ( .
:
man
-1 ls :
ahmed@the-game:~> man ls
-2 ) ( f

ls :

ahmed@the-game:~> man -f ls
:
10

)ls (1p

- list directory contents

)ls (1

- list directory contents

ls .
-3 ) (k

fdisk :

ahmed@the-game:~> man -k fdisk


:
- Curses based disk partition table

)cfdisk (8

- Partition table manipulator for Linux

)fdisk (8

manipulator for Linux


)sfdisk (8

- Partition table manipulator for Linux

: ] [-f ] [-k whatis


: manual

down arraw

up arraw

page down


11

page up

manual

# : info
man info .
:
info

-1 ls :
ahmed@the-game:~> info ls

: info

b
down arraw


12

up arraw


Enter

? shift +

info
info

info

# : xman
manual man
)
) ( 9 1 .( man

& ahmed@the-game:~> xman

13

manual page :

sections

options search
:

14

manual page .
Apropos .

## : manual
} {9-1
:
} 1 { .
} 2 { .

} 3 ) ( { .

} 4 devices ... viga { .

} 5 configration files

/etc/passwd { .
} 6 { .

} 7 . { man
} 8 { .

15

} 9 , kernel routines {
}. {1,2,5,8

:
) (
kill ). (2) , (1
) (kill
man )
kill . ( 1

:

ahmed@the-game:~> man 2 kill

: clear termenal
:

ahmed@the-game:~> man clear

clear :

16

clear(1)

clear(1)

NAME

clear - clear the terminal screen


SYNOPSIS
clear

DESCRIPTION

clear clears your screen if this is possible. It looks in the


environment for the terminal

type and then in the terminfo database to figure out how


.to clear the screen

clear ignores any command-line parameters that may be


.present

SEE ALSO

(tput(1), terminfo(5
.(This describes ncurses version 5.6 (patch 20070128

17

:
-1 ) clear
1 (
)clear(1
)clear(1
2- NAME:

. : emacs

3- SYNOPSIS:

] emacs [ command-line switches ] [ files ...


option .

# :
] [

> <

> <file file


.

} { .
... .

[option]... [file]...

]> <[
.
18

4- DESCRIPTION:

5- OPTIONS:

6- EXAMPLES:

7- AUTHORS:
.manual

8- BUGS:
.

9- COPYRIGHT:

10- SEE ALSO:

.mount
19

11- F IL ES:

12- HISTORY:
unix .bsd

# : whatis
. .
:
ahmed@the-game:~> su
Password:

the-game:/home/ahmed # makewhatis
:
ahmed@the-game:~> su
Password:

the-game:/home/ahmed # mandb

makewhatis.

20

whatis
-1 :
ahmed@the-game:~> whatis ls
:
- list directory contents

)ls (1

-2
:

ahmed@the-game:~> whatis ls dir cd ifconfig


:
- list directory contents

- list directory contents

)ls (1

)dir (1

cd: nothing appropriate.

- configure a network interface

)ifconfig (8

cd .

# : apropos
.
21

.
:
apropos
-1 :
ahmed@the-game:~> apropos fdisk
:
- Curses based disk partition table

)cfdisk (8

- Partition table manipulator for Linux

)fdisk (8

manipulator for Linux

- Partition table manipulator for Linux

)sfdisk (8

apropos database .whatis

22

23


:
# : whereis
] [
. manual
:
-1 }
manual { source :

: ls

whereis

ahmed@the-game:~> whereis ls
:
ls: /bin/ls /usr/share/man/man1p/ls.1p.gz
/usr/share/man/man1/ls.1.gz

-2 manual :
whereis -m

24

: manual ls.
ahmed@the-game:~> whereis -m ls
:
ls: /usr/share/man/man1p/ls.1p.gz
/usr/share/man/man1/ls.1.gz

-3 :

whereis -b
: ls.
ahmed@the-game:~> whereis -b ls
:
ls: /bin/ls
-4 } {source :
whereis -s
: } {source ls.

25

ahmed@the-game:~> whereis -s ls
:
ls:

# : locate
.find
: locate
:

ahmed@the-game:~> su
Password:

the-game:/home/ahmed # updatedb
:
locate
-1
:

locate *.

26

: mp4 .
the-game:/home/ahmed # locate *.mp4
} : {
/amr1.mp4/ /mnt/collection1/ar v.clip/2008
-2 mp4 mp2

the-game:/home/ahmed # locate *.mp4 *.mp2


} : {
/amr1.mp4/ /mnt/collection1/ar v.clip/2008

.mp2/ /mnt/collection1/ogg/ar---ogg/
-3 avi /mnt/collection1

ahmed@the-game:~> locate /mnt/collection1/*.avi


} : {
.avi/ /mnt/collection1/ar v.clip/
27

.avi / /mnt/collection1/ar v.clip/


.avi //mnt/collection1/ar v.clip/
.avi //mnt/collection1/ar v.clip/

. } note : {/mnt/collection1/*.avi

28

- a :
# : pushd
. :

pushd

pushd
: } { /mnt/games/chm :
ahmed@the-game:~> pushd /mnt/games/chm/
: } { ahmed :
ahmed@the-game:/mnt/games/chm> pushd ahmed

# : popd
.
pushd cd
popd
29

:
ahmed@the-game:/mnt/games/chm/ahmed> popd
:
~ /mnt/games/chm

>ahmed@linux-r58p:/mnt/games/chm
: popd pushd . manual

# : cd
.
-1 :
cd
: ahmed :
ahmed@the-game:~> cd ahmed
:
>ahmed@the-game:~/ahmed

30

-2 :
cd
: ogg /mnt/collection1
:

ahmed@the-game:~> cd /mnt/collection1/ogg
:
>ahmed@the-game:/mnt/collection1/ogg
-3 :
ahmed@the-game:/mnt/collection1/ogg> cd ..
:
>ahmed@the-game:/mnt/collection1
-4 :
~ ahmed@the-game:/mnt/collection1/ogg> cd

ahmed@the-game:/mnt/collection1/ogg> cd
31

ahmed@the-game:~> cd - :
>~ahmed@the-game:
] ~ [ cd ] [ cd ] [ cd -- .
-5 :
ahmed@the-game:/mnt/collection1/ogg> cd ../..
:
>ahmed@the-game:/mnt

# : pwd
.
.
ahmed@the-game:~> pwd
:

32

/home/ahmed

ahmed@the-game:/mnt/collection1/ogg> pwd
:
/mnt/collection1/ogg

# : ls

.

-1 } {

ahmed@the-game:~> ls
:
bin Desktop Documents RealPlayer11GOLD.bin
public_html

.
33

: -2
ahmed@the-game:~> ls /var
:
adm

cache lib log opt spool X11R6

agentx games lock mail run tmp yp

.
: -3
ahmed@the-game:~> ls -a
:
.

..

.bash_history

.gconf

.gconfd

.gnome2

.qt

.realplayerrc

.recently-used

.bashrc

.gnome2_private .recently-

.beagle

.gnu-emacs

.scim

.ICEauthority

.subversion

used.xbel
bin

.config

.gtk_qt_engine_rc .skel

34

.DCOPserver_the-game__0 .inputrc
.DCOPserver_the-game_:0 .kde
Desktop

.kermrc

.thumbnails

.tvtime

.urlview

.dmrc

.local

.wapi

.dvipsrc

.mcop

.xchat2

Documents
.emacs

.esd_auth

.mailcap

.mozilla

.mplayer

.Xauthority

.xcoralrc

.xemacs

.exrc

.muttrc

.xim.template

.fonts

.opera

.xinitrc.template

.fontconfig
.fonts.conf

RealPlayer11GOLD.bin

.ooo-2.0
.profile

.xine

.xsession-errors

public_html

.xtalkrc

.
U- -4
:

ahmed@the-game:~> ls -U
:
Documents Desktop bin public_html
RealPlayer11GOLD.bin

35

-5 :
ahmed@the-game:~> ls -t
:
Text File Desktop bin Documents public_html
RealPlayer11GOLD.bin

Text File .
-6 } {
:

ahmed@the-game:~> ls -r
:
Text File public_html RealPlayer11GOLD.bin Documents
Desktop bin

-7 )

hard links

( :

ahmed@the-game:~> ls -l
36

:
total 7384

drwxr-xr-x 2 ahmed users 4096 2008-06-12 15:01 bin

drwx------ 10 ahmed users 4096 2008-06-18 13:47 Desktop


drwx------ 2 ahmed users 4096 2008-06-14 22:20
Documents

drwxr-xr-x 2 ahmed users 4096 2008-06-12 15:01


public_html

-rwxrwxrwx 1 ahmed users 7502048 2008-06-07 02:45


16 2008-06-13 11:25 Text File

RealPlayer11GOLD.bin

-rw-r--r-- 1 ahmed users

:
bytes

.
: ) . (bin ,Desktop ,........
: ) . ( 15:01

: ) . ( 12-06-2008

: bytes ) . ( 4096

: ) . ( users
: ) . ( ahmed
: :

37

-a

) ( Desktop 10 .

-b hard

links .

: ) ( drwxr-xr-x
.

-8

ahmed@the-game:~> ls -hl
:
total 7.3M

drwxr-xr-x 2 ahmed users 4.0K 2008-06-12 15:01 bin

drwx------ 10 ahmed users 4.0K 2008-06-18 13:47 Desktop

drwx------ 2 ahmed users 4.0K 2008-06-14 22:20 Documents


drwxr-xr-x 2 ahmed users 4.0K 2008-06-12 15:01
public_html

-rwxrwxrwx 1 ahmed users 7.2M 2008-06-07 02:45


RealPlayer11GOLD.bin

-rw-r--r-- 1 ahmed users 16 2008-06-13 11:25 Text File


mega

.
38

: -9
ahmed@the-game:~> ls -S
: S l
ahmed@the-game:~> ls -lS
:
total 9760

-rwxrwxrwx 1 ahmed users 7502048 2008-06-07 02:45


RealPlayer11GOLD.bin

-rw-r--r-- 1 ahmed users 2111499 2008-06-18 04:23


Chikenux.01.7z

-rw-r--r-- 1 ahmed users 284959 2008-06-18 04:07 83425opensusestreet.png

-rw-r--r-- 1 ahmed users 11390 2008-06-18 02:30


hijra-0.1.2.tar.bz2

drwxr-xr-x 2 ahmed users 4096 2008-06-12 15:01 bin

drwx------ 10 ahmed users 4096 2008-06-18 13:47 Desktop


drwx------ 4 ahmed users 4096 2008-06-18 18:22
Documents

drwxr-xr-x 2 ahmed users 4096 2008-06-12 15:01


public_html

39

-rw-r--r-- 1 ahmed users

16 2008-06-13 11:25 Text File.txt

: -10
ahmed@the-game:~> ls -R
:
.:

bin Desktop Documents public_html


RealPlayer11GOLD.bin Text File
./bin:
./Desktop:

epiphany.desktop

i386-iso .odt
fstab

ls

openSUSE-10.3-GM-KDE-

MozillaFirefox.desktop opera.desktop

konqbrowser.desktop myComputer.desktop
tvtime.desktop

konquerorsu.desktop Office.desktop

trash.desktop

./Desktop/openSUSE-10.3-GM-KDE-i386-iso:
openSUSE-10.3-GM-KDE-i386.iso
./Documents:

40

rpmforge-net-

./public_html:
-11 :
ahmed@the-game:~> ls -F
:
bin/ Desktop/ Documents/ public_html/
*RealPlayer11GOLD.bin

/ * link
@ socket = .

-12 :
ahmed@the-game:~> ls -m
:
bin, Desktop, Documents, public_html,
RealPlayer11GOLD.bin

-13 } { D :

41

ahmed@the-game:~> ls D*
:
Desktop:

epiphany.desktop

myComputer.desktop

Fedora-9-i386-CDs.torrent Office.desktop
fstab

fstab~

openSUSE-10.3-GM-KDE-i386-iso
opera.desktop

konqbrowser.desktop
konquerorsu.desktop

MozillaFirefox.desktop
mp3

rpmforge-net-tvtime.desktop

Text File

trash.desktop

.odt

Documents:
D

Desktop Documents Documents Desktop

z,R,r -14

: oot

ahmed@the-game:~> ls [Rrz]oot
:

42

root:
Root:
root Root
. zoot

-15 a r llw
:

ahmed@the-game:~> ls [a-r]llw
:
gllw:
kllw:
small a r .
-16 :
ahmed@the-game:~> ls -1 /var
:
43

adm

agentx
cache

games
lib

lock
log

mail
opt

run

spool
tmp

X11R6
yp

: -17
ahmed@the-game:~/Documents> ls -X
:
mido Chikenux.01.7z
opensusestreet.png

hijra-0.1.2.tar.bz2 83425-

tito RealPlayer11GOLD.bin 12.doc

44

Text File.txt


) ( .tar.bz2 ) . ( .bz2

# : dir
ls
. ls
- b :
# : touch
. -1 asd

ahmed@the-game:~> touch asd


-2 } xman txt {
:

ahmed@the-game:~> touch xman.txt


-3

45

ahmed@the-game:~> touch hima ahmed


-4

{ :

ahmed@the-game:~> touch hima ahmed


touch
:

: touch
ahmed@the-game:~> ls -l
:
0 2008-06-14 22:07 ahmed
0 2008-06-14 22:07 hima

-rw-r--r-- 1 ahmed users


-rw-r--r-- 1 ahmed users

: touch
ahmed@the-game:~> ls -l
:

46

0 2008-06-16 14:06 ahmed


0 2008-06-16 14:06 hima

-rw-r--r-- 1 ahmed users


-rw-r--r-- 1 ahmed users

-5

:
:

cc yy MM DD hh mm ss

cc

yy

cc : yy

1985 cc=19 yy=85


2008 cc=20 yy=08

yy ) ( 0 68 ) . ( cc=20

yy ) ( 99 69 ) . ( cc=19

yy .
MM .
DD .

mm .
ss .

: 9
. 09

.
47

: mido

12/9/1981 6:30:24 )

( :

ahmed@the-game:~> touch -t 8109120630.24 mido

ahmed@the-game:~> touch -t 198109120630.24 mido


ls l :
ahmed@the-game:~> ls -l
-rw-r--r-- 1 ahmed users 0 1981-09-12 06:30 mido
: mido

30/7/2022 13:30:50 :
ahmed@the-game:~> touch -t 2207301330.50 mido

ahmed@the-game:~> touch -t 202207301330.50 mido


ls l :
ahmed@the-game:~> ls -l

48

0 2022-07-30 13:30 mido

-rw-r--r-- 1 ahmed users

: 2068
. 1969

# : cat
: cat
-a .
-b
.
-c
.
-d .
-e .
-f .
: cat

:
-1 )

( soca :

ahmed@the-game:~> cat soca


49

.
-2 :

ahmed@the-game:~> cat -n soca


-3 )

soca ( tman :

ahmed@the-game:~> cat soca tman


soca . tman
-4

ahmed@the-game:~> cat -n soca tman


-5 )
( ahmed :

ahmed@the-game:~> cat soca tman > ahmed


ahmed

soca tman .

50

-6

) ( dido :

ahmed@the-game:~> cat -n soca tman > dido


dido

-7
:

ahmed@the-game:~> cat > soca


Enter
) ( Ctrl+d .

-8

ahmed@the-game:~> cat >> soca


Enter
) ( Ctrl+d .

-9 ) ( bibo

51

ahmed@the-game:~> cat > bibo


Enter
) ( Ctrl+d .

# : tac
.
) ( bibo :
ahmed@the-game:~> tac bibo

# : file

-1 ) ( bibo :
ahmed@the-game:~> file bibo
:
bibo: ASCII text
-2 ) bibo
RealPlayer11GOLD.bin ( bin :

ahmed@the-game:~> file RealPlayer11GOLD.bin bibo bin


52

:
RealPlayer11GOLD.bin: ELF 32-bit LSB executable, Intel

80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically

linked (uses shared libs), for GNU/Linux 2.2.5, not stripped


ASCII text

directory

bibo:
bin:

# : more
.
more )
: ( tman
ahmed@the-game:~> more tman
: more

space
f

Enter

53

# : less
more .
more :
ahmed@the-game:~> less tman
more less

up down .

ahmed@the-game:~> less help


less manual
.

# : head
.
: 10 tman :
ahmed@the-game:~> head -10 tman
10 .

54

# : tail
.
.
-1 15 :
ahmed@the-game:~> tail -15 tman
15 .
-2 16 :
ahmed@the-game:~> tail +16 tman
16 .

# : wc
.
. soca
-1 :
ahmed@the-game:~> wc -l soca
-2 :

55

ahmed@the-game:~> wc -w soca
-3 bytes :
ahmed@the-game:~> wc -c soca
-4 :
ahmed@the-game:~> wc -m soca
-5 :
ahmed@the-game:~> wc soca

# : grep
)
( .
: capital & small
.
-1 linux soca
:
ahmed@the-game:~> grep linux soca
.

56

-2 Linux kernel soca

ahmed@the-game:~> grep "Linux kernel" soca


.
-3 linux

soca :

ahmed@the-game:~> grep -v linux soca


. linux
-4 Linux kernel

soca :

ahmed@the-game:~> grep -v "Linux kernel" soca


. Linux kernel
-5 Linux

soca :

ahmed@the-game:~> grep -n linux soca

57

-6 Linux kernel

soca :

ahmed@the-game:~> grep -n "Linux kernel" soca


-7 linux

soca :

ahmed@the-game:~> grep -c linux soca


-8 Linux kernel
soca :

ahmed@the-game:~> grep -c "Linux kernel" soca


-9 linux

* /home/ahmed/ :

*ahmed@the-game:~> grep -l linux /home/ahmed/


-10 Linux kernel

* /home/ahmed/ :

*ahmed@the-game:~> grep -l "Linux kernel" /home/ahmed/


grep
58


) ( pattern
: pattern
^

] , [

] small

. small

-a linux :
ahmed@the-game:~> grep ^linux soca

-b linux :
ahmed@the-game:~> grep linux$ soca
: .
linux

59

-c l ) x

linux ( :

ahmed@the-game:~> grep l...x soca


-d a f :
ahmed@the-game:~> grep [a,f] soca
-e root Root :
ahmed@the-game:~> grep [Rr]oot soca

# : zgrep
)
( .
zgrep grep grep
zgrep .
:
linux
soca.tar.gz :
ahmed@the-game:~> zgrep Linux soca.tar.gz

60

# : diff

: asd1 :
ahmed elsayed ahmed ali
amr ali
asd2 :
ahmed elsayed ahmed ali
amr ahmed


:
ahmed@the-game:~> diff asd1 asd2
:
2,3c2
<

< amr ali


---

> amr ahmed


61

\ No newline at end of file

amr ahmed
amr ali ( .

.
:

-a

-b

-c

- c :
# : mkdir

.
-1 conan :
ahmed@the-game:~> mkdir conan

62

-2 conan /mnt :
the-game:/home/ahmed # mkdir /mnt/conan
. root
-3 ) amr gigi
hani ( dido :

ahmed@the-game:~> mkdir amr gigi hani dido


-4 ) edg amr gigi
hani ( dido :

ahmed@the-game:~> mkdir -p edg/amr/gigi/hani/dido


-5 mkdir

v- :

ahmed@the-game:~> mkdir -vp edg/amr/gigi/hani/dido


:
'mkdir: created directory `edg

'mkdir: created directory `edg/amr

'mkdir: created directory `edg/amr/gigi


63

'mkdir: created directory `edg/amr/gigi/hani

'mkdir: created directory `edg/amr/gigi/hani/dido

# : tree
.
-1
:
ahmed@the-game:~> tree
-2 )
( /var :

ahmed@the-game:~> tree /var



-3

ahmed@the-game:~> tree -d
-4
) ( /var :

64

ahmed@the-game:~> tree -d /var

- d :

# : rm
.
-1 soca :
ahmed@the-game:~> rm soca
-2 bibo /mnt/collection1 :
ahmed@the-game:~> rm /mnt/collection1/bibo
-3 koki :
ahmed@the-game:~> rm -f koki
-4 yes no
nani :

ahmed@the-game:~> rm -i nani
:
65

?'rm: remove regular file `nani


yes :
rm: remove regular file `nani'? yes
-5 :
* ahmed@the-game:~> rm
-6 ) :( zizo
ahmed@the-game:~> rm -r zizo
:

rm


ls -l

# : cp

.

66

-1 fofa /mnt/collection1

/home/ahmed/Desktop :

ahmed@the-game:~> cp /mnt/collection1/fofa
/home/ahmed/Desktop

-2 fofa /mnt/collection1

ahmed@the-game:~> cp fofa /mnt/collection1


-3 fofa /mnt/collection1

ahmed@the-game:~> cp -f fofa /mnt/collection1


-4 -i

yes no
miro

/mnt/collection1 -i
:

~ ahmed@the-game:~> cp -i /mnt/collection1/miro
:

67

?'cp: overwrite `/home/ahmed/miro


no
cp: overwrite `/home/ahmed/miro'? n
: ~ .
-5 -r -R

vector /mnt/collection1

/home/ahmed/Desktop :

ahmed@the-game:~> cp -r /mnt/collection1/vector
/home/ahmed/Desktop

ahmed@the-game:~> cp -R /mnt/collection1/vector
/home/ahmed/Desktop

-6 vector /mnt/collection1

/home/ahmed/Desktop

) ( -v :

ahmed@the-game:~> cp -vr /mnt/collection1/vector /home/


68

ahmed/Desktop
:
:

-7 fola soma

ahmed@the-game:~> cp fola soma


-8 fola

/mnt/collection1 soma :
ahmed@the-game:~> cp fola /mnt/collection1/soma
-9

ahmed

/mnt/collection1 /mnt/collection2 :
ahmed@the-game:~> cp /mnt/collection1/ahmed
/mnt/collection2

# : mv

.
mv
69

mv cp
-r . mv

-1 fofa /mnt/collection1

/home/ahmed/Desktop :

ahmed@the-game:~> mv /mnt/collection1/fofa
/home/ahmed/Desktop

-2 fofa /mnt/collection1

ahmed@the-game:~> mv fofa /mnt/collection1


-3 fofa /mnt/collection1

ahmed@the-game:~> mv -f fofa /mnt/collection1


-4 -i

yes no
miro

/mnt/collection1 -i
:

~ ahmed@the-game:~> mv -i /mnt/collection1/miro
70

:
?'mv: overwrite `/home/ahmed/miro
no
mv: overwrite `/home/ahmed/miro'? n
: ~ .
-5 zima

/mnt/collection1 :

ahmed@the-game:~> mv zima /mnt/collection1


-6 zima /mnt/collection1

/home/ahmed/Desktop

) ( -v :

ahmed@the-game:~> mv -v /mnt/collection1/zima
/home/ahmed/Desktop

-7 :


zima /home/ahmed/Desktop
71

mike :
ahmed@the-game:~> mv /home/ahmed/Desktop/zima
/home/ahmed/Desktop/mike

ahmed@the-game:~> cd /home/ahmed/Desktop
ahmed@the-game:~/Desktop> mv zima mike

mv

mv


overwrite

biso nona nona

ahmed@the-game:~/Desktop> mv biso nona


biso
72

. nona
-8 fola

/mnt/collection1 soma :
ahmed@the-game:~> mv fola /mnt/collection1/soma
-9 -b
wama :

ahmed@the-game:~> mv -b wama /mnt/collection1



~ wama wama /mnt/collection1
* :


/mnt/collection1 :

ahmed@the-game:~> cp -r * /mnt/collection1

/mnt/collection1 :

ahmed@the-game:~> mv * /mnt/collection1

73


" new folder
. new folder

# : ln

- 1 :

.
.
:

} - { .
ln -s

hima /mnt/collection1 zima


/home/ahmed/Desktop :

ahmed@the-game:~> ln -s /mnt/collection1/hima
/home/ahmed/Desktop/zima

- 2 :

} : -
{ partition .

partition .
74

ln

nova /mnt/collection1 koka


/mnt/collection1/ogg :

ahmed@the-game:~> ln /mnt/collection1/nova
/mnt/collection1/ogg/koka

75


:
- a :

.

# : tar
.
.tar
-a :

-cvf c creat v
f file

) -cvf .( -fvc

-1 wcw

/mnt/collection1
/home/ahmed/Desktop :

ahmed@the-game:~> cd /mnt/collection1

ahmed@the-game:/mnt/collection1> tar -cvf /home/ahmed/


Desktop/wcw.tar wcw

-2 wcw
76

/mnt/collection1
wcw mtm :

ahmed@the-game:~> cd /mnt/collection1

ahmed@the-game:/mnt/collection1> tar -cvf mtm.tar wcw


-3

y n
-cwf

gigi /mnt/collection1

gigi vino :

ahmed@the-game:~> cd /mnt/collection1

ahmed@the-game:/mnt/collection1> tar -cwf vino.tar gigi


:
?'add `/mnt/collection1/gigi
y
add `/mnt/collection1/gigi'?y
.

n
77

-4 raya gzip

hoda.tgz :

ahmed@the-game:~> tar -czvf hoda.tgz raya


-5 raya bzip2

hoda.bz2 :

ahmed@the-game:~> tar -cjvf hoda.bz2 raya

-b :

-1 vino.tar

/mnt/collection1 :

ahmed@the-game:~> tar -tf /mnt/collection1/vino.tar


-2 vino.tar

/mnt/collection1
:

ahmed@the-game:~> tar -tvf /mnt/collection1/vino.tar

78

-c :

-1 vino.tar

/mnt/collection1
:

ahmed@the-game:~> cd /mnt/collection1

ahmed@the-game:/mnt/collection1> tar -xvf vino.tar


-2 vino.tar

/mnt/collection1
:

ahmed@the-game:~> tar -xvf /mnt/collection1/vino.tar


-3 vino.tar

/mnt/collection1 :

ahmed@the-game:~> tar -xvwf /mnt/collection1/vino.tar


:
?'extract `gigi
y

79

extract `gigi'?y
.
-4 nana.pdf wcw.tar

/mnt/collection1 :

ahmed@the-game:~> cd /mnt/collection1

ahmed@the-game:/mnt/collection1> tar -xf wcw.tar


wcw/nana.pdf

-d :

-1 mido yara.tar

ahmed@the-game:~> tar -rvf yara.tar mido


-2 } { gamal

yara.tar
:

ahmed@the-game:~> tar -rvf yara.tar gamal

80

# : cpio

.
cpio
-f
ls find

-1 } noga {

/mnt/collection1 noga
tatu :

ahmed@the-game:~> cd /mnt/collection1/noga

> ahmed@the-game:/mnt/collection1/noga> ls | cpio -ov


../tatu.cpio

ahmed@the-game:/mnt/collection1/noga> find | cpio -ov


> ../tatu.cpio

-2 } noga {

/mnt/collection1 noga

tatu :

ahmed@the-game:~> cd /mnt/collection1/noga

ahmed@the-game:/mnt/collection1/noga> find | cpio -ov


> ../tatu.cpio

81

o creates v .
ls find

cpio
. } ls . { find

ls find

ls }

{ ls

find }

{ find

ls .

find .
-2 :

-1 noga

82

ahmed@the-game:~> cpio -iv <noga


-2 noga tamer :
ahmed@the-game:~> mkdir tamer
ahmed@the-game:~> cd tamer

ahmed@the-game:~/tamer> cpio -iv <../noga

- b :
# : gzip
tar
tar.gz tar . gzip
:

-a .

-b .

) ( 9-1
. default

-1 amr-diab.mp3

default :

ahmed@the-game:~> gzip amr-diab.mp3


83

-2 amr-diab

) ( 9 :
ahmed@the-game:~> gzip -9 amr-diab.tar
-3 -tv

amr-diab.tar.gz

ahmed@the-game:~> gzip -tv amr-diab.tar


) ok
) not ok

( amr-diab.tar.gz:

( amr-diab.tar.gz: .

-4 amr-diab.tar.gz

ahmed@the-game:~> gzip -l amr-diab.tar.gz


-5 amr-diab.mp3.gz
:

ahmed@the-game:~> gzip -d amr-diab.mp3.gz


:
84


:
# : mcedit

85

-1 :
ahmed elsayed ahmed ali
mido :
-a :
ahmed@the-game:~> mcedit

86

-b ahmed elsayed ahmed ali

save save

ok quit

.
-2 mido :
ahmed@the-game:~> mcedit mido

: tool bar . f9

# vim : gvim
vim vi vi

. vim vim vi

gvim vim .
vim ) ( .

87

-1 :

. Esc
-2 :

i . insert
vim 50
manual

. http://www.vim.org
pdf .
572 .

: vim
:

ahmed@the-game:~> evim
:
-1 file.txt

ahmed@the-game:~> vim file.txt

88


~
file.txt new file

i insert ) INSERT --

-- ( :

A very intelligent turtle

Found programming unix a hurdle


The system, you see,

Ran as slow as did he,

And that's not saying much for the turtle.


89

Esc )

INSERT -- ( wq:
.


:
-1 .

-2 .
vim :

k up arraw

j down arraw

l right arraw

h left arraw
:help

ctrl + ww

:q

Delete x

dw
w


90

b
dd

End

shift + $

number zero ^ shift +

) shift +

( shift +

}shift +

{ shift +
gg

page up

page down

undo

ctrl + r

:e

:split

ctrl + ww


91

:w

:q
!:q

:wq


vim :

-1 ( d + shift +

:
my name is ahmed elsayed ahmed ali . this is my last chance .
this my last escape .

my name is ahmed elsayed ahmed ali


.

-2 ( c + shift +

-3 ( y + shift +

92

-4

-5

3w

y3w
:

-1 ahmed

a ctrl + x ctrl + p

-2

ctrl + x ctrl + f

ctrl + p ctrl + n

:
ctrl + x ctrl + f

-3
ctrl + x ctrl + k

93

# : pico
. pine
. vim
file.txt :
ahmed@the-game:~> pico file.txt
-m :
ahmed@the-game:~> pico -m file.txt
file.txt
.


-v :

ahmed@the-game:~> pico -v file.txt



t- :

ahmed@the-game:~> pico -t file.txt


-x :

94

ahmed@the-game:~> pico -x file.txt


pico linux

save
file.txt file.save

: pico

up arraw

down arraw

right arraw

left arraw

ctrl + g

ctrl + x

ctrl + c
backspace Delete ctrl + d

ctrl + k

ctrl + u

ctrl + e

ctrl + a

ctrl + j
ctrl + v page down


95

ctrl + y page up

ctrl + w

ctrl + t

ctrl + r

ctrl + o

ctrl + x

# : nano
pico
.
http://www.nano-editor.org
2.0.7
pico
. nano

file.txt :

ahmed@the-game:~> nano file.txt


-m :
ahmed@the-game:~> nano -m file.txt
96

file.txt
.

-x :
ahmed@the-game:~> nano -x file.txt

-v :

ahmed@the-game:~> nano -v file.txt



t- :

ahmed@the-game:~> nano -t file.txt

# : emacs

:
-a
-b
-c
-d lisp
97

-e

-f

-g use net

-h diray calendar
-i

-j
:

-1 auto save

-2
~

emacs

http://ftp.gnu.org/pub/gnu/emacs
GNU Emacs 22.2.1 Mar-2008-26

-1 file.txt :
ahmed@the-game:~> emacs file.txt
-2 file.txt :
ahmed@the-game:~> emacs -nw file.txt
98

emacs :

emacs ctrl + h t

manual ctrl + h I
ctrl + h f
ctrl + h p
: emacs m meta
alt . Esc c . ctrl

: emacs
up arraw

down arraw

right arraw

left arraw

Delete

Alt + d

Ctrl + e

Ctrl + a

99

Ctrl + k

Page down

Page up

new file ctrl + f Ctrl + x

name

ctrl + s Ctrl + x

new file ctrl + w Ctrl + x

name

ctrl + c Ctrl + x

emacs

:
. alt +x

emacs

tab calendar

alt + x tab

emacs c cc-mode

java java-mode
alt + x . emacs

100

emacs calendar

alt + x calendar enter

goto islamic date enter

} ramadan

{
enter

1 enter

: tool bar .
emacs

alt + x

doctor enter

: emacs
.

# : xemacs
xemacs emacs
xwindows } {
101

xemacs

.
.

# :
> <
| sed
# : sed

.
: sed
-1 .
-2 . script
:
-1

: gamal :
mr. Ahmed mr. Islame mr. Hazem mr. Hassan
mr. mrs.
. lila :

ahmed@ahmed:~$ sed s/mr./mrs./g <gamal> lila


102

:
.

-2 . script
: mando :
My name is Ahmed Elsayed Ahmed Ali .
My operating system is opensuse 11 .

ahmed elsayed ahmed ali hazem

mohammed abas ismail . biso

script soma.sed :

s/Ahmed/hazem/

s/Elsayed/mohammed/
s/Ahmed/abas/
s/Ali/ismail/

: .
:
ahmed@ahmed:~$ sed -f soma.sed <mando> biso

103

# : ispell
ispell
:
ahmed@ahmed:~$ whereis linux.words
.
ispell :

noga
:

ahmed@conan:~> ispell noga




.
:

-a .

-b . a

-c r

-d

.I

104

-e *

wildcard L

enter .

-f . up arraw
-i . q

-g ? .

105


:
- a :
# :
/dev
) vga scanner pci
(.

)
. ( physical partition
:

cd rom ide ata :

primary master hda


primary slave hdb

secondary master hdc


secondary slave hdd

) primary master ( secondary master

) primary slave ( secondary slave .


sata :

: primary secondary master . slave


106

sata sda

sata sdb

sata sdc

cd rom sata :

cd rom scd1

cd rom scd2

cd rom scd3
: 2007

slackware

sdx ata sata


. hdx
:

: . primary

: extended
. logical partition

-1 primary :
sda1 .

sda2 .

sda3 .

sda4 .

-2 primary extended
107

logical :
sda1 .

sda2 .

sda3 .

sda4 . extended
sda5 logical

sda6 logical

sda7 logical .

-3 primary

extended /dev/sda2
. logical

umount .

hda1 /mnt/win-xp

linux-186f:/home/ahmed # umount /mnt/win-xp

# : fdisk

.
: fdisk
-a :

108

linux-186f:/home/ahmed # fdisk -l
: /dev/sdc -b
linux-186f:/home/ahmed # fdisk /dev/sdc
:
The number of cylinders for this disk is set to 19457.

There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)


2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help):


: fdisk m -c
Command (m for help): m
Command action

a toggle a bootable flag


b edit bsd disklabel

c toggle the dos compatibility flag


d delete a partition

l list known partition types


109

m print this menu

n add a new partition

o create a new empty DOS partition table


p print the partition table

q quit without saving changes

s create a new empty Sun disklabel


t change a partition's system id
u change display/entry units
v verify the partition table

w write table to disk and exit

)x extra functionality (experts only


Command (m for help):
: fdisk
d .

l .
n .

p .

t .
v .
m .

x ) ( .
w .

q .
110

fdisk
.


4 primary . logical

-1 -l :
linux-186f:/home/ahmed # fdisk -l
-2 fdisk )

( /dev/sdb :

conan:/home/ahmed # fdisk /dev/sdb


:
The number of cylinders for this disk is set to 19457.

There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:

)1) software that runs at boot time (e.g., old versions of LILO
2) booting and partitioning software from other OSs
)(e.g., DOS FDISK, OS/2 FDISK

Command (m for help):


111

-3 3

primary ) logical

( d :

Command (m for help): d


:
Partition number (1-6):
-4

) primary 1 extended 2
logical 5 6 (

enter .

-5 w .
-6 4 primary

extended 3 . logical
n :

Command (m for help): n


:

112

Command action
e extended

)p primary partition (1-4


p primary

Partition number (1-4):


1 primary

enter :

Partition number (1-4): 1

First cylinder (1-77545, default 1):


Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-77545, default


77545):

) (


10
+10000M

Last cylinder or +size or +sizeM or +sizeK (1-77545, default


77545): +10000M

113

http://linuxac.org/

Command (m for help):


extended n

e 2 sda2

enter
:

Command (m for help): n


Command action
e extended

)p primary partition (1-4

Partition number (1-4): 2

First cylinder (19378-77545, default 19378):


Using default value 19378

Last cylinder or +size or +sizeM or +sizeK (19378-77545,


default 77545):

Using default value 77545


logical
logical .

n l logical
enter :

114

Command (m for help): n


Command action

)l logical (5 or over

)p primary partition (1-4

First cylinder (19378-77545, default 19378):


Using default value 19378

Last cylinder or +size or +sizeM or +sizeK (19378-77545,


default 77545):

) (


15
+15000M

Last cylinder or +size or +sizeM or +sizeK (1-77545, default


77545): +15000M

Command (m for help):


w

. t
l :

115

Command (m for help): l


0 Empty

1e Hidden W95 FAT1 80 Old Minix

1 FAT12

24 NEC DOS

Solaris boot
2 XENIX root

81 Minix / old Lin bf Solaris

39 Plan 9

82 Linux swap / So c1

DRDOS/sec (FAT3 XENIX usr

3c PartitionMagic 83 Linux

DRDOS/sec (FAT4 FAT16 <32M

DRDOS/sec (FAT5 Extended


6 FAT16

42 SFS

data

7 HPFS/NTFS

84 OS/2 hidden C: c6

86 NTFS volume set da Non-FS

4d QNX4.x

CP/M / CTOS / .
Utility

40 Venix 80286

c4

41 PPC PReP Boot 85 Linux extended c7

Syrinx

8 AIX

be

87 NTFS volume set db

4e QNX4.x 2nd part 88 Linux plaintext de Dell

9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM

BootIt

a OS/2 Boot Manag 50 OnTrack DM

DOS access

b W95 FAT32

e3 DOS R/O

df

93 Amoeba

51 OnTrack DM6 Aux 94 Amoeba BBT

116

e1

c W95 FAT32 (LBA) 52 CP/M

9f BSD/OS

SpeedStor

e4

e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad

hi eb BeOS fs

f W95 Ext'd (LBA) 54 OnTrackDM6

EFI GPT

10 OPUS

(FAT-12/16/

55 EZ-Drive

a5 FreeBSD

a6 OpenBSD

11 Hidden FAT12 56 Golden Bow


Linux/PA-RISC b

12 Compaq diagnost 5c Priam Edisk


SpeedStor

14 Hidden FAT16 <3 61 SpeedStor


SpeedStor

ee

ef EFI

a7 NeXTSTEP

f0

a8 Darwin UFS
a9 NetBSD

f1
f4

16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot


f2 DOS secondary

17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs

fd

18 AST SmartSleep 65 Novell Netware b8 BSDI swap

fe

Linux raid auto


LANstep

1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard


hid ff BBT

1c Hidden W95 FAT3 75 PC/IX


Command (m for help):

117

) (
.
vfat ext3 . swap
vfat :

t enter
1 enter c

Command (m for help): t

Partition number (1-7): 1

Hex code (type L to list codes): c

))Changed system type of partition 5 to c (W95 FAT32 (LBA

extended :

t enter
2 enter f

Command (m for help): t

Partition number (1-7): 2

Hex code (type L to list codes): f

))Changed system type of partition 5 to c (W95 FAT32 (LBA


ext3 :
t enter
5 enter 83
118

Command (m for help): t

Partition number (1-7): 5

Hex code (type L to list codes): 83

Changed system type of partition 5 to c (W95 FAT32 (LBA))


: swap
enter t
82 enter 6

Command (m for help): t

Partition number (1-7): 6

Hex code (type L to list codes): 82

Changed system type of partition 5 to c (W95 FAT32 (LBA))


: q w
Command (m for help): wq

The partition table has been altered!


Calling ioctl() to re-read partition table.
WARNING: If you have created or modified any DOS 6.x

partitions, please see the fdisk manual page for additional


119

information.

Syncing disks.
.

# : cfdisk

fdisk . fdisk

.
cfdisk
:

conan:/home/ahmed # cfdisk
:

120


) right arraw ( left arraw

) up arraw ( down arraw


- b :
# : mkfs

formatting mkfs :
mkfs.msdos

mkfs.cramfs mkfs.ext3
121

mkfs

mkfs.vfat

mkfs.ntfs

mkfs.minix

mkfs.reiserfs mkfs.xfs
mkfs.ext2

mkfs.bfs

mkfs :
# ext3 . mkfs.ext3
# ext2 . mkfs.ext2
# xfs . mkfs.xfs

# reiserfs . mkfs.reiserfs
# minix . mkfs.minix
# vfat . mkfs.vfat

# ntfs . mkfs.ntfs
: mkfs
umount /dev/sda1 :

conan:/home/ahmed # umount /dev/sda1


mkfs
/dev/sda1 ext3 :

conan:/home/ahmed # mkfs.ext3 /dev/sda1


: /dev/sda5 fat32
:

122

conan:/home/ahmed # mkfs.vfat /dev/sda5

- c ) (


sda1 . sdc7

-1 : mount
.

-2 : fstab


/mnt . /media

.
. root

123

:
-1 root fdisk -l
:
conan:/home/ahmed # fdisk -l
-2 /mnt

mkdir :

conan:/home/ahmed # mkdir /mnt/movie


movie .

: . extended
logical . primary

-3 mount sda1
fat32 movie :

conan:/home/ahmed # mount -t vfat /dev/sda1 /mnt/movie


vfat sda1 movie
. sda1

: sda9 ext3
song :

conan:/home/ahmed # mount -t ext3 /dev/sda9 /mnt/song


124

:
-1 .
-2 .
-3 /etc/fstab mcedit .
: sda1 fat32
win-xp .
: fstab
vfat/

dev/sda1 /mnt/win-xp

user,users,gid=users,umask=0002,utf8=true 0 0
/dev/sda1 /mnt/win-xp
vfat

user,users,gid=users,umask=0002,utf8=true
0 0 .

: sda9 ext3

collection1 .

: fstab
1 2/

user,acl

ext3

dev/sda9 /mnt/collection1

/dev/sda9 /mnt/collection1

ext3 user,acl

125

# : df

.
-1
:
ahmed@linux-186f:~> df
:
Used Available Use% Mounted

1K-blocks

16038660 7988796 8049864 50%/


128 257316 1% /dev

257444

15709328 11437028 4272300 73%/


45664047 40898551 2445310 95%/

Filesystem
on

/ dev/sda6
udev

dev/sda7

/mnt/linux
dev/sda9

/mnt/collection1

45371559 36532190 6534044 85%/

dev/sda10

/mnt/collection2

20681568 18167264 2514304 88%/

dev/sda5

9260408 7814048 1446360 85% /mnt//

dev/sda1

/mnt/games
win-xp

-2 sda9
126

:
ahmed@linux-186f:~> df /dev/sda9
:
45664047 40898551 2445310 95%/

dev/sda9

/mnt/collection1

-3

) (
:

ahmed@linux-186f:~> df -h
:
Size Used Avail Use% Mounted on
16G 7.7G 7.7G 50%/

252M 128K 252M 1% /dev

15G 11G 4.1G 73% /mnt/linux/

44G 40G 2.4G 95% /mnt/collection1/

44G 35G 6.3G 85% /mnt/collection2/

20G 18G 2.4G 88% /mnt/games/

8.9G 7.5G 1.4G 85% /mnt/win-xp/

127

Filesystem

/ dev/sda6
udev

dev/sda7
dev/sda9

dev/sda10
dev/sda5
dev/sda1

-4

) ( 1000

) 1024 = ( 1000
:

ahmed@linux-186f:~> df -H
:
Size Used Avail Use% Mounted on
17G 8.2G 8.3G 50%/

264M 132k 264M 1% /dev

Filesystem

/ dev/sda6

17G 12G 4.4G 73% /mnt/linux/

47G 42G 2.6G 95% /mnt/collection1/

47G 38G 6.7G 85% /mnt/collection2/

22G 19G 2.6G 88% /mnt/games/

9.5G 8.1G 1.5G 85% /mnt/win-xp/

udev

dev/sda7
dev/sda9

dev/sda10
dev/sda5
dev/sda1

-5

ahmed@linux-186f:~> df -T
:
Used Available Use%
128

Filesystem Type 1K-blocks


Mounted on
/ dev/sda6
udev

xfs 16038660 7999984 8038676 50%/

tmpfs

257444

128 257316 1% /dev

dev/sda7

xfs 15709328 11437028 4272300 73%/

dev/sda9

ext3 45664047 40898551 2445310 95%/

/mnt/linux

/mnt/collection1

dev/sda10 ext3 45371559 36532190 6534044 85%/


/mnt/collection2
dev/sda5

vfat 20681568 18167264 2514304 88%/

dev/sda1

vfat

/mnt/games

/mnt/win-xp

9260408 7814048 1446360 85%/

129


:
# :
:
.
:
.

.
:

login
.

Passwd .

UID login user identification

GID

. group identification

Comment .

Home directory path .

Sell
. /bin/bash

:
130

/etc/passwd .

/etc/shadow .

name
.

Passwd .
passwd .

GID
.

User list .
:

/etc/groub .

/etc/gshadow

. suse
:

UID

# UID

UID

131

#
.

# home directory path . /home/login


# . /etc/shells
#
.

# user adminstration
:

) user adminstration ( :

( .

- a :

. )
( .

132

- 1 : groupadd
-1 friends :
linux-186f:/home/ahmed # groupadd friends
Friends GID .
-2 era GID

560 :

linux-186f:/mnt/collection1/funny # groupadd -g 560 era


: 500
500 .

-3 bomba
GID 500 :

linux-186f:/mnt/collection1/funny # groupadd -r bomba


-4 GID :

hhh hbk
GID 800 :

linux-186f:/mnt/collection1/funny # groupadd -g 800 hhh

linux-186f:/mnt/collection1/funny # groupadd -g 800 hbk -o

133

- 2 : groupmod
-1 friends 900
:
linux-186f:/mnt/collection1/funny # groupmod -g 900
friends

-2 :

era 560
friends 900 era 900

linux-186f:/mnt/collection1/funny # groupmod -g 900 era -o


:

.
-3 era tatu :

linux-186f:/mnt/collection1/funny # groupmod -n tatu era

- 3 : groupdel
tatu :
conan:/home/ahmed # groupdel tatu

134

:
.

- 4 :
: /etc/group
: colon
. root
root : x : 0 :
root x x

.16y/uvLQis/G 0 GID :
.
. video
video:x:33:ahmed,conan,remstereo
video x 33 GID
ahmed,conan,remstereo
. video

- B :
- 1 : useradd
useradd

/home
bash )
135

( users ) video ( dialout

.
. /etc/default/useradd

useradd

useradd

-1 :
linux-186f:/home/ahmed # useradd -D
-2 hima :
conan:/home/ahmed # useradd hima
hima
.

-3 jake
csh :

conan:/home/ahmed # useradd -s /bin/csh jake


-4 rock
136

ahmed elsayed

8659 :

"conan:/home/ahmed # useradd -c "ahmed elsayed","8659


rock

. finger

-5 asd


friends :

conan:/home/ahmed # useradd -g friends asd


-6 said

root
:

conan:/home/ahmed # useradd -G root said


-7 Jennifer

cdrom mail wheel :

137

conan:/home/ahmed # useradd -G cdrom,mail,wheel


Jennifer

-8 amr

users hbk www :

conan:/home/ahmed # useradd -g hbk -G www amr


:

-9 hazem

/var :

conan:/home/ahmed # useradd -d /var/hazem hazem


:
tmatm /var fofa

tch kemo 25252 :

conan:/home/ahmed # useradd -d /var/fofa -s /bin/tch -c


kimo,"tel 25252" tmatm

-10 zizo UID 865

138

linux-186f:/home/ahmed # useradd -u 865 zizo


-11 UID
-o 3 aziz

nimo kimo UID


750 :

conan:/home/ahmed # useradd -u 750 aziz

conan:/home/ahmed # useradd -u 750 nimo -o


conan:/home/ahmed # useradd -u 750 kimo -o

-12

-o yyyy-

mm-dd dd mm yyyy
.

: dido
2008-10-20 :

conan:/home/ahmed # useradd -e 2008-10-20 dido


-13

-D

: 1 /home
139

/var :
linux-186f:/home/ahmed # useradd -D -b /var
: 2 tch bash

linux-186f:/home/ahmed # useradd -D -s /bin/tch

- 2 : usermod
-1 kimo gin :
conan:/home/ahmed # usermod -l gin kimo
-2 jake csh bash :
conan:/home/ahmed # usermod -s /bin/bash jake
-3 rock

foad 5555 :

conan:/home/ahmed # usermod -c foad,"tel 5555" rock


-4 asd friends hhh

140

conan:/home/ahmed # usermod -g hhh asd


-5 said root hbk
:

conan:/home/ahmed # usermod -G hbk said


-6 hazem /var /home

conan:/home/ahmed # usermod -d /home/hazem hazem


-7 UID zizo 865 555 :
conan:/home/ahmed # usermod -u 555 zizo
-8 dido 20-10-2008

28-8-2008 :

conan:/home/ahmed # usermod -e 2008-8-28 dido


-9 amr
-L L :

conan:/home/ahmed # usermod -L amr

141

: -L !
. shadow

-10 amr

-U U :

conan:/home/ahmed # usermod -U amr

- 3 : usermod
-1 amr
:
conan:/home/ahmed # userdel amr
:
no crontab for amr
-2 fofa
:

conan:/home/ahmed # userdel -r fofa


:
no crontab for fofa
142

- 4 :
-1 : /etc/passwd

. .
: colon

remstereo:x:1002:100:remstereo:/home/remstereo:/bin/bas
h

remstereo
x UID 1002 GID 100

remstereo
/home/remstereo

. /bin/bash

: super user -1 UID GID


.0

: special user -2 rpm ftp ip cdrom

ftp server
ftp .

: regular user -3

. root

143

-2 : /etc/shadow

.

: colon

remstereo:2a$05$zn4uZeg:14089:0:99999:7:::
remstereo

2a$05$zn4uZeg
standard 14089 standard

99999 standard
99999

7 99999
7

account expire

special flag
.

144

: :

>!!< .

>*< system
account special user .
2a$05$zn4uZeg .

disable : /etc/shadow

3 8 .


remstereo:2a$05$zn4uZeg:14089:0:99999:7:::

remstereo:2a$05$zn4uZeg:14089:0:99999:7::14088:
: 7

> <0 > <1- :

> <0 disable .


> <1- disable .

145

/etc/group
/etc/gshadow
. gshadow

/etc/passwd
/etc/shadow

-a group :

-1 gshadow group :
linux-r58p:/home/ahmed # grpunconv
gshadow group
gshadow . group

-2 gshadow

linux-r58p:/home/ahmed # grpconv

146

gshadow .

-b passwd :

-1 shadow passwd :

linux-r58p:/home/ahmed # pwunconv

shadow
passwd shadow . passwd
-2 shadow

linux-r58p:/home/ahmed # pwconv
shadow
passwd . shadow
:


newgrp

-1 amr

) friends family ( engineering


engineering friends :

147

amr@conan:/home/ahmed> newgrp friends


-2 amr

engineering :

amr@conan:/home/ahmed> exit

amr@conan:/home/ahmed> newgrp

. amr engineering
friends ) (

amr friends friends


. engineering

id . groups

# : id
) UID
( GID
.
-1 id

ahmed :
148

ahmed@conan:~> id
:
)uid=1000(ahmed) gid=100(users

)groups=100(users),16(dialout),33(video
-2 remstereo :
ahmed@conan:~> id remstereo
:
)uid=1002(remstereo) gid=100(users

)groups=100(users),16(dialout),33(video
-3 GID remstereo

ahmed@conan:~> id -g remstereo
:
100

149

-4 GID
remstereo :

ahmed@conan:~> id -G remstereo
:
100 16 33
-5 UID remstereo :
ahmed@conan:~> id -u remstereo
:
1002

# : groups

.
-1 groups

ahmed
:

150

ahmed@linux-r58p:~> groups
:
users dialout video
-2 remstereo
:

ahmed@conan:~> groups remstereo


:
remstereo : users dialout video

# : gpasswd

.


newgrp
.
:
.

151

-1 family :
linux-r58p:/home/ahmed # gpasswd family
:
Changing the password for group family.
New Password:

Re-enter new password:


Password changed.

-2 family :
linux-r58p:/home/ahmed # gpasswd -r family
-3 ) family

(
:

linux-r58p:/home/ahmed # gpasswd -l family


-4 family :

152

linux-r58p:/home/ahmed # gpasswd -u family


-5 friends :
linux-r58p:/home/ahmed # gpasswd -r friends

# : passwd
-1 remstereo :
linux-r58p:/home/ahmed # passwd remstereo
:
Changing password for remstereo.
New Password:

Reenter New Password:


Password changed.

remstereo

remstereo@linux-r58p:/home/ahmed> passwd
153

:
Changing password for remstereo.
Old Password:

New Password:

Reenter New Password:


Password changed.

remstereo
.

-2 family :
linux-r58p:/home/ahmed # passwd -g family
:
Changing the password for group family.
New Password:

Re-enter new password:


Password changed.

154

-3 shell remstereo bash


tcsh :

linux-r58p:/home/ahmed # passwd -s remstereo


:
linux-r58p:/home/ahmed # passwd -s remstereo
Changing login shell for remstereo.

Enter the new value, or press return for the default.


Login Shell [/bin/bash]:

colon : /bin/tcsh :
Changing login shell for remstereo.

Enter the new value, or press return for the default.


Login Shell [/bin/bash]: /bin/tcsh

Shell changed.

/etc/shells

:
remstereo tcsh bash

155

linux-r58p /home/ahmed> passwd -s


:
Changing login shell for remstereo.
Password:

Enter the new value, or press return for the default.


Login Shell [/bin/tcsh]: /bin/bash

Shell changed.

remstereo
.

-4 remstereo :
linux-r58p:/home/ahmed # passwd -l remstereo
-5 remstereo :
linux-r58p:/home/ahmed # passwd -u remstereo
-6 remstereo :
linux-r58p:/home/ahmed # passwd -d remstereo
-7 remstereo
156

:
linux-r58p:/home/ahmed # passwd -e remstereo
remstereo

ahmed@linux-r58p:~> su remstereo
Password:

Password change requested. Choose a new password.


Old Password:

New Password:

Reenter New Password:


Password changed.

-8 remstereo

-S :

linux-r58p:/home/ahmed # passwd -S remstereo


:
remstereo NP 08/05/2008 0 99999 7 -1
:
ahmed :
157

ahmed@linux-r58p:~> passwd -S
:
ahmed PS 08/04/2008 0 99999 7 -1
login remstereo

) LK NP ( PS :

LK

. passwd -l

NP

. passwd -d

PS

08/04/2008

99999 standard
99999

7 99999

. 1-

-9

158

linux-r58p:/home/ahmed # passwd -aS

# : permission
:

3 :
read

write

execute

.
) ( user , group , other :

: user

: group

: other

) ( user , group , other


) ( read , write , execute .

159

ls -l
:

ahmed@linux-r58p:~> ls -l
:
total 1675076

drwxrwxrwx 2 ahmed users

6 2008-08-08 23:05 aa

-rwxrwxrwx 1 ahmed users

910 2008-05-31 13:38

antiNetCut-linux.py


. d

:
-a

-b

-a :

:
r read

160

w write

x execute
:

rwxr-x---

r-x------

rwxr--r- .

-b :

:
read 4

write 2

execute 1

:
rw- 6

r-x 5

-wx 3

rwx 7
:

rwx------ = 700
rw------- = 600

-wx------ = 300
161

rw-rw-rw- = 666

rwxrwxrwx = 777
r-xr-xr-x = 555

: 7
. 6

# :

.
:

-1

-2 6 6 .

-3

r w
x r+w

r , w , x , r+w , r+x , w+x

r1 , w1 , x1 , r+w1 , r+x1 , w+x1

-4

162

: :

r1

w1

x1

0 r+w1

1 w+x1

r+x1

0 ) (
2

1 cd

. ls
:

: r


ls

163

: x


. cd

: r+x


: w


: w+x

: :

r+w

164

r+x

w+x

0 ) (
2

1 :
cat >> filename
:

: r

: w


: r+x


165

# : chmod


-a :

-1 era

ahmed@linux-r58p:~> chmod 754 era


-2

dido

ahmed@linux-r58p:~> chmod -R 770 full


-b :

) ( user , group , other


166

.
:
u user

g group

o other

a ) ( user , group , other

-1 soca
:

ahmed@linux-r58p:~> chmod u+rwx soca

ahmed@linux-r58p:~> chmod u=rwx soca


-2 soca

ahmed@linux-r58p:~> chmod g+rx soca

ahmed@linux-r58p:~> chmod g=rx soca

-3 soca
167

:
ahmed@linux-r58p:~> chmod o+rx soca

ahmed@linux-r58p:~> chmod o=rx soca

-4 noga

ahmed@linux-r58p:~> chmod a+rx noga

ahmed@linux-r58p:~> chmod a=rx noga

-5 noga

ahmed@linux-r58p:~> chmod o-rx noga

# : chown

.
-1 hima amr

168

conan:/home/ahmed # chown amr hima


-2 miro conan

family :

conan:/home/ahmed # chown conan:family miro


:
conan . family

-3

dido amr

conan:/home/ahmed # chown -R amr dido


-4

dido conan
family :

conan:/home/ahmed # chown -R conan:family dido

# : chgrp
169

.
-1 bibo

family :

conan:/home/ahmed # chgrp family bibo


-2

zizo family :

conan:/home/ahmed # chgrp -R family zizo

:
adel :
-1 useradd :
conan:/home/ahmed # useradd adel
-2 passwd :
conan:/home/ahmed # passwd adel
:
Changing password for adel.
170

New Password:

Bad password: a palindrome


Reenter New Password:
Password changed.

-3 adel :
conan:/home/ahmed # mkdir /home/adel
-4 adel

root adel :

conan:/home/ahmed # chown -R adel /home/adel

-5 /etc/passwd mcedit :
conan:/home/ahmed # mcedit /etc/passwd
-6 :
adel:x:1006:100::/home/adel:/bin/bash

171

/bin/bash
/bin/bash

172

:

.

12 1429 13 2008
02:20 .


.
: /
:
:
:
:
remstereo555@yahoo.com
remstereo@gmail.com
remstereo
173

You might also like