Question : copy first 10 lines of a file to another file in unix
Answered by : brainy-booby-g7p5v1crzck6
sed -n '1,10p' filename > newfile
Source : | Last Update : Fri, 05 Mar 21
Question : copy first 100 lines from a file linux
Answered by : witty-wallaby-vjweu4yawnbb
head -n10 file.txt >> newfile.txt
echo "your line >> newfile.txt
tail -n +10 file.txt >> newfile.txt
Source : https://stackoverflow.com/questions/1325701/how-to-copy-the-first-few-lines-of-a-giant-file-and-add-a-line-of-text-at-the-e | Last Update : Fri, 03 Dec 21