I'm using merge cap to create a merge pcap file from 15 files. For the merged file, I have changed the name to that of the first of the 15 files. But I would also like to change the merged file's attributes like "Date Created" and "Last Modified" to that of the first one. Is there anyway to do this? I try to access the merged files over a samba server Ubuntu.
So that an extractor function can access auto extract the files to D folder. But as the created date will be changed for the merged file the extraction fails. Is there anyway to fix this? You can use the touch command along with the -r switch to apply another file's attributes to a file. For example purposes here's a goldenfile that was created with some arbitrary timestamp.
I just confirmed that I'm able to do this using my Fedora 19 laptop which includes version 1. I was able to touch a file as I mentioned above and it worked as I described. Your issue is likely a problem with the either the mounting options being used, which may be omitting the tracking of certain time attributes, or perhaps it's related to one of these bugs:. All you have to do is put back your date and time of your system to any date and time you want, create again your file with touch command or anything and edit it content.
Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Asked 7 years, 10 months ago. Active 7 months ago. Viewed k times. Improve this question. S: i dont want to change the system date to older one and try. Thanks, Pandeeswaran. Join Date: Dec I Believe you can do this by touch command Code :. Code :. Its awesome! Join Date: Mar The file creation date is the one date you cannot change with "touch".
Originally Posted by methyl. Join Date: Feb The file creation date ctime is not really the creation date in unix, it is the last time the inode data and some other metadata was modified.
Shell Programming and Scripting. Hi All, I am new in scripting and working in a project where we have RSyslog servers over CentOS v7 and more than network devices are sending logs to each RSyslog servers. For each network devices individual folders create on the name of the each network devices IP addresses. The main Find the file created on current date. Hi All, I'm trying to find a file which is created on current day I searched in unix. How to get year part from file created date?
Hi Gurus, I need to get year part of file created date. Thanks in advance 7 Replies. It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. As long as you are the owner of the file or root , you can change the modification time of a file using the touch command:. By default this will set the file's modification time to the current time, but there are a number of flags, such as the -d flag to pick a particular date.
So for example, to set a file as being modified two hours before the present, you could use the following:. If you want to modify the file relative to its existing modification time instead, the following should do the trick:. You can change the arguments to find to select only the files you are interested in. If you only want to update the file modification times relative to the present time, you can simplify this to:.
This form isn't possible with the file time relative version because it uses the shell to form the arguments to touch. As far as the creation time goes, most Linux file systems do not keep track of this value.
There is a ctime associated with files, but it tracks when the file metadata was last changed. If the file never has its permissions changed, it might happen to hold the creation time, but this is a coincidence. Explicitly changing the file modification time counts as a metadata change, so will also have the side effect of updating the ctime.
Touch can reference a file's date all by itself, no need to call date or use command substitution. Here's a bit from touch's info page:. For example, to add 8 hours to a file's date filename of file quoted just in case of spaces, etc :. For example, to find all files in thatdir whose filenames start with an s , and add one day to those file's modified timestamp, use:. It's been a long time since I wrote any kind of Unix program, but I accidentally set the year incorrectly on a bunch of Christmas photos, and I knew if I didn't change the date from to it would be a problem later on.
I modified a script I found here, which originally was used to modify the date by minus one month. Also, while touch -d "2 hours ago" or touch -a -m -t Ubuntu Community Ask! Sign up to join this community.
The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Learn more. Ask Question.
0コメント