How can I delete the first (!) line of a text file if it\'s empty, using e.g. sed or other standard UNIX tools. I tried this command:
sed \'/^$/d\' < somefile
Using sed, try this:
sed -e '2,$b' -e '/^$/d' < somefile
or to make the change in place:
sed -i~ -e '2,$b' -e '/^$/d' somefile