在Linux中,你可以使用tail
命令來去掉文件的第一行
tail -n +2 input_file > output_file
這里,input_file
是你要處理的文件名,output_file
是去掉第一行后的新文件名。-n +2
參數(shù)告訴tail
從第二行開始輸出。
例如,如果你有一個名為example.txt
的文件,你可以使用以下命令去掉第一行:
tail -n +2 example.txt > example_without_first_line.txt
這將創(chuàng)建一個名為example_without_first_line.txt
的新文件,其中不包含原始文件的第一行。