tuto:linux:quelques_commandes_utiles
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
tuto:linux:quelques_commandes_utiles [2015/10/16 21:35] – [partproble] root | tuto:linux:quelques_commandes_utiles [2024/01/20 17:20] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 19: | Ligne 19: | ||
où mot est le mot clé à rechercher dans toutes les pages de manuel. | où mot est le mot clé à rechercher dans toutes les pages de manuel. | ||
La commande man est la commande d’aide standard sur tous les systèmes Unix. Cependant, Linux utilise un grand nombre de commandes écrites sous la licence GNU, et qui utilisent un format d’aide spécifique à GNU. | La commande man est la commande d’aide standard sur tous les systèmes Unix. Cependant, Linux utilise un grand nombre de commandes écrites sous la licence GNU, et qui utilisent un format d’aide spécifique à GNU. | ||
+ | |||
+ | On peut afficher toutes les pages de manuel par exemple pour '' | ||
+ | apropos . | grep -w ^read | ||
L’aide pour ces commandes peut être obtenue par la commande suivante : | L’aide pour ces commandes peut être obtenue par la commande suivante : | ||
Ligne 512: | Ligne 515: | ||
lsof -i | lsof -i | ||
- | ===== nmap ===== | ||
+ | Voir les process qui ont des fichiers supprimés : | ||
+ | lsof +aL1 | ||
+ | lsof -d DEL | ||
+ | ===== nmap ===== | ||
+ | * [[https:// | ||
+ | ]] | ||
Nmap est un scanner de ports. | Nmap est un scanner de ports. | ||
Ligne 2812: | Ligne 2820: | ||
===== tshark ===== | ===== tshark ===== | ||
+ | * https:// | ||
Wireshark en ligne de commande. | Wireshark en ligne de commande. | ||
Ligne 3194: | Ligne 3202: | ||
< | < | ||
< | < | ||
+ | |||
+ | ===== sg_persist ===== | ||
+ | * Voir les info : | ||
+ | < | ||
+ | $ sg_persist --in --report-capabilities -v /dev/sda | ||
+ | inquiry cdb: 12 00 00 00 24 00 | ||
+ | SUSE RBD | ||
+ | Peripheral device type: disk | ||
+ | Persistent Reservation In cmd: 5e 02 00 00 00 00 00 20 00 00 | ||
+ | Report capabilities response: | ||
+ | Compatible Reservation Handling(CRH): | ||
+ | Specify Initiator Ports Capable(SIP_C): | ||
+ | All Target Ports Capable(ATP_C): | ||
+ | Persist Through Power Loss Capable(PTPL_C): | ||
+ | Type Mask Valid(TMV): 1 | ||
+ | Allow Commands: 1 | ||
+ | Persist Through Power Loss Active(PTPL_A): | ||
+ | Support indicated in Type mask: | ||
+ | Write Exclusive, all registrants: | ||
+ | Exclusive Access, registrants only: 1 | ||
+ | Write Exclusive, registrants only: 1 | ||
+ | Exclusive Access: 1 | ||
+ | Write Exclusive: 1 | ||
+ | Exclusive Access, all registrants: | ||
+ | </ | ||
+ | |||
+ | * Voir la clé de réservation : | ||
+ | Sans clé de réservation : | ||
+ | < | ||
+ | $ sg_persist --in -k -d /dev/sda | ||
+ | SUSE RBD | ||
+ | Peripheral device type: disk | ||
+ | PR generation=0x7, | ||
+ | </ | ||
+ | |||
+ | Avec une clé de réservation : | ||
+ | < | ||
+ | $ sg_persist --in -k -d /dev/sdb | ||
+ | SUSE RBD | ||
+ | Peripheral device type: disk | ||
+ | PR generation=0x8, | ||
+ | 0xdeadbeef | ||
+ | </ | ||
+ | |||
+ | ou | ||
+ | < | ||
+ | $ sg_persist / | ||
+ | >> No service action given; assume Persistent Reserve In command | ||
+ | >> with Read Keys service action | ||
+ | SUSE RBD | ||
+ | Peripheral device type: disk | ||
+ | PR generation=0x14, | ||
+ | 0xdeadbeef | ||
+ | </ | ||
+ | |||
+ | * Voir la réservation : | ||
+ | < | ||
+ | $ sg_persist --in -r -d /dev/sda | ||
+ | SUSE RBD | ||
+ | Peripheral device type: disk | ||
+ | PR generation=0x7, | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | $ sg_persist --in -r -d /dev/sda | ||
+ | SUSE RBD | ||
+ | Peripheral device type: disk | ||
+ | PR generation=0x8, | ||
+ | Key=0xdeadbeef | ||
+ | scope: LU_SCOPE, | ||
+ | </ | ||
+ | |||
+ | * Positionner une clé de réservation (la clé est au format HEX jusqu' | ||
+ | < | ||
+ | $ sg_persist --out --register --param-sark=0xDEADBEEF /dev/sda | ||
+ | SUSE RBD | ||
+ | Peripheral device type: disk | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Il est possible de convertir l'IP en HEX pour positionner la clé : | ||
+ | < | ||
+ | $ printf ' | ||
+ | </ | ||
+ | </ | ||
+ | * Placer un type réservation : | ||
+ | < | ||
+ | $ sg_persist --out --reserve --param-rk=0xDEADBEEF --prout-type=5 /dev/sda | ||
+ | SUSE RBD | ||
+ | Peripheral device type: disk | ||
+ | </ | ||
+ | |||
+ | Ci-dessous les différents types : | ||
+ | |||
+ | 1) **Exclusive Access :** don't let anybody else use my disc at all, and don't let anybody take my reservation. | ||
+ | |||
+ | 3) **Write Exclusive :** don't let anybody else write to my disc, and don't let anybody take my reservation. | ||
+ | |||
+ | 5) **Exclusive Access, Registrants Only :** Don't let anybody but my group of friends use the disc, and don't let anybody take my reservation. | ||
+ | |||
+ | 6) **Write Exclusive, Registrants Only :** Don't let anybody but my group of friends write to the the disc, and don't let anybody take my reservation. | ||
+ | |||
+ | 7) **Exclusive Access, All Registrants :** Don't let anybody but my group of friends use the disc, and share my reservation with all of them as well. | ||
+ | |||
+ | 8) **Write Exclusive, All Registrants :** Don't let anybody but my group of friends write to the disc, and share my reservation with all of them as well. | ||
+ | |||
+ | * Supprimer la réservation : | ||
+ | < | ||
+ | $ sg_persist --out --release --param-rk=0xDEADBEEF | ||
+ | </ | ||
+ | |||
+ | * Supprimer la clé de réservation : | ||
+ | < | ||
+ | $ sg_persist --out --register --param-rk=0xDEADBEEF /dev/sda | ||
+ | </ | ||
+ | |||
+ | * Supprimer la clé et la réservation : | ||
+ | < | ||
+ | $ sg_persist --out --clear --param-rk=0xDEADBEEF /dev/sda | ||
+ | </ | ||
+ | |||
+ | ===== upower ===== | ||
+ | Lister les sources d' | ||
+ | < | ||
+ | $ upower -e | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Information sur une source d' | ||
+ | < | ||
+ | $ upower -i / | ||
+ | native-path: | ||
+ | vendor: | ||
+ | model: | ||
+ | serial: | ||
+ | power supply: | ||
+ | updated: | ||
+ | has history: | ||
+ | has statistics: | ||
+ | battery | ||
+ | present: | ||
+ | rechargeable: | ||
+ | state: | ||
+ | warning-level: | ||
+ | energy: | ||
+ | energy-empty: | ||
+ | energy-full: | ||
+ | energy-full-design: | ||
+ | energy-rate: | ||
+ | voltage: | ||
+ | time to full: 1,7 hours | ||
+ | percentage: | ||
+ | capacity: | ||
+ | technology: | ||
+ | icon-name: | ||
+ | History (charge): | ||
+ | 1510179176 11, | ||
+ | History (rate): | ||
+ | 1510179176 30, | ||
+ | </ | ||
+ | |||
+ | Information sur le démon : | ||
+ | < | ||
+ | $ upower -d | ||
+ | ... | ||
+ | Daemon: | ||
+ | daemon-version: | ||
+ | on-battery: | ||
+ | lid-is-closed: | ||
+ | lid-is-present: | ||
+ | critical-action: | ||
+ | </ | ||
+ | |||
+ | Voir aussi [[#acpi]]. | ||
+ | |||
+ | ===== acpi ===== | ||
+ | Information sur la batterie (voir aussi [[# | ||
+ | < | ||
+ | $ acpi -i -b | ||
+ | Battery 0: Discharging, | ||
+ | Battery 0: design capacity 7894 mAh, last full capacity 6028 mAh = 76% | ||
+ | </ | ||
+ | |||
+ | ===== showkey ===== | ||
+ | Afficher la valeur d'une touche : | ||
+ | < | ||
+ | $ showkey -a | ||
+ | </ | ||
+ | |||
+ | ===== rpm ===== | ||
+ | ==== Metadonnées rpm ==== | ||
+ | Afficher les vendors: | ||
+ | < | ||
+ | $ rpm -qa --qf ' | ||
+ | </ | ||
+ | |||
+ | Afficher les rpms: | ||
+ | < | ||
+ | $ rpm -qa --qf ' | ||
+ | </ | ||
+ | |||
+ | Pour afficher tous les tags: | ||
+ | < | ||
+ | rpm --querytags | ||
+ | </ | ||
+ | |||
+ | ===== patchelf ===== | ||
+ | [[https:// | ||
+ | < | ||
+ | $ patchelf --set-interpreter / | ||
+ | $ patchelf --set-rpath / | ||
+ | $ patchelf --shrink-rpath program | ||
+ | </ | ||
+ | |||
+ | ===== growpart ===== | ||
+ | Etend au max la partition: | ||
+ | < | ||
+ | $ growpart /dev/sda 1 | ||
+ | </ | ||
+ | |||
+ | Ensuite on augmente le fs: | ||
+ | < | ||
+ | $ btrfs filesystem resize max /mounted | ||
+ | </ | ||
+ | |||
+ | ===== nvme ===== | ||
+ | < | ||
+ | $ nvme list | ||
+ | Node | ||
+ | ---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | $ nvme smart-log /dev/nvme0 | ||
+ | Smart Log for NVME device: | ||
+ | critical_warning : | ||
+ | temperature : | ||
+ | available_spare : | ||
+ | available_spare_threshold : | ||
+ | percentage_used : | ||
+ | endurance group critical warning summary: 0 | ||
+ | data_units_read : | ||
+ | data_units_written : | ||
+ | host_read_commands : | ||
+ | host_write_commands : | ||
+ | controller_busy_time : | ||
+ | power_cycles : | ||
+ | power_on_hours : | ||
+ | unsafe_shutdowns : | ||
+ | media_errors : | ||
+ | num_err_log_entries : | ||
+ | Warning Temperature Time : 11 | ||
+ | Critical Composite Temperature Time : 0 | ||
+ | Temperature Sensor 1 : 44 C | ||
+ | Thermal Management T1 Trans Count : 0 | ||
+ | Thermal Management T2 Trans Count : 0 | ||
+ | Thermal Management T1 Total Time : 0 | ||
+ | Thermal Management T2 Total Time : 0 | ||
+ | </ |
tuto/linux/quelques_commandes_utiles.1445031326.txt.gz · Dernière modification : 2015/10/16 21:35 de root