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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -236,6 +236,11 @@ sed '$d'
sed -i '$ s/.$//' filename 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. "]") ##### Add string to end of file (e.g. "]")
```bash ```bash