Answers for "linux remove last line from file"

2

linux remove last line from file

sed '$d' <file>
sed -i '$d' <file> # to edit in place
Posted by: Guest on December-15-2020
2

bash delete the last line of a file

# Basic syntax:
sed -i '$d' input_file

# Note, -i means that the input_file will be modified in place
Posted by: Guest on October-04-2020

Code answers related to "linux remove last line from file"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language