Replacing strings in files based on certain search criteria is a very common task. How can I replace string foo with bar in all files in the current directory? do the same recursively for sub ...
I have several files which contain some PHP includes and I want to substitute them with the file contents. The file looks like foo <?php include("file1.php"); ?> bar baz <?php ...
Recently, I just had an idea which turned out to be pretty useful under certain circumstances. But first some simple explanation: In Perl, you have the option to tie variables to some functions ...
I am looking for a single line shell script or unix command to find the newest 500 files in a directory. Major constraints are it should be POSIX complaint and the directory can have tons of files.
File1 Contents: line1-file1 "1" line2-file1 "2" line3-file1 "3" line4-file1 "4" File2 Contents: line1-file2 "25" line2-file2 "24" Pointer-file2 "23" ...