Skip to content

Commit

Permalink
[ DOC ]: Add sed command to useful commands
Browse files Browse the repository at this point in the history
  • Loading branch information
a1eksb committed Jul 15, 2024
1 parent 3725d5c commit 5a96c84
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/docs/dev_notes/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ title: Commands

This is a collection of useful linux commands that can be easily copy pasted.

#### General

**Replacing lines in a file**
```bash linenums="1"
- sed -i 's/^key_in_file=.*$/key_in_file=new_value/' ./path/to/my_file.txt
```
This will iterate over all lines of `./path/to/my_file.txt` and apply the specified changes. In this case these changes are the value of the `key_in_file` key. The sed command can also be used to apply the same changes to outputs of other functions.


#### GIT

**View all remotes**
Expand Down

0 comments on commit 5a96c84

Please sign in to comment.