Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 491 Bytes

unix_rm_lines_in_file.md

File metadata and controls

24 lines (18 loc) · 491 Bytes

remove first line of file

$ tail -n +2 mailing100k.csv > mail100k.csv

get number of lines in file

$ wc -l filename.txt    # get number of lines in a specific file
$ wc -l tweets.json

$ wc -l *               # get line numbers of all files in directory

take lines, after row 20,000 and put in new file

$ tail -n +20001 mail100k.csv > mail80k.csv
```

take lines 1 to 20,000 and put in new file
```
$ tail -n +1 mail100k.csv | head -n 20000 > mail20k.csv
```