Sponsored Content
Top Forums UNIX for Advanced & Expert Users mv command and file-timestamps Post 302078725 by gian1975 on Tuesday 4th of July 2006 07:49:27 AM
Old 07-04-2006
mv command and file-timestamps

Hi all,

I need help to find out if it is possible (if so, how? Smilie ) to move a hard link to a given file without making the main file i-node modification time change.


That is:
I have a file myFile.txt ,
and I have a link myLink.dat to that file (obtained by: ln myFile.txt myLink.dat).
I have to move the link: mv myLink.dat ../ without changing the modification time of the i-node for the file "myFile.txt".

Is it possible? Smilie

Many thanks!! Smilie

Gian
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find command to get the timestamps

I want to have the timestamps of the files containing a specific string in them. I have tried using different combinations of find command and grep and ls but not giving the desired output. find $HOME/bin/shells -name "*" -print -exec ls -Flt {} -exec grep -i "abc" '{}' \; Please help. (8 Replies)
Discussion started by: nguda
8 Replies

2. UNIX for Dummies Questions & Answers

find command not giving file names accord. to timestamps

Currently iam working on solaris environment, Iam using find command to get list of all files between any two given dates. But the find command is not listing files accord. to timestamp. I tried using -exec option as -exec ls -ltr {} \; Still the files are not listed according to timestamp..... (8 Replies)
Discussion started by: thanuman
8 Replies

3. Shell Programming and Scripting

File timestamps in different servers.

Hello, I need to gather timestamps and file sizes of all the list of files in different servers. The servers and file locations will be different for each file. I'm thinking of keeping a comman delimited file with {source_server_name,source location, file name} as records in the file. So, I... (1 Reply)
Discussion started by: bperl
1 Replies

4. Shell Programming and Scripting

shell script to search content of file with timestamps in the directory

hello, i want to make a script to search the file contents in my home directory by a given date and output me the line that has the date... (10 Replies)
Discussion started by: psychobeauty
10 Replies

5. Shell Programming and Scripting

HOWTO - File Timestamps - how old is a file?

Hi all, Can anyone please advise how to get/display the timestamp of a file and at the same time display how old the file is? For example, if I have a file that is created on January 01, 2011 at 1000 and today is January 03, 2011 2200, I want a script to be able to display the timestamp... (2 Replies)
Discussion started by: newbie_01
2 Replies

6. Shell Programming and Scripting

How to fetch data between two timestamps in a file using KSH

Hi, I got a requirement to fetch data between two time stamps in a big log file and grep for a word in that particular time interval of data. Here is my log looks like: 2012/04/08-14:35:56 Abcdefg 2012/04/08-14:35:56 Hijklmnophhoishfw 2012/04/08-14:35:56... (1 Reply)
Discussion started by: siri_886
1 Replies

7. Shell Programming and Scripting

[Shell/Perl(?)] Prepending timestamps to console output & writing results to a file

I do a lot of TSM work and I embarked on what I thought would be an easy task, and I'd be very happy for any input to save the pounding my keyboard is receiving :] By default, the output of TSM's console has no timestamping, making it hard to sort through accurately. This puts my console into... (5 Replies)
Discussion started by: Vryali
5 Replies

8. Shell Programming and Scripting

To search lines between two timestamps in a file

I have a log file where every line starts with a time stamp. I have to extract lines from the file within a given time stamp. For example: IF the file is like this: 2012-08-19 10:34:03,446|WebContainer : 56|OrderHeaderDaoImpl|findByKeys|26| 2012-08-20 11:34:03,463|WebContainer :... (8 Replies)
Discussion started by: abhinalluri
8 Replies

9. Shell Programming and Scripting

Search lines between two timestamps in a file

Hi, I want to pull lines between two timestamps from a file. When I just insert values directly it is working fine. sed -n '/2014-02-14 05:30/,/2014-02-14 05:31/p' Logfile When I try to insert variable it is not working. sed -n '/TZ=GMT+1 date +%Y-%m-%d" "%H:%M:%S/,/TZ=GMT date... (2 Replies)
Discussion started by: Neethu
2 Replies

10. Shell Programming and Scripting

Find file between timestamps Query

On my linux box, I have a file say dump.txt. I then need to move to another seperte folder and need to find only one file with extension *.tar that has the closest timestamp after / next to the timestamp of the dump.txt. (2 Replies)
Discussion started by: mohtashims
2 Replies
FUTIMES(3)						     Linux Programmer's Manual							FUTIMES(3)

NAME
futimes, lutimes - change file timestamps SYNOPSIS
#include <sys/time.h> int futimes(int fd, const struct timeval tv[2]); int lutimes(const char *filename, const struct timeval tv[2]); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): futimes(), lutimes(): _BSD_SOURCE DESCRIPTION
futimes() changes the access and modification times of a file in the same way as utimes(2), with the difference that the file whose time- stamps are to be changed is specified via a file descriptor, fd, rather than via a pathname. lutimes() changes the access and modification times of a file in the same way as utimes(2), with the difference that if filename refers to a symbolic link, then the link is not dereferenced: instead, the timestamps of the symbolic link are changed. RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately. ERRORS
Errors are as for utimes(2), with the following additions for futimes(): EBADF fd is not a valid file descriptor. ENOSYS The /proc file system could not be accessed. The following additional error may occur for lutimes(): ENOSYS The kernel does not support this call; Linux 2.6.22 or later is required. VERSIONS
futimes() is available since glibc 2.3. lutimes() is available since glibc 2.6, and is implemented using the utimensat(2) system call, which is supported since kernel 2.6.22. CONFORMING TO
These functions are not specified in any standard. Other than Linux, they are available only on the BSDs. SEE ALSO
utime(2), utimensat(2), symlink(7) COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2013-03-15 FUTIMES(3)
All times are GMT -4. The time now is 01:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy