add string to beginning of file
This commit is contained in:
onceupon
2018-08-21 14:04:03 +08:00
committed by GitHub
parent c94a0b8a18
commit ba9a274113

View File

@ -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