My Profile Photo

Sheogorath's Blog

Skipping the first line

Today I learned how to skip the first line in a shell output using tail. It’s as simple as tail -n '+<line to start>'. For example tail -n '+2' for skipping the first line.

I came across this while working on my git mirror project, where I finally used the github-orga-call.sh script, which provides a list of URLs. Since it currently still output the URL of the organisation itself, I wanted to skip that for my pipe output. While I faced this in the past but often ignored or greped it, this time I took the 2 minutes to research and turns out I learned a handy parameter of tail.