{"id":37,"date":"2021-04-23T19:03:19","date_gmt":"2021-04-23T17:03:19","guid":{"rendered":"http:\/\/it.billybaheux.fr\/?p=37"},"modified":"2021-06-10T11:44:14","modified_gmt":"2021-06-10T09:44:14","slug":"linux-commandes-de-base","status":"publish","type":"post","link":"https:\/\/it.billybaheux.fr\/index.php\/2021\/04\/23\/linux-commandes-de-base\/","title":{"rendered":"Linux &#8211; commandes de base"},"content":{"rendered":"\n<p>La base, c&rsquo;est le shell. Pour administrer Linux ou m\u00eame pour tester des choses comme la domotique, les serveurs, l&rsquo;IoT, etc&#8230; Il ne faut pas avoir peur de la ligne de commande. D\u00e9cortiquons-la et apprenons les premi\u00e8res commandes :<\/p>\n\n\n\n<p>[CentOs@localhost ~]$     &lt;= <span class=\"has-inline-color has-luminous-vivid-orange-color\">CentOs<\/span> correspond \u00e0 l&rsquo;utilisateur qui est connect\u00e9 <span class=\"has-inline-color has-vivid-cyan-blue-color\">@ localhost<\/span> (nom de la machine) <span class=\"has-inline-color has-vivid-green-cyan-color\">~<\/span> (indique qu&rsquo;on est dans le home de l&rsquo;utilisateur) et le <span class=\"has-inline-color has-luminous-vivid-amber-color\">$<\/span> indique que nous sommes un utilisateur classique<\/p>\n\n\n\n<p>[root@localhost ~]<span class=\"has-inline-color has-luminous-vivid-amber-color\">#<\/span> le <span class=\"has-inline-color has-luminous-vivid-amber-color\">#<\/span> indique qu&rsquo;on est connect\u00e9 en tant qu&rsquo; administrateur, en l&rsquo;occurrence root<\/p>\n\n\n\n<p>Commande <span class=\"has-inline-color has-vivid-red-color\">whoami<\/span> , cette commande permet de savoir sous quel utilisateur, nous sommes connect\u00e9s<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-style-default\"><p>[CentOs@localhost ~]$ whoami<br>CentOs<\/p><\/blockquote>\n\n\n\n<p>Commande <span class=\"has-inline-color has-vivid-red-color\">df<\/span> permet de donner l&rsquo;espace disque libre. A combiner avec l&rsquo;option -h pour avoir une lecture adapt\u00e9e aux humains.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>[CentOs@localhost ~]$ df<br>Sys. de fichiers blocs de 1K Utilis\u00e9 Disponible Uti% Mont\u00e9 sur<br>devtmpfs 901856 0 901856 0% \/dev<br>tmpfs 931300 0 931300 0% \/dev\/shm<br>tmpfs 931300 9704 921596 2% \/run<br>tmpfs 931300 0 931300 0% \/sys\/fs\/cgroup<br>\/dev\/mapper\/cl-root 11204608 4824736 6379872 44% \/<br>\/dev\/sda1 1038336 328244 710092 32% \/boot<br>tmpfs 186260 1180 185080 1% \/run\/user\/42<br>tmpfs 186260 4644 181616 3% \/run\/user\/1000<br>\/dev\/sr0 59724 59724 0 100% \/run\/media\/CentOs\/VBox_GAs_6.1.18<\/p><\/blockquote>\n\n\n\n<p>Commande <span class=\"has-inline-color has-vivid-red-color\">free<\/span><\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>[CentOs@localhost ~]$ free<br>total used free shared buff\/cache available<br>Mem: 1862600 1093296 106352 13256 662952 602236<br>Swap: 1363964 10560 1353404<br>[CentOs@localhost ~]$<\/p><\/blockquote>\n\n\n\n<p>Commande clear<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>[CentOs@localhost ~]$ free<br>total used free shared buff\/cache available<br>Mem: 1862600 1093296 106352 13256 662952 602236<br>Swap: 1363964 10560 1353404<\/p><\/blockquote>\n\n\n\n<p>Commande <span class=\"has-inline-color has-vivid-red-color\">uname -a<\/span><\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>[CentOs@localhost ~]$ uname -a<br>Linux localhost.localdomain 4.18.0-240.22.1.el8_3.x86_64 #1 SMP Thu Apr 8 19:01:30 UTC 2021 x86_64 x86_64 x86_64 GNU\/Linux<\/p><\/blockquote>\n\n\n\n<p>Une commande utile si vous travaillez avec beaucoup d&rsquo;os diff\u00e9rent en virtualisation ou non, c&rsquo;est cat \/etc\/os-release<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>NAME=\u00a0\u00bbUbuntu\u00a0\u00bb<br>VERSION=\u00a0\u00bb20.04.1 LTS (Focal Fossa)\u00a0\u00bb<br>ID=ubuntu<br>ID_LIKE=debian<br>PRETTY_NAME=\u00a0\u00bbUbuntu 20.04.1 LTS\u00a0\u00bb<br>VERSION_ID=\u00a0\u00bb20.04&Prime;<br>HOME_URL=\u00a0\u00bbhttps:\/\/www.ubuntu.com\/\u00a0\u00bb<br>SUPPORT_URL=\u00a0\u00bbhttps:\/\/help.ubuntu.com\/\u00a0\u00bb<br>BUG_REPORT_URL=\u00a0\u00bbhttps:\/\/bugs.launchpad.net\/ubuntu\/\u00a0\u00bb<br>PRIVACY_POLICY_URL=\u00a0\u00bbhttps:\/\/www.ubuntu.com\/legal\/terms-and-policies\/privacy-policy\u00a0\u00bb<br>VERSION_CODENAME=focal<br>UBUNTU_CODENAME=focal<\/p><cite>r\u00e9sultat de cat \/etc\/os-release<\/cite><\/blockquote>\n\n\n\n<p>Allez, une nouvelle commande qui permet de chercher le nom et la description des pages du manuel (man) et cela vous permettra de trouver une commande en saissant un mot cl\u00e9 comme usb :<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>pi@raspoctoprint:~ $ apropos usb<br>hp-config_usb_printer (1) &#8211; HP device config using USB<br>lsusb (8) &#8211; list USB devices<br>sane-canon630u (5) &#8211; SANE backend for the Canon 630u USB flatbed scanner<br>sane-cardscan (5) &#8211; SANE backend for Corex CardScan usb scanners<br>sane-epjitsu (5) &#8211; SANE backend for Epson-based Fujitsu USB scanners.<br>sane-find-scanner (1) &#8211; find SCSI and USB scanners and their device files<br>sane-genesys (5) &#8211; SANE backend for GL646, GL841, GL843, GL847 and GL124 \u2026<br>sane-gt68xx (5) &#8211; SANE backend for GT-68XX based USB flatbed scanners<br>sane-kvs1025 (5) &#8211; SANE backend for Panasonic KV-S102xC USB ADF scanners.<br>sane-kvs20xx (5) &#8211; SANE backend for Panasonic KV-S20xxC USB\/SCSI ADF scan\u2026<br>sane-kvs40xx (5) &#8211; SANE backend for Panasonic KV-S40xxC USB\/SCSI ADF scan\u2026<br>sane-ma1509 (5) &#8211; SANE backend for Mustek BearPaw 1200F USB scanner<br>sane-mustek_usb (5) &#8211; SANE backend for Mustek USB flatbed scanners<br>sane-mustek_usb2 (5) &#8211; SANE backend for SQ113 based USB flatbed scanners<br>sane-pieusb (5) &#8211; SANE backend for USB-connected PIE PowerSlide and Refl\u2026<br>sane-plustek (5) &#8211; SANE backend for LM983[1\/2\/3] based USB flatbed scanners<br>sane-sm3600 (5) &#8211; SANE backend for Microtek scanners with M011 USB chip<\/p><cite>apropos<\/cite><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>La base, c&rsquo;est le shell. Pour administrer Linux ou m\u00eame pour tester des choses comme la domotique, les serveurs, l&rsquo;IoT, etc&#8230; Il ne faut pas avoir peur de la ligne de commande. D\u00e9cortiquons-la et&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[13,11,9,15,10,8,14,12],"_links":{"self":[{"href":"https:\/\/it.billybaheux.fr\/index.php\/wp-json\/wp\/v2\/posts\/37"}],"collection":[{"href":"https:\/\/it.billybaheux.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.billybaheux.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.billybaheux.fr\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/it.billybaheux.fr\/index.php\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":6,"href":"https:\/\/it.billybaheux.fr\/index.php\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"predecessor-version":[{"id":77,"href":"https:\/\/it.billybaheux.fr\/index.php\/wp-json\/wp\/v2\/posts\/37\/revisions\/77"}],"wp:attachment":[{"href":"https:\/\/it.billybaheux.fr\/index.php\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.billybaheux.fr\/index.php\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.billybaheux.fr\/index.php\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}