Académique Documents
Professionnel Documents
Culture Documents
COM
:
: Techno-tux
-1-
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
.
$ . # .
:
[alan@memphis home]$
. .
.
.
.
:
Terminal Konsole .
run xterm .
$ # . Ebter
.
.
.
) . !(
.
:
$ id
)uid=500(Alan) gid=500(Alan) groups=500(Alan
Alan Alan
.
who .
:
$ who
Alan :0 Apr 23 08:46
-2-
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
Konsole KDE
.
.
.
.
. :
$ pwd
/usr/bin
usr/bin . :
$ echo $HOME
/home/Alan
.
:
$ cd
.
. ls .
-3-
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
. ls
. a l
. .
:
$ ls -la /home/Alan
total 46740
drwx------ 47 Alan Alan 4096 Apr 23 11:09 .
drwxr-xr-x 8 root root 4096 Mar 12 17:51 ..
-rw------- 1 Alan Alan 616581 Apr 18 23:29 779-red_hat_linux_9.tar.gz
drwxr-xr-x 2 Alan Alan 4096 Mar 20 11:15 .acrobat
drwx------ 2 Alan Alan 4096 Mar 20 11:15 .adobe
drwx------ 2 Alan Alan 4096 Mar 12 17:04 .adonthell
drwxr-xr-x 2 Alan Alan 4096 Feb 14 13:19 .anjuta
-rw------- 1 Alan Alan 18325 Apr 23 00:36 .bash_history
-rw-r--r-- 1 Alan Alan 24 Aug 24 2002 .bash_logout
-rw-r--r-- 1 Alan Alan 191 Aug 24 2002 .bash_profile
l
. ) (. ) (.. .
home/Alan /home .
.
.
) . (multitasking
. .
.
ps .
.
:
$ ps au
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
Alan 1152 0.0 0.5 4476 1348 pts/0 S 17:39 0:00 bash
Alan 1831 0.0 0.2 2580 664 pts/0 R 18:14 0:00 ps au
-4-
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
a u
. .
.
. .
. Alan bash ps
. TTY
STAT R . S
.
USER .
) (Process ID . kill .
CPU% MEM% . VSZ Virtual
Set Size image RSS Resident Set Size
. START TIME
.
.
.
.
. :
$ ps aux | less
| less
. ) (pipe
.
Ctrl+D
. logout exit .
.
. usr/bin bin .
usr/sbin sbin .
.
.
) (Command Shell .
.
.
.
.
bash . Bourne Again Shell.
bash sh Bourne Shell
.
csh C Shell BSD ksh Korn Shell Unix
System V . tcsh ash .
-5-
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
.
manual .
: manual
:
>$ man <command
bash sh .
. :
) : (Options . la- ls l
a .
- --
. . ls --help
) :(Arguments . . ls -la /home home
ls .
) :(Variables Environment . . SHELL SP1
MAIL :
$ echo $SHELL
/bin/bash
$ echo $MAIL
/var/spool/mail/Alan
$ .
: declare
. echo
.
) :(Metacharacters .
. .
. .
-6-
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
.
.
bash .
bash .
bash . man bash
bash .
.
: date
$ /bin/date
.
.
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/Alan/bin
.
.
usr/bin bin usr/local/bin .
usr/bin/X11 usr/X11R6/bin .
.
:
bin
.
.
sbin usr/sbin
.
.
. foo usr/bin bin
. foo .
.
.
.
. .
:
: alias .
: . case while do .
- : .
-7-
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
: . : . PATH .
: bash
help .
info .
type . :
$type bash
bash is /bin/bash
case which ... .
a type .
: "
" " " .
PATH
. .
.
.
!
.
) (History .
.
. . Ctrl+a
Ctrl+E . Home End .
.
Enter .
. .
tab .
:
: tab .
-8-
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
: ~ .
: .
: @ etc/hosts .
.
P . Tab ?+Esc
:
>?$ echo $P<tab><tab> or <Esc+
$PATH $PPID $PS1 $PS4
$PIPESTATUS $PROMPT_COMMAND $PS2 $PWD
. history .
:
$ history 5
1023 ls
1024 cd Fonts/
1025 man more
1026 date
1027 history 5
:
: . Ctrl+n Ctrl+p .
:Ctrl+r . .
:Ctrl+s . fc .
.
:
$ fc 100 150
bash_history.
.
-9-
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
.
.
)(Piping Commands
)|( . . :
$ cat /etc/passwd | sort | more
adm:x:3:4:adm:/var/adm:/sbin/nologin
Alan:x:500:500:Alan Bachumian,7852020:/home/Alan:/bin/bash
apache:x:48:48:Apache:/var/www:/sbin/nologin
bin:x:1:1:bin:/bin:/sbin/nologin
Linet:x:501:501:Linet Minasian:/home/Linet:/bin/bash
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
--More- etc/passwd sort .
more
.
. .
:
. :
.
. );( . :
$ date; troff -me mytext | lpr; ls /home
- 10 -
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
.
. )&(
. :
& $ troff -me mytext
.
. :
'$(sommand) or 'command
:
)$ vi $(find / -print | grep xyzzy
vi . find
. grep
xyzzy . vi xyzzy .
.
:
))$[expression] or $((expression
:
$ echo Iam $[2003-1978] years old.
Iam 25 years old.
echo .
.
:
$ ls -l $BASH
-rwxr-xr-x 1 root root 626188 Aug 24 2002 /bin/bash
- 11 -
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
ls BASH . .
. .
declare .
:
$ echo $USER
Alan
.
.
:
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
: BASH . . bin/bash
: BASH_VERSION .
: EUID .
.
: HISTFILE .
: HISTFILESIZE . .
: HISTCMD .
: HOME .
: HOSTTYPE .
: MAIL .
var/spool/mail/ .
: OLDPWD .
: OSTYPE . linux-gnu .
: PATH .
.
: PPID .
: PROMPT_COMMAND
.
: PS1 .
...
PS2 PS3 .
.
: PWD .
: RANDOM .
: SECONDS .
: UID . etc/passwd
.
.
.
:
$ AB=/usr/locl/documents; export AB
- 12 -
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
AB . export
. .
:
. .
. xyz XYZ
.
.
. .
. :
$ echo ${HOME}/Documents
/home/Alan/Documents
export
. export . :
$ export XYZ=/home/Alan/Documents
:
$ export PATH=$PATH:/home/Alan/Documents
home/Alan/Documents PATH .
unset :
$ unset XYZ
.
.
.
.
.
.
)&( . at
.
- 13 -
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
Ctrl+z .
fg bg
.
)&( . :
& $ find /usr -print > /home/Alan/usrfiles
usr usrfiles .
.
jobs :
$ jobs
[1]- Stopped mc
[2]+ Stopped vi
& [3] Running find /usr -print >usrfiles
vi mc find .
.
. find .
: l jobs
. ps
.
vi :
$ fg %2
vi . Ctrl+z
.
:
.
.
jobs
.
. .
:
- 14 -
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
$ jobs
[2] Stopped vi
[3]- Stopped mc
[4]+ Stopped vi ./mytext
$ fg %?my
fg %?my vi mytext .
.
.
.
.
:
o
o
o
o
: etc/profile .
.
.
.
: etc/bashrc bash .
. bashrc
.
: ~/.bashrc bash .
.
.
: ~/.bash_profile
. . .
bashrc .
: ~/.bash_logout .
.
etc/profile etc/bashrc .
bashrc bash_profile bash_logout .
. bashrc
.
.
. PS1 .
PS3 PS2 PS4 .
- 15 -
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
:
.
) ($ ) (# .
:
[alan@Memphis alan]$
.
. :
!\ : .
: \# .
: \$ .
: \W .
\\ : .
: \d . Sat Jan :
: \h .
: \n .
: \s . bash
: \t . :: :
: \u .
: \w .
:
PS1 . :
]export PS1=[\t\w]\$
:
[20:25:40 /var/spool/mail]$
PS1 bashrc .
.
.
alias . :
'$ alias p='pwd; ls -CF
'$ alias rm='rm -i
p pwd ls -CF
. rm i .
alias .
.
- 16 -
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
.
. .
.
.
. home dev bin . tmp
. .
.
:
. A C ...
.
mnt/floppy ...
.
.
.
. txt ...
.
.
.
.
NT
.
- 17 -
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
. :
: cd
.
: pwd .
: mkdir .
: chmod .
: ls . dir .
.
.
. cd .
. pwd :
$ pwd
/home/alan
. mkdir test :
$ mkdir test
. ls :
$ ls -ld test
drwxrwxr-x 3 alan alan 4096 May 17 20:14 test
test alan alan
: .
. .
. :
$ chmod 700 test
. ls
------ drwx .
. cd test :
$ cd test
:
HOME
~
- 18 -
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
~$
/home/alan
:
$ ~chris
/home/chris
:
: . :
$ cp /usr/local/mygame .
mygame ) ( .
: . :
$ mv mygame ..
mygame ) (home .
: OLDPWD .
.
.
. :
)*( : .
)?( : .
)] : ([... .
) test (
:
$ touch apple banana grape grapefruit watermelon
ls . :
*$ ls a
apple
- 19 -
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
*$ ls g
grape
grapefruit
$ ls g*t
grapefruit
*$ ls *e
apple grape grapefruit watermelon
*$ ls *n
banana watermelon
a . g
. g t
e n .
:
$ ls ????e
apple grape
*$ ls g???e
grape grapefruit
e . g
e .
:
*]$ ls [abw
allpe banana watermelon
]$ ls [agw]*[ne
apple grape watermelon
b a w . g a
w n e .
- 20 -
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
.
.
)<( )>( / . :
< : .
> :
.
>> :
.
:
$ mail root < ~/.bashrc
$ nroff -man /usr/share/man/man1/chmod.1* > /tmp/chmod
$ echo I finished the project on $(date) >> ~/projects
bashrc. root
. chmod nroff
tmp/chmod . projects
:
I finished the project on Sun May 25 14:25:36 IRST 2003
)(File Permissions
Permission Denied .
.
. rwxrwxrwx
. .
r . w x .
) (- .
ls -ld . :
$ ls -ld ch3 test
-rw-rw-r-- 3 alan alan 4096 May 22 15:11 ch3
drwxr-xr-x 3 alan alan 4096 May 17 20:14 test
.
.
. . d .
.
. .
.
.
chmod . .
. .
) .(++ . ) ( )
!( . :
$ chmod 777 files = rwxrwxrwx
- 21 -
Ramin.samad@yahoo.com
WWW.IRANMEET.COM
: R chmod
.
.
tmp/test :
$ chmod -R 777 /tmp/test
: R chmod
.
.
. mv .
cp rm . :
$ mv abc def
~ $ mv abc
$ cp abc def
~ $ cp abc
$ rm abc
* $ rm
abc def . )~( .
abc def .
abc .
: rm alias
.
.
- 22 -
Ramin.samad@yahoo.com