bash first occurrence in log file I looking to write a bash shell script to parse a log file for the first occurance of a date and then once that date is found, the contents of the rest of the log file will be copied to a new file. Here is a simplified example of a log file (test.log) 2010-01-05 .... 2010-01-06 .... 2010-01-07 .... 2010-01-0... 8 Jan 2010 17:18
Q. How do I get bash to respect my physical directory structure? If in bash, I do "set -P" then bash follows the "physical directory structure" when doing "pwd" and "cd .." etc, rather than the "logical one" that might be defined via symlinks. Unfortunately, bash still doesn't obey the physical directory structure for filename completion. How can I get bash to respect my authori... 7 Jan 2010 15:48
multiple scp using xargs I have a lot of files I need to copy to another server using scp (secure copy). For efficiency reasons I want to minimize the number of scp invocations. So, logically I would like to do this: find ... [files] | xargs -i scp {} user(a)server:/somedir Unfortunately, I have to use the replacement string {} since... 6 Jan 2010 11:56
What's the point of using tar *for backup* today? I see the point of using tar in order to, say, send a whole directory as a single attachment file. I realize historically this "tape archive" utility may have been needed for some technical reasons. But I don't see the advantages of using tar to back up some files and copy them to some external storage device. Coul... 6 Jan 2010 16:33
find files from specific date Hi all, I searched similar post about, but some of them i didn't understand and the others were about file name manipulation. what i want is just list the files of an specific hour (any minute) from specific date. i stuck with the hour part. ls -l | awk ' if (($6=="Dec") && ($7=="29") && ( $8 ~ /08/ )) {print ... 31 Dec 2009 16:32
unzip | touch | re-zip Hi, I want to set the file modification times of files stored in a zip file. I think I could work out how to unzip the files to a temporary location, hit them with touch to modify their timestamps, and then store them back in a new zip file that overwrites the original. I then have to clean-up the temporary... 3 Jan 2010 11:36
Redirect stdout and stderr preserving the original order Hi all, There was a question on a web forum on how to redirect stdin and stderr in the following manner: - two separate files for both streams - a third file containing both streams in their original order We haven't come up with a solution and I'm curious to hear your opinion. For instance, let's say we ha... 1 Jan 2010 04:23
list out thousand of files Hi, There is a directory with many subdirectories and many files in these subdirectories. I wanna list out files (just their creation date and path) created on Dec 25th and before from all the subdirectories excluding certain subdirectories eg BACKUP, N*. So I fired the find command from the respective directo... 27 Dec 2009 15:12
~~~~~~~~~~~~~~ WATERBED MATTRESS ~~~~~~~~~~~~~~ .. ~~~***~~~ ================================================== ================================================== ENTER HERE: http://full-base.com/3/waterbed-mattress <<< ==============================================... 26 Dec 2009 11:05
~~~~~~~~~~~~~~ TRAILER LIGHTS ~~~~~~~~~~~~~~ .. ~~~***~~~ ================================================== ================================================== ENTER HERE: http://full-base.com/3/trailer-lights <<< =================================================... 26 Dec 2009 08:55 |