mirror of
https://github.com/onceupon/Bash-Oneliner
synced 2024-11-22 20:54:19 +00:00
add sed
add string to beginning of file
This commit is contained in:
parent
c94a0b8a18
commit
ba9a274113
1 changed files with 5 additions and 0 deletions
|
@ -236,6 +236,11 @@ sed '$d'
|
|||
sed -i '$ s/.$//' filename
|
||||
```
|
||||
|
||||
##### Add string to beginning of file (e.g. "\[")
|
||||
```bash
|
||||
sed -i '1s/^/[/' file
|
||||
```
|
||||
|
||||
##### Add string to end of file (e.g. "]")
|
||||
|
||||
```bash
|
||||
|
|
Loading…
Reference in a new issue