I have several files with same extension .txt in a directory. I want to remove the last line from all .txt files.
What I did is
find . -type f -name '*.txt' -exec sed '$d' {} \;
This prints the desired output from sed to the terminal for every .txt file.
What I want is to modify the respective files.