This commit is contained in:
2024-09-10 16:40:29 +02:00
parent 778bb476fa
commit 0ecbdd4585
4 changed files with 227 additions and 6 deletions

1
SCR1.1/TP02/error_file Normal file
View File

@@ -0,0 +1 @@
ls: cannot access 'nofi': No such file or directory

View File

@@ -0,0 +1,2 @@
ls: cannot access 'nofi': No such file or directory
fi

View File

@@ -1 +1,186 @@
fi total 1280
drwxr-xr-x 3 root root 4096 Jul 19 2023 acpi
drwxr-xr-x 3 root root 4096 Jul 19 2023 alsa
-rw-r--r-- 1 root root 541 Apr 25 2022 anacrontab
-rw-r--r-- 1 root root 226 Nov 21 2022 ant.conf
drwxr-xr-x 3 root root 4096 Jul 19 2023 apparmor.d
-rw-r--r-- 1 root root 0 Jan 31 2023 arch-release
drwxr-xr-x 4 root root 4096 Jul 19 2023 audit
drwxr-xr-x 3 root root 4096 Jul 19 2023 avahi
-rw-r--r-- 1 root root 28 May 21 2023 bash.bash_logout
-rw-r--r-- 1 root root 605 May 21 2023 bash.bashrc
-rw-r--r-- 1 root root 2403 Jun 21 2023 bind.keys
-rw-r--r-- 1 root root 535 Nov 15 2022 bindresvport.blacklist
drwxr-xr-x 2 root root 4096 Jul 19 2023 binfmt.d
drwxr-xr-x 4 root root 4096 Jul 19 2023 ca-certificates
drwxr-xr-x 2 root root 4096 Jul 19 2023 cifs-utils
drwxr-xr-x 3 root root 4096 Jul 19 2023 cni
drwxr-xr-x 2 root root 4096 Jul 19 2023 conf.d
d--------- 2 root root 4096 Jul 19 2023 credstore
d--------- 2 root root 4096 Jul 19 2023 credstore.encrypted
drwxr-xr-x 2 root root 4096 Jul 19 2023 cron.d
drwxr-xr-x 2 root root 4096 Jul 19 2023 cron.daily
-rw-r--r-- 1 root root 74 Apr 25 2022 cron.deny
drwxr-xr-x 2 root root 4096 Jul 19 2023 cron.hourly
drwxr-xr-x 2 root root 4096 Jul 19 2023 cron.monthly
drwxr-xr-x 2 root root 4096 Jul 19 2023 cron.weekly
-rw------- 1 root root 722 Jan 31 2023 crypttab
drwxr-xr-x 5 root root 4096 Jul 19 2023 cups
drwxr-xr-x 3 root root 4096 Jul 19 2023 dconf
drwxr-xr-x 2 root root 4096 Jul 19 2023 debuginfod
drwxr-xr-x 2 root root 4096 Jul 19 2023 default
drwxr-xr-x 2 root root 4096 Jul 19 2023 depmod.d
-rw-r--r-- 1 root root 685 Feb 7 2023 e2scrub.conf
-rw-r--r-- 1 root root 97 May 25 2023 environment
-rw-r--r-- 1 root root 1362 Jan 27 2023 ethertypes
-rw-r--r-- 1 root root 429 Apr 20 2023 exports
drwxr-xr-x 2 root root 4096 Jul 19 2023 exports.d
drwxr-xr-x 3 root root 4096 Jul 19 2023 fonts
-rw-r--r-- 1 root root 477 Aug 29 17:09 fstab
-rw-r--r-- 1 root root 694 Mar 28 2023 fuse.conf
-rw-r--r-- 1 root root 2584 Apr 30 2023 gai.conf
drwxr-xr-x 2 root root 4096 Jul 19 2023 gdb
-rw-r--r-- 1 root root 266 Nov 5 2022 gemrc
drwxr-xr-x 3 root root 4096 Jul 19 2023 gimp
-rw-r--r-- 1 root root 3886 May 24 2023 gprofng.rc
-rw-r--r-- 1 root root 905 Jan 11 2024 group
-rw-r--r-- 1 root root 900 Jul 18 2023 group-
drwxr-xr-x 2 root root 4096 Jul 19 2023 grub.d
-rw------- 1 root root 806 Jan 11 2024 gshadow
-rw------- 1 root root 801 Jul 18 2023 gshadow-
drwxr-xr-x 3 root root 4096 Jul 19 2023 gss
drwxr-xr-x 2 root root 4096 Jul 19 2023 gssproxy
drwxr-xr-x 2 root root 4096 Jul 19 2023 gtk-2.0
drwxr-xr-x 2 root root 4096 Jul 19 2023 gtk-3.0
-rw-r--r-- 1 root root 450 Nov 17 2022 healthd.conf
-rw-r--r-- 1 root root 73 Jan 31 2023 host.conf
-rw-r--r-- 1 root root 12 Oct 13 2023 hostname
-rw-r--r-- 1 root root 273 Oct 13 2023 hosts
-rw-r--r-- 1 root root 171 Jul 13 2023 idmapd.conf
drwxr-xr-x 2 root root 4096 Jul 19 2023 ifplugd
drwxr-xr-x 2 root root 4096 Jul 19 2023 ImageMagick-7
drwxr-xr-x 5 root root 4096 Jul 19 2023 initcpio
-rw-r--r-- 1 root root 714 Dec 27 2022 inputrc
drwxr-xr-x 2 root root 4096 Jul 19 2023 iproute2
drwxr-xr-x 2 root root 4096 Jul 19 2023 iptables
-rw-r--r-- 1 root root 20 Jan 31 2023 issue
drwxr-xr-x 2 root root 4096 Jul 19 2023 jack
drwxr-xr-x 4 root root 4096 Jul 19 2023 java11-openjdk
drwxr-xr-x 6 root root 4096 Jul 19 2023 java-8-openjdk
drwxr-xr-x 5 root root 4096 Jul 19 2023 java-openjdk
drwxr-xr-x 3 root root 4096 Jul 19 2023 kernel
drwxr-xr-x 2 root root 4096 Jul 19 2023 keyutils
-rw-r--r-- 1 root root 421 Jul 13 2023 krb5.conf
-rw------- 1 root root 710 Oct 13 2023 krb5.keytab
-rw-r--r-- 1 root root 140843 Oct 13 2023 ld.so.cache
-rw-r--r-- 1 root root 117 Jan 31 2023 ld.so.conf
drwxr-xr-x 2 root root 4096 Jul 19 2023 ld.so.conf.d
-rw-r----- 1 root root 191 May 2 2023 libaudit.conf
drwxr-xr-x 3 root root 4096 Jul 19 2023 libblockdev
drwxr-xr-x 2 root root 4096 Jul 19 2023 libinput
drwxr-xr-x 2 root root 4096 Jul 19 2023 libnl
drwxr-xr-x 2 root root 4096 Jul 19 2023 libpaper.d
drwxr-xr-x 2 root root 4096 Jul 19 2023 libreoffice
-rw-r--r-- 1 root root 24 Mar 29 2023 libva.conf
drwxr-xr-x 2 root root 4096 Jul 19 2023 lightdm
drwxr-xr-x 3 root root 4096 Jul 19 2023 lirc
-rw-r--r-- 1 root root 17 Jul 13 2023 locale.conf
-rw-r--r-- 1 root root 9955 Jul 13 2023 locale.gen
lrwxrwxrwx 1 root root 32 Jul 13 2023 localtime -> /usr/share/zoneinfo/Europe/Paris
-rw-r--r-- 1 root root 8195 Jan 25 2023 login.defs
drwxr-xr-x 2 root root 4096 Jul 19 2023 logrotate.d
-r--r--r-- 1 root root 33 Jul 13 2023 machine-id
-rw-r--r-- 1 root root 272 Jun 1 2023 mailcap
-rw-r--r-- 1 root root 6249 May 20 2023 makepkg.conf
-rw-r--r-- 1 root root 5218 Jan 9 2023 man_db.conf
-rw-r--r-- 1 root root 2349 Mar 30 2022 mdadm.conf
-rw-r--r-- 1 root root 74869 Jun 1 2023 mime.types
-rw-r--r-- 1 root root 813 Feb 7 2023 mke2fs.conf
-rw-r--r-- 1 root root 2794 May 29 2023 mkinitcpio.conf
drwxr-xr-x 2 root root 4096 Jul 19 2023 mkinitcpio.conf.d
drwxr-xr-x 2 root root 4096 Jul 19 2023 mkinitcpio.d
drwxr-xr-x 2 root root 4096 Jul 19 2023 modprobe.d
drwxr-xr-x 2 root root 4096 Jul 19 2023 modules-load.d
drwxr-xr-x 2 root root 4096 Jul 19 2023 mplayer
lrwxrwxrwx 1 root root 19 Jan 31 2023 mtab -> ../proc/self/mounts
-rw-r----- 1 root named 1219 Jun 21 2023 named.conf
-rw-r--r-- 1 root root 767 Nov 15 2022 netconfig
drwxr-xr-x 5 root root 4096 Jul 19 2023 netctl
-rw-r--r-- 1 root root 993 Jul 13 2023 nfs.conf
-rw-r--r-- 1 root root 3606 Jul 13 2023 nfsmount.conf
drwxr-xr-x 2 root root 4096 Jul 19 2023 nginx
-rw-r--r-- 1 root root 2387 Jul 13 2023 nscd.conf
-rw-r--r-- 1 root root 344 Jul 13 2023 nsswitch.conf
-rw-r--r-- 1 root root 618 Jul 13 2023 ntp.conf
drwxr-xr-x 2 root root 4096 Jul 19 2023 ODBCDataSources
-rw-r--r-- 1 root root 0 May 11 2022 odbc.ini
-rw-r--r-- 1 root root 0 May 11 2022 odbcinst.ini
drwxr-xr-x 3 root root 4096 Jul 19 2023 openldap
drwxr-xr-x 2 root root 4096 Jul 19 2023 openmpi
drwxr-xr-x 2 root root 4096 Jul 19 2023 openpmix
drwxr-xr-x 2 root root 4096 Sep 2 17:10 openvswitch
lrwxrwxrwx 1 root root 21 Jul 13 2023 os-release -> ../usr/lib/os-release
-rw-r--r-- 1 root root 3023 Jul 13 2023 pacman.conf
drwxr-xr-x 3 root root 4096 Jul 19 2023 pacman.d
drwxr-xr-x 2 root root 4096 Jul 19 2023 pam.d
-rw-r--r-- 1 root root 95 Jul 1 2023 papersize
-rw-r--r-- 1 root root 1309 Jul 1 2023 paperspecs
-rw-r--r-- 1 root root 1706 Jul 13 2023 passwd
-rw-r--r-- 1 root root 1072 Jul 13 2023 passwd-
drwxr-xr-x 2 root root 4096 Jul 19 2023 pinentry
drwxr-xr-x 2 root root 4096 Jul 19 2023 pkcs11
drwxr-xr-x 3 root root 4096 Jul 19 2023 polkit-1
drwxr-xr-x 4 root root 4096 Jul 19 2023 postfix
-rw-r--r-- 1 root root 1020 Jan 31 2023 profile
drwxr-xr-x 2 root root 4096 Jul 19 2023 profile.d
-rw-r--r-- 1 root root 3196 Jul 3 2023 protocols
drwxr-xr-x 2 root root 4096 Jul 19 2023 pulse
drwxr-xr-x 2 root root 4096 Jul 19 2023 rc_keymaps
-rw-r--r-- 1 root root 7692 May 26 2023 rc_maps.cfg
-rw-r--r-- 1 root root 1814 Apr 27 2023 request-key.conf
drwxr-xr-x 2 root root 4096 Jul 19 2023 request-key.d
-rw-r--r-- 1 root root 90 Sep 10 15:52 resolv.conf
-rw-r--r-- 1 root root 523 Nov 1 2022 rhashrc
-rw-r--r-- 1 root root 1634 Apr 30 2023 rpc
drwxr-xr-x 3 root root 4096 Jul 19 2023 samba
-rw-r--r-- 1 root root 139 Jan 31 2023 securetty
drwxr-xr-x 2 root root 4096 Jul 19 2023 security
-rw-r--r-- 1 root root 10593 Nov 17 2022 sensors3.conf
drwxr-xr-x 2 root root 4096 Jul 19 2023 sensors.d
-rw-r--r-- 1 root root 299304 Jul 3 2023 services
-rw------- 1 root root 1036 Jul 13 2023 shadow
-rw------- 1 root root 802 Jul 13 2023 shadow-
-rw-r--r-- 1 root root 113 Jul 13 2023 shells
drwxr-xr-x 2 root root 4096 Jul 19 2023 skel
-rw-r--r-- 1 root root 2030 Dec 27 2022 slsh.rc
drwxr-xr-x 2 root root 4096 Jul 19 2023 ssh
drwxr-xr-x 5 root root 4096 Jul 19 2023 ssl
-rw-r--r-- 1 root root 37 Jul 13 2023 subgid
-rw-r--r-- 1 root root 19 Jul 13 2023 subgid-
-rw-r--r-- 1 root root 37 Jul 13 2023 subuid
-rw-r--r-- 1 root root 19 Jul 13 2023 subuid-
-rw-r--r-- 1 root root 4327 Jul 12 2023 sudo.conf
-r--r----- 1 root root 3289 Dec 6 2023 sudoers
drwxr-x--- 2 root root 4096 Jul 19 2023 sudoers.d
-rw-r--r-- 1 root root 9800 Jul 12 2023 sudo_logsrvd.conf
drwxr-xr-x 2 root root 4096 Jul 19 2023 sysctl.d
drwxr-xr-x 5 root root 4096 Jul 19 2023 systemd
drwxr-xr-x 2 root root 4096 Jul 19 2023 tmpfiles.d
drwxr-xr-x 3 root root 4096 Jul 19 2023 tpm2-tss
-rw-r--r-- 1 root root 738 Oct 13 2020 trusted-key.key
-rw-r--r-- 1 root root 938 Jul 1 2020 ts.conf
drwxr-xr-x 4 root root 4096 Jul 19 2023 udev
drwxr-xr-x 2 root root 4096 Jul 19 2023 udisks2
-rw-r--r-- 1 root root 568 Apr 21 2021 updatedb.conf
drwxr-xr-x 2 root root 4096 Jul 19 2023 UPower
-rw-r--r-- 1 root root 13 Jul 13 2023 vconsole.conf
-rw-r--r-- 1 root root 51 Mar 12 2022 vdpau_wrapper.cfg
-rw-r--r-- 1 root root 912 Jul 8 2023 vimrc
-rw-r--r-- 1 root root 5026 May 20 2023 wgetrc
drwxr-xr-x 4 root root 4096 Jul 19 2023 X11
-rw-r--r-- 1 root root 622 Mar 26 2023 xattr.conf
drwxr-xr-x 10 root root 4096 Jul 19 2023 xdg
drwxr-xr-x 2 root root 4096 Jul 19 2023 xinetd.d
drwxr-xr-x 2 root root 4096 Jul 19 2023 xml
-rw-r--r-- 1 root root 1976 Jan 27 2023 xtables.conf
-rw-r--r-- 1 root root 1285 Jul 13 2023 yaourtrc

View File

@@ -1,4 +1,6 @@
I) I. Quelques formes des lignes de commandes.
Forme Simple: Forme Simple:
1. 1.
La commande echo permet d'écrire des caractères ou de consulter le code de status tous dépend de ce qui est écrit après. La commande echo permet d'écrire des caractères ou de consulter le code de status tous dépend de ce qui est écrit après.
@@ -37,8 +39,39 @@ Avec la commande echo "Hello world2!" | echo "Hello world1!" ,nous redirigeons l
(rajouter le signe | permet de rediriger tous se qu'il y avant sur un fichier spécial. (rajouter le signe | permet de rediriger tous se qu'il y avant sur un fichier spécial.
Liste: Liste:
Si la commande s'execute sans erreur le echo "$?" sera 0. 0 : La commande a réussi sans erreurs. C'est le code de retour standard pour indiquer un succès.
Si la commande s'execute avec erreur le echo "$?" sera 2.
& : si la commande mise avant n'a pas d'erreur la commande d'après s'executera, si il y a une erreur la commande d'après ne s'executera pas. 1 : Il s'agit d'une erreur générale ou d'un échec. C'est un code d'erreur générique qui peut signifier que quelque chose s'est mal passé, ( sans spécifier la nature exacte de l'erreur).
| : si la commande avant le pipeline n'a pas d'erreur elle n'executera pas la commande après la pipeline mais si la partie de la commande avant la pipeline a une erreur la commande écrite après la pipeline sera exécuter.
2 : Ce code est souvent utilisé pour des erreurs spécifiques liées à des arguments ou des paramètres invalides, bien que cela puisse varier selon le programme ou la commande.
Regardez la page manuel de la commande et regardez le Exit status.
&& : si la commande mise avant n'a pas d'erreur la commande d'après s'executera, si il y a une erreur la commande d'après ne s'executera pas .
| : Permet d'envoyé la commande 1 en porte d'entré pour la commande 2 . (si la commande n'a pas de porte d'entré seulement la deuxième commande et executer).
|| : est un porte ou .
II. Redirections des entrées/sorties.
> : permet de créez un fichier avec pour nom le mot écrit juste après ,écrivant seulement les commandes sans erreur.
>>: permet de écrire la commande sans erreur dans le fichier mit en ajouter sans réécrire le fichier.
2> : permet de créez un fichier avec pour nom le mot écrit juste après , écrivant seulement les commandes et le message d'erreur avec erreur.
2>&1 permet de créez un fichier avec pour le nom le mot écrit, écrivant les commandes et les message avec ou sans erreur.
> permet de rédictionner seulement la sortie standard.
< permet de rédirectionner seulement la rentré standard.
wc permet de voir le nombre de ligne , colone et nombre de caractère.
Exemple:
ls -l /etc/ > output_file permet de mettre dans le fichier output_file le résultat de la commande ls -l dans le dossier etc .