Print a specific range of lines from a file
print lines 100 to 120 of a file | show specific lines of a file linux | sed print line range | sed | lines | excerptsed -n '100,120p;120q' /var/www/vhosts/example.com/httpdocs/wp-config.phpPrints only the lines within the given range, -n suppresses all others. The ;BISq suffix makes sed quit after the last requested line, so even huge log files are not read to the end. Useful when PHP reports an error with a line number.
Note: With line numbers for orientation: nl -ba datei | sed -n '100,120p'.
Also searched as
- print lines 100 to 120 of a file
- show specific lines of a file linux
- sed print line range