1
0
Bifurcation 0
miroir de https://github.com/PAPAMICA/Wiki-Tech.io.git synchronisé 2024-09-14 19:55:15 +02:00
Wiki-Tech.io/Linux/Commandes.html

178 lignes
10 Kio
HTML
Brut Vue normale Historique

2021-04-28 20:24:15 +02:00
<!--
title: Commandes utiles
description:
published: true
2021-05-08 09:43:31 +02:00
date: 2021-05-08T07:43:29.927Z
2021-04-28 20:24:15 +02:00
tags:
editor: ckeditor
dateCreated: 2021-04-28T18:24:13.228Z
-->
2021-05-08 09:43:31 +02:00
<h1>Informations systèmes</h1>
2021-04-28 20:24:15 +02:00
<figure class="table">
<table style="background-color:rgb(255, 255, 255);">
<tbody>
<tr>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;"><code>reboot</code></td>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;">Redémarre</td>
</tr>
<tr>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;"><code>shutdown -now</code></td>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;">Éteint sans délais</td>
</tr>
<tr>
2021-05-04 15:02:42 +02:00
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;"><code>systemctl (start/stop/restart/status) &lt;service&gt;</code></td>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;">Démarre/Arrête/Redémarre/Affiche le statut d'un service</td>
2021-04-28 20:24:15 +02:00
</tr>
2021-05-08 09:43:31 +02:00
<tr>
<td><code>uname -a</code></td>
<td>&nbsp;Afficher les informations systèmes de linux</td>
</tr>
<tr>
<td><code>uname -r</code></td>
<td>Afficher la version du noyau</td>
</tr>
<tr>
<td><code>uptime</code></td>
<td>Afficher le temps d'activité du système et affiche la charge</td>
</tr>
<tr>
<td><code>hostname</code></td>
<td>Affiche le nom d'hôte de la machine</td>
</tr>
<tr>
<td><code>hostname -I</code></td>
<td>Affiche l'adresse IP de l'hôte</td>
</tr>
<tr>
<td><code>last reboot</code></td>
<td>Afficher l'historique des redémarrages</td>
</tr>
<tr>
<td><code>date</code></td>
<td>Afficher la date et l'heure du système</td>
</tr>
<tr>
<td><code>cal</code></td>
<td>Affiche le calendrier du mois</td>
</tr>
<tr>
<td><code>w</code></td>
<td>Affiche qui est en ligne</td>
</tr>
<tr>
<td><code>whoami</code></td>
<td>Affiche où nous sommes connecté en tant que qui</td>
</tr>
</tbody>
</table>
</figure>
<p>&nbsp;</p>
<h1>Informations matérielles</h1>
<figure class="table">
<table style="background-color:rgb(33, 33, 33);">
<tbody>
<tr>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">dmesg</td>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">Affiche les messages du noyau</td>
</tr>
<tr>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">cat /proc/cpuinfo</td>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">Affiche les informations du CPU</td>
</tr>
<tr>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">cat /proc/meminfo</td>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">Affiche les informations de la RAM</td>
</tr>
<tr>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">free -h</td>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">Affiche la mémoire libre et utilisé (-h pour lisible par l'homme, -m for MB et -g pour GB)</td>
</tr>
<tr>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">lspci -tv</td>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">Affiche les périphériques PCI</td>
</tr>
<tr>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">lsusb -tv</td>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">Affiche les périphériques USB</td>
</tr>
<tr>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">dmidecode</td>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">Affiche les information DMI/SMBIOS (informations systèmes) depuis le BIOS</td>
</tr>
<tr>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">hdparm -i /dev/sda</td>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">Affiche les informations du disque /dev/sda</td>
</tr>
<tr>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">hdparm -rT /dev/sda</td>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">Faire un test de vitesse de lecture sur le disque /dev/sda</td>
</tr>
<tr>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">badblocks -s /dev/sda</td>
<td style="border-bottom:1px solid rgb(238, 238, 238);padding:0.75rem;">Test le disque /dev/sda pour d'éventuels blocks défectueux</td>
</tr>
2021-04-28 20:24:15 +02:00
</tbody>
</table>
</figure>
2021-05-08 09:43:31 +02:00
<h1>Commandes logicielles</h1>
2021-04-28 20:24:15 +02:00
<h2>Tipee</h2>
<figure class="table">
<table style="background-color:rgb(255, 255, 255);">
<tbody>
<tr>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;"><code>tipee</code></td>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;">Connaitre le temps restant de la journée</td>
</tr>
<tr>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;"><code>tipee punch</code></td>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;">Badger les heures</td>
</tr>
</tbody>
</table>
</figure>
<p>Lien : <a href="https://gitlab.infomaniak.ch/mickaelasseline/python-tipee">Gitlab</a></p>
<h2>Git</h2>
<figure class="table">
<table style="background-color:rgb(255, 255, 255);">
<tbody>
2021-05-04 14:00:24 +02:00
<tr>
<td><code>git status</code></td>
2021-05-04 14:07:27 +02:00
<td>Permets d'afficher le statut du dépôt dans lequel nous sommes (quelle branche, s'il y a des commit à réaliser…)</td>
</tr>
<tr>
2021-05-04 14:15:06 +02:00
<td><code>git add nom_du_fichier</code></td>
2021-05-04 14:07:27 +02:00
<td>Permet de “tracker” (suivre) le fichier, et ainsi, le faire reconnaître par Git pour des prochaines actions (merge, commit, status…)</td>
</tr>
<tr>
2021-05-04 14:15:06 +02:00
<td><code>git init “nom_du_dossier”</code></td>
2021-05-04 14:07:27 +02:00
<td>Initialise le dossier, créant ainsi un dossier caché “.git" qui sera reconnu par l'outil Git et les plateformes comme GitHub, GitLab… Sans cela, le dossier ne sera jamais utilisable par Git.</td>
</tr>
<tr>
<td><code>git log</code></td>
<td>Affiche les dernières actions réalisées sur le repository (incluant les métadatas, les commit ID, commit messages…)</td>
2021-05-04 14:00:24 +02:00
</tr>
2021-04-28 20:24:15 +02:00
<tr>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;"><code>git clone</code></td>
2021-05-04 14:24:38 +02:00
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;">Clone un projet sur sa machine.</td>
2021-04-28 20:24:15 +02:00
</tr>
<tr>
2021-05-04 14:24:38 +02:00
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;"><code>git commit -am “message”</code></td>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;">Met à jour le commit avec un message défini.</td>
</tr>
<tr>
<td><code>git fetch</code></td>
<td>Récupère les informations d'un repository sans télécharger sur la machine.</td>
2021-04-28 20:24:15 +02:00
</tr>
<tr>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;"><code>git push</code></td>
2021-05-04 14:24:38 +02:00
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;">Envoi la mise à jour au git distant (dit “remote”). Prends en compte le dossier dans lequel on se situe.</td>
2021-04-28 20:24:15 +02:00
</tr>
<tr>
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;"><code>git pull</code></td>
2021-05-04 14:24:38 +02:00
<td style="border-bottom:1px solid rgb(207, 216, 220);border-left:1px solid rgb(207, 216, 220);border-right:1px solid rgb(207, 216, 220);border-top:1px solid rgb(207, 216, 220);padding:0.5rem 0.75rem;">Récupère les dernières mises à jours du répertoire distant</td>
2021-04-28 20:24:15 +02:00
</tr>
</tbody>
</table>
</figure>