how to read file from line x to the end of a file in bash

前端 未结 7 520
慢半拍i
慢半拍i 2020-12-23 13:33

I would like know how I can read each line of a csv file from the second line to the end of file in a bash script.

I know how to read a file in bash:

7条回答
  •  情深已故
    2020-12-23 14:13

    There are many solutions to this. One of my favorite is:

    (head -2 > /dev/null; whatever_you_want_to_do) < file.txt
    

    You can also use tail to skip the lines you want:

    tail -n +2 file.txt | whatever_you_want_to_do
    

提交回复
热议问题