Tag Info

New answers tagged

1

assuming you are ok with a flat destination folder (everything moved to the same place): find /<top_level_folder> -type f -ctime -365 -exec cp -f {} /<new_folder_destination> \;


6

Try this: touch -d"April 13 3 AM" file1 touch -d"April 13 9 AM" file2 find . -newer file1 ! -newer file2 -exec grep -l "pcV6URY" {} + rm file1 file2 How it works find can work directly with times but touch handles human-style dates better: touch -d"April 13 3 AM" file1; touch -d"April 13 9 AM" file2 This creates two files to mark the beginning and end ...


0

Your happy hacky solution is something along these lines (as root): export NOW=$(date); watch -n1 date --set=\"$NOW\" But it's probably not a grand idea :)


0

There'a a very neat tool called warp that makes it possible to adjust how the time for a given process is to be adjusted in arbitrary ways - e.g. shifted and even scaled! - while the global system time is unaffected. The time adjustment formula is time = time + warp + (time - base) * (factor - 1). Details are described on the warp manpage. The method it uses ...


3

I don't think you can pause system time. Lots of programs wouldn't like it anyway, because they generally expect time to go forward. If you paused the time, then any program going into sleep would never wake up. I don't understand exactly what you're trying to do, but I suspect that faketime would do what you're after. It lets you run programs with a fake ...


10

The system does not track that information. Every time the file is modified, the new modification time overwrites the previous one. Depending on what exactly you need to do, various alternate solutions might apply, such as using a version control system, or having a daemon that watches for changes using inotify. But all of those solutions would rely on ...


1

It's the same. You just have to provide the parent directory rather than the prefix of files. In your example, it would be: find /path/to -type f -mtime +5 -exec rm {} \; This will delete all the files older than 5 days which are under /path/to and its sub-directories. To delete empty sub-directories, refer to @Costas comment above.


1

Let's call ue the file with event timestamps, and ul the file with the logs. I came up with a very intuitive way: ( awk '{printf "%s a\n",$1 }' ul ; awk '{printf "%s b\n",$1 }' ue ) |\ sort |\ awk '/b/ { print before ;} /a/ { before=$1 ;} ' Which adds a tag to list of events and timestamps, you can use any tag, but logfile tag must come before event ...


3

My ideal goal would be to get 20150331 date -d @1427792481 +"%Y%m%d"


2

You can try this: date -d @1427792481 +"%F" or for 20150331: date -d @1427792481 +"%Y%m%d"



Top 50 recent answers are included