Configurer apt-get pour un nettoyage automatique après chaque installation

Configurer apt-get pour un nettoyage automatique après chaque installation

Comment configurer apt-get pour un nettoyage automatique après chaque installation   Enfaîte rien de très compliquer, il suffit de tapez cette ligne dans votre terminal : Shell sudo sh -c "echo 'DSELECT::Clean "always";' >> /etc/apt/apt.conf.d/99AutomaticClean" 1 sudo sh -c "echo 'DSELECT::Clean "always";' >> /etc/apt/apt.conf.d/99AutomaticClean" La commande s’exécutera automatiquement après chaque apt-get upgrade. Plus d’information :...

Read More

Executer la commande d’un script dans le shell courant

Executer la commande d’un script dans le shell courant

Si vous voulez exécuter une commande (ou plusieurs) contenue d’un script, celle-ci ne s’exécute pas dans le shell courant, démonstration : 1. Voici un simple script (nome ch_dir) qui se déplace dans le répertoire /usr Shell #!/bin/bash cd /usr 123 #!/bin/bashcd /usr  2. Essayons de l’exécuter depuis le shell Shell morgan@morgan-pc:~$ ./ch_dir morgan@morgan-pc:~$ 12 morgan@morgan-pc:~$ ./ch_dirmorgan@morgan-pc:~$ On peux voir que je ne me suis pas déplacer dans le répertoire car un script s’exécute sur un fork du shell actuelle.   Pour pouvoir faire cela, il existe la commande source Shell morgan@morgan-pc:~$ help -m source NAME source - Execute des commandes depuis un fichier dans le shell actuel. SYNOPSIS source nom_fichier [arguments] DESCRIPTION Execute des commandes depuis un fichier dans le shell actuel. Lit et exécute des commandes depuis NOMFICHIER dans le shell actuel. Les éléments dans $PATH sont utilisés pour trouver le répertoire contenant NOMFICHIER. Si des ARGUMENTS sont fournis, ils deviennent les paramètres de position lorsque NOMFICHIER est exécuté. Code de sortie : Renvoie le code de la dernière commande exécutée dans NOMFICHIER, ou le code d'échec si NOMFICHIER ne peut pas être lu. SEE ALSO bash(1) IMPLEMENTATION GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2013 Free Software Foundation, Inc. Licence GPLv3+ : GNU GPL version 3 ou ultérieure <http://gnu.org/licenses/gpl.html> 1234567891011121314151617181920212223242526 morgan@morgan-pc:~$ help -m sourceNAME    source - Execute des commandes depuis un fichier dans le shell actuel. SYNOPSIS    source nom_fichier [arguments] DESCRIPTION    Execute des commandes depuis un fichier dans le shell actuel.        Lit et exécute des commandes depuis NOMFICHIER dans le shell actuel.  Les    éléments dans $PATH sont utilisés pour trouver le répertoire contenant NOMFICHIER.    Si des ARGUMENTS sont fournis, ils deviennent les paramètres de position    lorsque NOMFICHIER est exécuté.        Code de sortie :    Renvoie le code de la dernière commande exécutée dans NOMFICHIER, ou le code    d'échec si NOMFICHIER ne peut pas être lu. SEE ALSO    bash(1) IMPLEMENTATION    GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)    Copyright (C) 2013 Free Software Foundation, Inc.    Licence GPLv3+ : GNU GPL version 3 ou ultérieure <http://gnu.org/licenses/gpl.html>   Maintenant si je ré-exécute la même commande avec source, elle s’exécute bien dans le shell courant   Shell morgan@morgan-pc:~$ source ch_dir morgan@morgan-pc:/usr$ 12 morgan@morgan-pc:~$ source...

Read More

Comment savoir quel type de ram est utilisé

Comment savoir quel type de ram est utilisé

Imaginez que vous venez d’ajouter une barrette de RAM sur votre carte mère et que vous voulez vous assuré qu’elle a les même caractéristiques que l’ancienne, et bien pour ça aussi il existe une commande: il vous suffit d’utiliser lshw (en précissant la class mémoire) Exemple d’utilisation (Attention, il faut l’utiliser avec les droits administrateurs) : Shell sudo lshw -C memory 1 sudo lshw -C memory   Shell morgan@morgan-pc:~$ sudo lshw -C memory *-firmware description: BIOS fabriquant: Dell Inc. identifiant matériel: 0 version: 2.3.0 date: 11/11/2010 taille: 64KiB capacité: 1984KiB fonctionnalités: isa pci pnp apm upgrade shadowing escd cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer int10video acpi usb ls120boot zipboot biosbootspecification *-cache:0 description: L1 cache identifiant matériel: 5 emplacement: L1-Cache taille: 256KiB capacité: 256KiB fonctionnalités: internal write-through instruction *-cache:1 description: L2 cache identifiant matériel: 6 emplacement: L2-Cache taille: 1MiB capacité: 1MiB fonctionnalités: internal write-through unified *-cache:2 description: L3 cache identifiant matériel: 7 emplacement: L3-Cache taille: 8MiB capacité: 8MiB fonctionnalités: internal write-back unified *-memory description: Mémoire Système identifiant matériel: e emplacement: Carte mère taille: 8GiB *-bank:0 description: DIMMProject-Id-Version: @(#) $Id$Report-Msgid-Bugs-To: POT-Creation-Date: 2009-10-08 14:02+0200PO-Revision-Date: 2014-03-11 13:12+0000Last-Translator: Lyonel Vincent <Unknown>Language-Team: MIME-Version: 1.0Content-Type: text/plain; charset=UTF-8Content-Transfer-Encoding: 8bitX-Launchpad-Export-Date: 2014-07-07 12:12+0000X-Generator: Launchpad (build 17086) Synchrone 1333 MHz (0,8 ns) produit: CMV4GX3M1A1333C9 fabriquant: Manufacturer00 identifiant matériel: 0 numéro de série: 00000000 emplacement: DIMM0 taille: 4GiB bits: 64 bits horloge: 1333MHz (0.8ns) *-bank:1 description: DIMMProject-Id-Version: @(#) $Id$Report-Msgid-Bugs-To: POT-Creation-Date: 2009-10-08 14:02+0200PO-Revision-Date: 2014-03-11 13:12+0000Last-Translator: Lyonel Vincent <Unknown>Language-Team: MIME-Version: 1.0Content-Type: text/plain; charset=UTF-8Content-Transfer-Encoding: 8bitX-Launchpad-Export-Date: 2014-07-07 12:12+0000X-Generator: Launchpad (build 17086) [vide] produit: ModulePartNumber01 fabriquant: Manufacturer01 identifiant matériel: 1 numéro de série: SerNum01 emplacement: DIMM1 *-bank:2 description: DIMMProject-Id-Version: @(#) $Id$Report-Msgid-Bugs-To: POT-Creation-Date: 2009-10-08 14:02+0200PO-Revision-Date: 2014-03-11 13:12+0000Last-Translator: Lyonel Vincent <Unknown>Language-Team: MIME-Version: 1.0Content-Type: text/plain; charset=UTF-8Content-Transfer-Encoding: 8bitX-Launchpad-Export-Date: 2014-07-07 12:12+0000X-Generator: Launchpad (build 17086) Synchrone 1333 MHz (0,8 ns) produit: CMV4GX3M1A1333C9 fabriquant: Manufacturer02 identifiant matériel: 2 numéro de série: 00000000 emplacement: DIMM2 taille: 4GiB bits: 64 bits horloge: 1333MHz (0.8ns) *-bank:3 description: DIMMProject-Id-Version: @(#) $Id$Report-Msgid-Bugs-To: POT-Creation-Date: 2009-10-08 14:02+0200PO-Revision-Date: 2014-03-11 13:12+0000Last-Translator: Lyonel Vincent <Unknown>Language-Team: MIME-Version: 1.0Content-Type: text/plain; charset=UTF-8Content-Transfer-Encoding: 8bitX-Launchpad-Export-Date: 2014-07-07 12:12+0000X-Generator: Launchpad (build 17086) [vide] produit: ModulePartNumber03 fabriquant: Manufacturer03 identifiant matériel: 3 numéro de série: SerNum03 emplacement: DIMM3 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 morgan@morgan-pc:~$ sudo lshw -C memory  *-firmware                     description: BIOS       fabriquant: Dell Inc.       identifiant matériel: 0       version: 2.3.0       date: 11/11/2010       taille: 64KiB       capacité: 1984KiB       fonctionnalités: isa pci pnp apm upgrade shadowing escd cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer int10video acpi usb ls120boot zipboot biosbootspecification  *-cache:0       description: L1...

Read More