Shell/Bash: linux remove last line from file Example

By

Shell/Bash Example: This is the "linux remove last line from file" Example. compiled from many sources on the internet by SimpleTutorials.org

linux remove last line from file

sed '$d' 
sed -i '$d'  # to edit in place

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



* Summary: This "linux remove last line from file" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!

Others