1
vote
1answer
126 views

Delete specific line from hosts

I want to delete specific line from hosts file in my home dir: ~$ echo "193.10.1.1 localhost" >> hosts ~$ echo "127.0.0.1 localhost" >> hosts ~$ cat hosts 193.10.1.1 localhost 127.0.0.1 ...
0
votes
1answer
407 views

Perform a math operation on all numbers in a file

I have a list of pixel values in a file, and need each to be half its current value. The pattern for the value is always 123px where 123 varies drastically. How can I half each pixel value? I'm ...
1
vote
3answers
2k views

Using sed to replace text from a list of files from find

Given the following find command: find . | xargs grep 'userTools' -sl How can I use sed on the results of that command? output: ./file1.ext ./file2.ext ./file3.ext
24
votes
10answers
13k views

How to Remove the Last 2 Lines of a Very Large File

I have a very large file ~400G, and I need to remove the last 2 lines from it. I tried to use sed, but it ran for hours before I gave up. Is there a quick way of doing this, or am I stuck with sed?