commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
sed can be used deleting the last line and with -i option, there's no need to for temp files, the change is made on the actual file
There is 1 alternative - vote for the best!
Some malicious program appends a iframe or script tag to you web pages on some server, use this command to clean them in batch.
plays with bash arrays. instead of storing the list of files in a temp file, this stores the list in ram, retrieves the last element in the array (the last html file), then removes it.
If you can do better, submit your command here.
You must be signed in to comment.