Skip to content

Instantly share code, notes, and snippets.

@momota10
Created February 1, 2015 09:00
Show Gist options
  • Save momota10/9a1f8ffb22148282f33c to your computer and use it in GitHub Desktop.
Save momota10/9a1f8ffb22148282f33c to your computer and use it in GitHub Desktop.
先頭の行に任意の文字列を追加するコマンド
sed -i '' '1s/^/test0/' test.txt
@momota10
Copy link
Author

momota10 commented Feb 1, 2015

元ファイル
test.txt
test1
test2

コマンド入力後
test.txt
test0test1
test2

※phpでは\nを入れると改行できる

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment