Sostituire stringhe in un file con sed

From RVM Wiki
Revision as of 13:42, 29 May 2009 by Gabriele.vivinetto (talk | contribs) (New page: Questo comando cancella tutte le righe nel file /tmp/data.txt che contengono la stringa "Windows": sed -i 's/Windows/Linux/' file1 file2 file3 Lo switch '''-i''' fa si che il file venga...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Questo comando cancella tutte le righe nel file /tmp/data.txt che contengono la stringa "Windows":

sed -i 's/Windows/Linux/' file1 file2 file3

Lo switch -i fa si che il file venga editato "in place", e si possono dare più files come argomenti.

Riferimenti