-
-
Save gsouf/5419927 to your computer and use it in GitHub Desktop.
Linux Memo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILESYSTEM INFORMATIONS | |
----------------------- | |
http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/usr.html | |
COMMANDES UTILES | |
---------------- | |
du -hs /home Donne la taille du contenu de /home | |
df -k Affic les taux d'occupation des systèmes de fichiers | |
cp /home/fichier.html{,.bak} equivalent de cp /home/fichier.html /home/fichier.html.bak | |
mount.cifs //serveur/partage /mnt/montage -o username=throud,password=pass Montage d'un partage samba | |
mount -t cifs //adresseip/monpartage /mnt/windows -o user=throud,pass=pass Montage d'un partage samba (Alternative) | |
umount -l /mnt/montage demonter un partage | |
lsof -i Lister les ports ouverts | |
netstat -npl | grep mysql Lister les ports utilisant mysql | |
more /etc/debian_version Afficher la version de debian | |
chkconfig --list nom_du_service Liste les runlevels d'un service | |
chkconfig --level 23456 nom_du_service on Defini le runlevel d'un service aux niveaux 2 3 4 5 6 | |
last | more Donne l'historique des connections SSH | |
ps axjf Affiche l'arborescence des processus | |
ps aux | grep samba afficher le processus samba ainsi que son ID | |
locate monfichier Localiser un fichier | |
updatedb Mettre a jour la liste des fichiers pour lacommande locate | |
find / -iname '*.conf' localiser les fichiers *.conf depuis la racine | |
whereis ma_commande Localiser le chemin d'une commande | |
finger | |
gunzip -l archive.gz lister le contenu d'une archive GZ | |
gunzip -d archive.gz extraire le contenu d'une archive GZ | |
tar xvf archive.tar extraire le contenu d'une archive TAR | |
tar zcvf archive.tar.gz mon_rep/ compresser une archive en TAR.GZ | |
tar zxvf archive.tar.gz extraire le contenu d'une archive TAR.GZ | |
tar xjvf archive.tar.bz2 extraire le contenu d'une archive BZ2 | |
zip -r nom_du_fichier.zip repertoire_ou_fichier compresser une archive en ZIP | |
unzip nom_du_fichier.zip -d dossier_de_destination extraire le contenu d'une archive ZIP | |
TABLEAU DES DROITS UNIX | |
----------------------- | |
Binaire --- Logique --- Décimal | |
000 -------- (---) ------- 0 | |
001 -------- (--x) ------- 1 | |
010 -------- (-w-) ------- 2 | |
011 -------- (-wx) ------- 3 | |
100 -------- (r--) ------- 4 | |
101 -------- (r-x) ------- 5 | |
110 -------- (rw-) ------- 6 | |
111 -------- (rwx) ------- 7 | |
RACCOURCIS EN BASH | |
------------------ | |
Ctrl + A Go to the beginning of the line you are currently typing on | |
Ctrl + E Go to the end of the line you are currently typing on | |
Ctrl + L Clears the Screen, similar to the clear command | |
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line. | |
Ctrl + H Same as backspace | |
Ctrl + R Let’s you search through previously used commands | |
Ctrl + C Kill whatever you are running | |
Ctrl + D Exit the current shell | |
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it. | |
Ctrl + W Delete the word before the cursor | |
Ctrl + K Clear the line after the cursor | |
Ctrl + T Swap the last two characters before the cursor | |
Esc + T Swap the last two words before the cursor | |
Alt + F Move cursor forward one word on the current line | |
Alt + B Move cursor backward one word on the current line | |
Tab Auto-complete files and folder names | |
RUNLEVELS | |
--------- | |
Pour Debian et ses forks: | |
0 Arrêt | |
1 Mode maintenance | |
2 à 5 Mode multi utilisateur complet avec serveur graphique si installé. | |
6 Redémarrage | |
Attention : inittab a été remplacé par Upstart sous Ubuntu | |
Pour les systemes Redhat: | |
0 : Arrêt | |
1 : Mode maintenance | |
2 : Mode multiutilisateur (sans la couche réseau) | |
3 : Mode multiutilisateur (avec la couche réseau) | |
4 : Inutilisé | |
5 : Mode multiutilisateur avec serveur graphique | |
6 : Redémarrage | |
EDITEUR DE TEXTE VI | |
------------------- | |
SAUVER/QUITTER | |
Echap pour passer les commandes | |
w Sauvegarder | |
wq quitter en enregistrant. | |
ZZ Quitter et sauvegarder si quelque chose a été modifié. | |
w [nom de fichier] enregistre sous un autre nom, w! [fichier] : Remplace fichier | |
e! Ignore les changements et recharge le fichier | |
q quitter sans sauvegarder, q! Force vi à se terminer | |
SE DEPLACER | |
se nu numérote les lignes | |
xxx Positionne à la ligne xxx | |
$ amène à la dernière ligne du fichier | |
INSERER REMPLACER SUPPRIMER | |
a Insertion après le curseur | |
i insertion avant le curseur | |
A Insertion en fin de ligne | |
I insertion en déde ligne | |
esc Termine le mode insertion | |
x effacer le caractère pointé | |
dw Supprime un mot | |
dXw Supprime X mots | |
dd Supprime la ligne | |
dXd supprime X lignes | |
r* Remplace le caractère à la position du curseur par * | |
R Remplace tous les caractères jusqu'à la fin de la ligne ([ESC] pour terminer) | |
cw Remplace uniquement le mot à la position du curseur ([ESC] pour terminer) | |
cXw Remplace X mots ([ESC] pour terminer) | |
%s /mot/mot1 /gc remplacer mot par mot1 dans tout le fichier | |
1,$s;mot;mot1;gc idem | |
COPIER COLLER | |
Y Copier une ligne | |
nY Copier n lignes | |
P Coller les lignes avant le curseur | |
p Coller les lignes après le curseur | |
Annuler/Répeter les modifications : | |
u Annuler la dernière modification | |
U Annuler toutes les modifications effectuées sur la ligne courante | |
. Répèter les dernières modifications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsync -avz --exclude "onefile" --exclude "onedirectory" -e "ssh -p 12121" user@host:/source/dir /destination/dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment