- This removes the second line in a file.
- The
d
option in sed command is used to delete a line.
sed -i '2d' file
The built-in BSD sed is different than GNU sed and has different options.
brew install gnu-sed
Then create an alias so gnu-sed is always used:
alias sed=gsed