GNU sed
sed -i "37d" /path/to/file
sed
in macOS runs a bit differently than GNU as you have to define a backup file extension before editing the original file:
sed -i.bak "37d" /path/to/file
Both of the above will remove line 37 from the specified file.
d
is the command to delete a pattern space, while 37
stands for the 37th line.
In macOS it will create a backup of the original file first based on the extension given after the -i
flag, in this case being .bak
. A /path/to/file.bak
will be created and the original file will be updated with the removed line 37.