Pense-bête: lignes de commandes

Date: 29/03/2010 | Catégories: Open-source,Systeme | Tags: ,,,,,

Voici un nouvel article que je vais faire évoluer dans le temps au fil de mes découvertes. Le but est d'y centraliser (avec un classement par thème) les lignes de commandes Unix utiles et que j'ai toujours beaucoup de mal à retenir (c'est l'âge mon bon monsieur).

Lecteurs, vous êtes libre d'enrichir cette base avec vos commentaires.

Fichiers & répertoires

Affiche la taille d'un répertoire en octets.

Syntaxe:

[shell]

du -sh /mon/path | awk '{print $1}'

[/shell]

Exemple:

[shell]

du -sh /usr/local/ |awk '{print $1}'

375M

[/shell]

Système

Ajoute un dépôt PPA sous Ubuntu (9.04 ou supérieur).

Syntaxe:

[shell]

sudo add-apt-repository ppa:nicolargo

[/shell]

Exemple:

[shell]
gpg: requête de la clé CEC06767 du serveur hkp keyserver.ubuntu.com
gpg: clé CEC06767: clé publique « Launchpad Nicolargo PPA » importée
gpg: Quantité totale traitée: 1
gpg:               importée: 1  (RSA: 1)
[/shell]

Réseau

Affiche les informations sur sa carte réseau.

Syntaxe:

[shell]

sudo mii-tool -v

[/shell]

Exemple:

[shell]

eth0: negotiated 100baseTx-FD flow-control, link ok
product info: vendor 00:50:43, model 11 rev 1
basic mode:   autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

[/shell]

Affiche son adresse IP publique.

Syntaxe:

[shell]

curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+"

[/shell]

Exemple:

[shell]

89.122.166.229

[/shell]

Affiche les ports réseau en écoute sur sa machine.

Syntaxe:

[shell]

sudo lsof -Pni4 | grep LISTEN

[/shell]

Exemple:

[shell]

sshd        912  root    3u  IPv4    4255      0t0  TCP *:22 (LISTEN)
netserver  1355  root    4u  IPv4    5747      0t0  TCP *:12865 (LISTEN)
ntop       1456  ntop    1u  IPv4    6080      0t0  TCP *:3000 (LISTEN)
master     1549  root   12u  IPv4    6175      0t0  TCP *:25 (LISTEN)
cupsd      1644  root    6u  IPv4  649219      0t0  TCP 127.0.0.1:631 (LISTEN)
beam.smp   2256  labo   16u  IPv4   11238      0t0  TCP 127.0.0.1:44732 (LISTEN)
dropbox   15432  labo   19u  IPv4  227846      0t0  TCP *:17500 (LISTEN)

[/shell]

Tester sa connectivité réseau de bout en bout avec mtr (ping+traceroute).

Syntaxe:

[shell]

mtr www.google.fr

[/shell]

Exemple:

Audio/video

Encoder un VOB DVD vers un OGG Theora en qualité correcte.

Syntaxe:

[shell]
ffmpeg2theora -V 900 -x 540 --first-pass log input.vob -o output.ogv</code>  <code>; ffmpeg2theora -V 900 -x 540 --second-pass log input.vob -o output.ogv
[/shell]

Exemple:

'

A vous de sheller...

Partager ce billet





WordPress » Erreur

Il y a eu une erreur critique sur ce site.

En apprendre plus sur le débogage de WordPress.