2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-17 09:25:32 +00:00
Commit Graph

4 Commits

Author SHA1 Message Date
alexberry
3f48743dee
g flag is per-line, not per-file
Make comment clearer
2020-02-02 10:45:33 +00:00
alexberry
b2ef20e0d9
Forgot to add paths as utilised -i
Must add a file path when not piping to sed.
2020-02-02 10:32:28 +00:00
alexberry
b2210a9ca2
Adding a few more useful examples.
Sed's cheat sheet was a little light, here are a few more examples.
2020-02-02 10:29:36 +00:00
terminalforlife
76109ca8cd Add 'sed' and give example of in-place changes
The `-i` flag with `sed` means "in-place", if you're curious; the use
thereof allows for making actual changes to the file, not just
superfluously, such as for additional parsing.

The `s///` is a simple substitution, wherein the `s` marks that it's a
substitution, the `/` marks the boundaries*, and the final boundary can
be suffixed with various flags, such as `g`, for global operations, -
and `i`, for case-insensitive operations.

* required, but the slash can switched for something else, if needed, -
such as `|`, which is commonly used for paths. For example:

  `s|/path/to/file|/path/file|`
2019-11-06 15:22:56 +00:00