linux:commands

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
linux:commands [2025/11/04 23:49] – [Commandes Linux] add link about nano config phswlinux:commands [2025/11/07 22:21] (Version actuelle) – [sed] add how to print nth line after a matching line phsw
Ligne 474: Ligne 474:
 <code bash> <code bash>
 sed -n -e '/^BEGIN$/,/^END$/{/^BEGIN$/d;/^END$/d;p;}' input sed -n -e '/^BEGIN$/,/^END$/{/^BEGIN$/d;/^END$/d;p;}' input
 +</code>
 +
 +
 +=== N'affiche que les deuxièmes lignes après un motif ===
 +
 +  * [[https://www.baeldung.com/linux/show-nth-line-after-match|Source]]
 +
 +<code>
 +Truc
 +Foo:
 +Machin
 +Ligne à afficher
 +Truc
 +Foo:
 +sdfs
 +Ligne à afficher
 +sdfs
 +</code>
 +
 +
 +<code bash>
 +sed -n '/Foo:/{n;n;p}' $file
 </code> </code>
 ==== sort === ==== sort ===
  • linux/commands.1762296568.txt.gz
  • Dernière modification : 2025/11/04 23:49
  • de phsw