Académique Documents
Professionnel Documents
Culture Documents
%
- 2
$ 3!
$ application
(Ctrl-Z)
[1]+ Stopped
application
$ bg
[1]+ application &
$
bunzip2 4!
.bz2
bzip2
al
cal 5 2003
-n
!
"
-v
! #
0 $ &
cat entete.txt corps.txt signature.txt
mail.txt
cat
propos
apropos shell
arch
at, atq, atrm
!
" #
$ %
#!
!
-f
&!
$ at now + 10 minutes < script.sh
$ at 20:55 -f demarre_magnetoscope.sh
awk '
!
()
NF
$
FS !
NR
!
*
+
$1, $2...$NF
ls -l | awk '{somme+= $5} END{print
somme}'
!
asename ,
!.
$ basename /usr/src/linux/signal.c
signal.c
$ basename /usr/src/linux/signal.c .c
signal
$
bash
/
batch
$
!! .
0batch << FIN
tri_des_enregistrements
FIN
bc
!
$
-l $$
-&
! &
$ pi=$(echo "a(1)*4" | bc -l)
$ echo $pi
3.14159265358979323844
$
cc
cd
!
.
cd /usr/src/linux
cd
.
!
!!
cd
.
!
chgrp
!
-R
!
.
2!
chgrp equipe_2 fichier
chmod
-R
!
.
2!
chmod 644 texte
"!
!
chmod 755 script
#!
"!
!
chmod u+s executable
.
$
25'4
chown
!
-R
!
.
2!
chown user1.equipe1 fichier
chsh
!%
#
-l
$ "
-s
#
&!
chsh -s /bin/ksh
cksum 6 $
7
clear
!
cmp
#
-l
&
! "
-s 8
"
. .
#
if cmp s fichier1 fichier2; then ...
col ,
2 2
-b -.
man col | col -b > col.man.txt
compress
cp
-R
!
.
2!
"
-p
"
! "
"
-d
0 $ &
&
cp fichier fichier.sauve
cp -Rdp fichier_* /autre/repertoire
crontab ,
crontab
-l
"
-e !
crontab"
-r
crontab
csh
csplit 4!
.
#
-f ! #
. #
csplit -f prefixe fichier '/^$/' {*}
! prefixe00 prefixe01
!
&
.
cut
&
-b
& !"
-f
& !"
-d
- !
ls -l | cut -b 20-28
&
% 9"
2%2
ate
0-d
&
%
+
:
date +"Date = %D, Heure = %X"
date -d 20030401 +"%A"
;
;*< .
=+
dd
!! &
.
if=
!"
of=
"
bs=
$
%
"
count=
$
#
$
%
"
skip=
!$
"
seek=
!$ !
dd if=/dev/fd0 of=disquette.img bs=1024
count=1440
df >
!
0-k
) 2
"
-P
23
df k /tmp/sauvegarde
diff ?
.
!
-i
!
@
"
-b
!
8
$
"
-u
$ . patch"
-r !
!
.
2!
diff -u original copie > modifs.patch
dirname
!
$ dirname /usr/src/linux/signal.c
/usr/src/linux
$
dos2unix
.
#
4 . 5 #
&
&
du
-a
&
"
-s
"
-x
2!
0"
-k
) 2
cho
-
#
0 $ &
"
2 2
"Message d'avertissement" >&2
-n "Votre choix :"
-e "\r effectu : " $i "%"
e "\007"
2%2
egrep 0 0
grep -E
emacs ,
/
A
B2C
( Dxemacs
env
.
.
!
-i 4!
.
.
env
.
env -i /bin/sh
!
.
expand
.
$
-t
$
! !"
-i
&
$
!$
expand i < script.sh > listing.txt
export >
. $
8 .
export REP_APPLI=/usr/local/lib/appli/
VERSION_APPLI=1.5
export VERSION_APPLI
expr ,.
#
expr 4 "*" 3 + 2 affiche 14
*
!
+
-e
-n !.
echo
echo
echo
echo
ed ,
alse ,
until false; do ...
fc ,
8
& . 8!
. $ 8 .
FCEDIT
fg 1 $% 8. 2
fgrep 0 0
grep -F
file
0 8
find 1
$
-name motif
"
-regex expr
"
-atime n
- 0
"
-ctime n
!
"
-mtime n
"
-perm mode
"
-size n
* $ +"
-type t 0
"
-print
.! "
-exec ...\{\} \; #!
&!
\{\}
"
-ok ...\{\}\; exec .
find /tmp -ctime +30 -ok rm \{\} \;
find /home -name core -exec rm \{\} \;
fold
8
%
!
ftp ?
fuser '
-k
.
'/F' "
-i
.
.0
"
-m
!
0fuser -k /mnt/cdrom
rep
%
-E
#
!
-F
:
#
"
-i
!
@
"
-v
"
-l
grep -i "MoTiF" fichiers_*
grep -v "absent" fichier
groups
8
gunzip 4!
.gz
gzip
ead
!$
"
-c n
-n n
hostid
hostname
iconv
.
"
d
5'4
/'4
!
-u
5'4"
-g
/'4"
-r
!
if [ $(id -u) == 0 ]; then...
obs
join G
#
!
join fichier_1 fichier_2 > fichier_3
ill .
%
-numro
-l
kill -9 30582
killall .
-i
-l
killall xterm
ksh
F
ess
*
lex /! !
ln !
. $
8
!
#
& !"
$
#
.
#
3
"
$
2 2
% more +
#
-f
!
# "
-s !
0 $ &
ln -sf appli-1.4.sh appli
logger H
0#
0login 1
logname 6
#
lp 1 & 3 8
-d !
8
-n
$
pr -l 66 appli.c | lp -d listing
ls
8!
!
-a
E
"
-d
!
"
"
-i
!
2 I "
-l
"
-R
!
.
2!
ls -al /home/usera
ls -lR /var/ftp/pub > /var/ftp/listefichiers.txt
#
8
- .
iconv f LATIN1 t UTF8 < fichier
@@((( $
nohup
#
!!
#
$ nohup ~/bin/calcul &
[1] 17300
$ exit
ake
man
numro
-a
-t
%
-k $
&
!!
man 1 c
man -k socket
" #
$
apropos
md5sum
mkdir
'
( )*
-p
!
-m mode #
+ ,
mkdir -p /var/lib/new-app/font/big
mkfifo
-.-/ 0 1
!! 2
-m mode #
+ ,
mkfifo -m 666 /tmp/fifo_serveur
mknod
#
b
c
1
,
mknod /dev/hda1 b 3 1
!
! 3 4!
546
more
0 less2
mv )
!!
-f
+
!
for i in *.JPG; do mv $i ${i%JPG}jpg;
done
!!
7%8
3
ice
!
-n valeur
nl 9 !
-f a !
!!
!
!
+
d
!
-c
-x
asswd
!
#
+
! 1
! #
= ,!
+
rev .
rlogin
!!
= ,!
ssh2
cript
rmdir
rsh #
0
$ passwd
# passwd utilisateur
patch
$
!
&
-pn
,
1
!
$ patch p1 ../new_version/patch_1
pathchk :
+
!
-p
1
if pathchk "$rep/$fic" ; then...
perl .
%
-w !
ping ;
!
-c !1
-w
! #!
pr %
#
+!
-h texte
$ +'<
$
-l n
-t
!
'<
printf
! $
!
printf "%05d %4.2f" $x $y
ps
+
-ax
0 )2
-u
!
! , 0 )2
-e
0 = :2
-f
!
! , 0 = :2
-w
ps -aux
(BSD)
ps -ef
(SysV)
pwd
!
uota
cp
>
renice (
rm
-f
!
-i
!
$
-r
!
'
rm -rf /home/usera/tmp
+
,
tac2
'a fic 3
sed ?
'
-e "..." !!
-f fic !!
-n
! +
!!
@
p
d
n
&
s
!
!
sed -ne '1,/^$/p' < mail.txt
#
+'< + !
sh
sleep
!
sleep 14
06
2
sleep 3m
05!
2
sort ;
+
#
-b
1
1
-f
! 3
4!
-r
split )
-l n
-b n
split -b 1440k gros_fichier disquette_
ssh
#
= ,!
ssh user@hostname
ssh l user hostname /usr/bin/commande
strings
>
stty
!
-a
sane
!
-echo
+
,
-icanon min 0 time 1
, &
su #
".)
8.)
- #
sum
ac
tail
!!
!1
1
&+
tee
-a 3
!
...| tee hublot_1.log | ...
telnet
#
= ,!
0
ssh2
test ;= +
!
= =!
!!
[...]
if test f $fichier ; then
time
!
!!
!
touch (
+
+
-t MMJJhhmm
$
-r fichier
+
tr ;
!
,
tr aaaceeeiioouu|...
true C
&
while true; do ...
tty
!
!
+
!
= ,!
-m =
!
-n
! +A
-r
= ,!
-s = ,! +#
-a
!
uncompress ) !
unexpand
0
expand2
-u +
-d +
-c
+
-num
!1
$
-f
!
tail -f /var/log/messages
tar "
+
-f fic
!
+
-c
-t
+
-x #
+
-z
$ 8
B
0 2 !
-j
$ 1B
0 2 !
-v !
1
tar -czf save.tar.gz /home/usera/*
tar -xzf appli-1.10.tgz
tcl .
; 0
wish2
name
uniq D
$
$
$
$
!1
unix2dos
unzip ) !
uptime ; !
users 9 !
uudecode )
uuencode
i?
:
E'F
! " #
! )
.zip
!
= ,!
.uu
1
alpha
,
digit
xdigit
alnum
,
lower !
upper ! 3
blank
,
space
,
punct
graph =!1
print =!1
cntrl
,
+
$ ./commande &
[1] 2927
./commande
$ wait 2927
[1]+ Done
./commande
$
wc 9 !1
, !
+
whereis C
#
1
!
+
!!
which
!
+ ,
!!
who (
$
whoami
".)
wish .
;
11
,$ ;H
#
!!
find . -name "*.c" | xargs grep "init()"
=
= #$
>
0
Iy 2
yes | rm -r /var/old-backup/
cat
zip !
Expressions rationnelles
1 $
! #
#
! #
! $
1
1
1
A
|
Y|y
+
!
?
! B
[+-]?[[:digit:]]+
{ }
!
!1
( )
!
\|
\+
\?
\{ \}
\( \)
lments communs
\
!
prix=25\$
>
>
args
Classes de caractres
G @ gvim
ait
acc 8
yes
. !
!
g.n.rique
J
1
K
^$
0
2
*
$ B
[ ]
[e]
[0-9]
[[:upper:]]
,!
\i
|
+
?
#
#
#
#{}
#()
#
#
44GGG 1
fdisk
tar
! &!
fdisk /dev/hda
mkswap
Ce document rappelle les commandes et les
options les plus utilises par ladministrateur dun
systme Linux. Il sagit surtout de commandes
assez gnrales, dont tout administrateur aura
besoin un jour ou lautre. Les commandes pour
lutilisateur courant se trouvent dans un autre
aide-mmoire. Pour
plus dinformations, on
consultera les pages de manuel ou les
publications du Linux Documentation Project
(http://www.tldp.org/)
swapon
"
#
( )
&
'
#
! )
!+ !
() !
!
! )
-
.
-
.!
#
! &&!
0
1
2 !
!2 !
!2 !
)
3
% 3
#
/ 3
Utilisateurs
4
/etc/fstab
userdel
userdel r linus
!
!
"
passwd linus
!
)
swapoff /dev/hda2
mkfs
mkfs.ext2 /dev/hda3
mkfs.ext3 /dev/hda4
mkfs.vfat /dev/hda5
.)
%3 % 3 %93
()
rpm >
30 3
@AA 3
&
# +
-a )
!
umount /dev/hda4
umount /mnt/dos
umount a
df
umount
installation classique
passwd
mount
useradd
fsck.ext2 p /dev/hda3
)
/ +
% 8 %93
fsck.vfat /dev/hda4
0)
+
:
7
uname
0
1
3
5
6
swapoff ()
Informations systme
dmesg
uptime
free *
vmstat
ipcs ,
ipcrm
ldconfig
init
swapon /dev/hda2
-a
0
! 6
fsck
-a
mkswap /dev/hda2
mkswap /boot/swap_file
>
-c
)
+
03
-x %
+
03
-t
!
+
03
-f
03
-v
0 !&!3
-z $ )'
0 #$ '6 3
-j $ )'
0 &$ '6
tar czf archive.tar.gz distrib/
)
0
)
)
distrib/3
tar tvf archive.tar
! !
!+
03
tar xjf archive.tar.bz2
%
!
+
0
)
/etc/mtab
# B C
-h
#
!
#
0 !
rpm ivh paquet.rpm
!!
+
/ #3
rpm Uvh paquet.rpm
D4 8
!!
+
/ #3
rpm Fvh paquet.rpm
D4
+
/ # )4D
!!)3
rpm e paquet
)
!!
+
/ #3
rpm qa
!
!
/ #
!!
)3
rpm qf /chemin/fichier
/ # / !
!
rpm qip paquet.rpm
/ #3
rpm qlp paquet.rpm
!
! / #
apt
>
# (&
!! 3
!! 3
netstat
ps
arp
top
!
F
renice
# !
0
?
E GHI
)3
&!
fuser
D
/)
>
+)
B-3
!
+K
/)
lsmod
modinfo
insmod
K
3
4
%
!!
) +
! &!
open
cd 8
lcd 8
get
put
prompt
mget L
mput L
wget
0
8
modprobe
3
3
#)
!
!)
#)
.)
)
#
#)
modprobe module.o
'
!!
depmod an
8
8! !8
rmmod
depmod
? -8 +
)
#
0
)
rmmod module
K
)
insmod module.o
K
traceroute www.destination.com
-n
)
!
)/
tcpdump
!!
ifconfig -a
!
#
!
ifconfig eth0 192.1.1.50
# !
socklist
! &! B-
rsh
%)
ssh
%)
ftp ?
Utilitaires rseau
route
4
route
4
route
4
route
>
fuser k m /dev/hda5
!
)
D!
route
telnet
killall 9 boucle_fork
ifconfig
tcpdump i eth0
/
!
eth03
tcpdump i eth0 port telnet
!
#
80 !
9$
# !D
kill 15 12857
-l $!
!' !
#
killall
)
a
traceroute
renice +5 12857
#
!
renice 5 u root
H!
0
# !0)
! )
1 $SIGHUP'
% 3
2 $SIGINT3
!2 '
)
3 $SIGQUIT3
!2M'
)
9 $SIGKILL'
&!#
15 $SIGTERM'
!
ping c 1 w 2 192.1.1.53
! /1
!
ping b 192.1.1.255
/1
)
&
D
!
-d )!
ping
ps aux
# ! #
r
&!
i
-a
!
arp d hote
!
)
ps ef
kill
netstat
!
netstat
!+)
netstat
!+)
,B
wget http://www.site.com/repertoire/
-c
)4D
)3
-r
# )
0
! ! 3
-l niveau
% ! )
3
-k
0
! !
! %
'
'
make $
A'
- 3
make modules && make modules_install
cp System.map /boot/System.map-XXXX
cd arch/i386/boot/
cp bzImage /boot/vmlinuz-XXXX
vi /etc/lilo.conf
4
!+ )
!
0
3
/sbin/lilo
/sbin/init 6
!
88777 &!
#8
Fonctions
"$var1 $var2"
(
#
'$var1 $var2'
(
\$var
'
'
*
*
$ &
"
"
"
"
"
fonction_1 ()
{
commandes
}
!
fonction_1 valeur_1 valeur_2...
.
$1# $2/
"%
$#!
local variable
%
return valeur
"
0
+#
""
+!
Structures de contrle
valuation des expressions
Boucles
variable=valeur
tableau[rang]=valeur
!
${variable}
"
${tableau[rang]}
"
${variable-valeur}
"
${variable=valeur}
#
#
#
#
${variable?valeur}
!
${#variable}
"
#
${variable#motif}
"
$
#
${variable%motif}
"
$
#
${variable##motif} ${variable%%motif}
$
$
% !
~utilisateur/
"
#
ab{c,d,e}fg
abcfg abdfg abefg
$(commande)
"
#
$((expression))
"
" &
'
!
while cmd_1 ; do
commandes
done
, '
&
until cmd_1 ; do
commandes
done
, '
&
for variable in liste ; do
commandes
done
, '
"
"
!
break
"
%
for# while
continue
%
!
* +!
"
&
'
*"1"
+#
?
"
\*
&
' #
\?
\\
' *# ?# \#
[liste]
' l# i# s# t# e
[b-e]
' b# c# d# e
[^liste]
2 "
&
'
$!
until!
Redirections
commande < fichier
if cmd_1 ; then
cmd_2
elif cmd_3 ; then
cmd_4
else
cmd_5
fi
$
!
# $
#
$
!
case expression in
motif_1 ) cmd_1 ;;
motif_2 | motif_3 ) cmd_2 ;;
* ) cmd_3 ;;
esac
# $
# $
!
Motifs du shell
Tests
"
#
#
#
commande > fichier
#
commande >> fichier
3
commande 2> fichier
#
commande 2>> fichier
3
commande 2>&1
& commande <<- ETIQUETTE
lignes envoyer
vers lentre standard
de la commande
ETIQUETTE
"
0
#
#
test
Liste de pipelines
; pipeline
&
+
& pipeline
' +
&& pipeline
+
|| pipeline
+
Commandes composes
{ liste de pipelines }
*
"
""
+
( liste de pipelines )
* 4
+
!
!
read
"
&
% IFS+!
!
#
!
exec
exec commande
"
*
+
exec redirections
&
!
&
source
source script
. script
'
export variable
7
'
"
$
"
set
%
set options
"'
-a $
-u
%
-v
-x
"
5
%
""
"
$
$
unset
unset variable
!
getopts
while getopts "ab:c" variable ; do
case $variable in
a) echo "opt a";;
b) echo "opt b, arg. $OPTARG";;
c) echo "opt c";;
*) echo "opt invalide"; exit 1;;
esac
done
shift $((OPTIND 1))
echo "arguments restants :"
echo "$@"
exit 0
0
""
!
"
*?:
'
+#
"
OPTARG! >
#
"
"
"
OPTIND!
shift
shift n
"
#
cd
cd
&
set
$0
!
cd repertoire
!
"
!
env
cd
exit
exit valeur
"
*
+
"
" & 5
-eq /
-/
-ne /
/
-lt *-le+/
*
+-/
-gt *-ge+/
*
+-/
7
( 5
-n
-z
!
"
( 5
8# 8# 9# :
7
5
-a $
#
-b
& "
% #
-c
&
' #
-d
#
-f
" #
-g %
4;<6
#
-G
#
-h
0"% & #
-k %
=0
#
-N "
'
#
-O
#
-p % "" * +#
-r
1
#
-s
4
#
-S
= #
-u %
4><6
#
-w
1
#
-x
1 $
!
"
5
-ef / "1"
0 & & /#
-nt / "
"" & / #
-ot / "
" & /
7
5
-t
"
read variables
"
*
5
6
'
% )
% REPLY! ,
export
Pipeline
pipeline
*$
pipeline
*$
pipeline
*$
pipeline
*$
pwd
test condition
[ condition ]
# $n+1
""
$1# $n+2
5
$2#
#
$
@@AAA!%