1
vote
2answers
219 views

batch find/replace using sed or awk

In every file with filename matching pattern1 I want to search for lines which start with pattern2, and add some string in a new line above those matched lines. As a simple example suppose I'm ...
3
votes
1answer
737 views

grep, xargs, sed to clean up PHP eval hack

I'm attempting to use the commands found on http://devilsworkshop.org/tutorial/remove-evalbase64decode-malicious-code-grep-sed-commands-files-linux-server/55587/ to clean up a PHP eval based hack on a ...
3
votes
3answers
987 views

combining sed with xargs to obtain a source and output file name

I have a situation where I have some input files like this: M2U0001.MPG M2U0180.MPG And I want to run a command (in a bash shell) on each similarly named file in the directory. I'd like the ...
1
vote
2answers
356 views

Passing the output of the last command to sed as an argument

Basically, I'm wanting to automate adding something to xorg.conf in the right place, I've used some commands to get the line number of the line I want to manipulate, but I'm not really sure how to go ...