Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running some simulation on a high performance computing cluster (HPC). When I check when the file was changed with ls -t I get the wrong result. I know this becouse I have run a small job that print a different file from the one that was pressent during when the server claims it was last changed.

Is there any other way?



ls -lut
total 328
-rw-r--r-- 1 avityo ofarago  89070 Nov 23 21:17 mem.xyz
-rwxr-xr-x 1 avityo ofarago 218752 Nov 23 21:17 mem
-rw-r--r-- 1 avityo ofarago    404 Nov 23 21:17 propFile.dat
-rw-r--r-- 1 avityo ofarago    271 Nov 23 14:01 parOut.txt

after I run cat parOut.txt (which is the main file that I follow):

ls -lut
total 328
-rw-r--r-- 1 avityo ofarago    271 Nov 24 11:47 parOut.txt
-rw-r--r-- 1 avityo ofarago  89070 Nov 23 21:17 mem.xyz
-rwxr-xr-x 1 avityo ofarago 218752 Nov 23 21:17 mem
-rw-r--r-- 1 avityo ofarago    404 Nov 23 21:17 propFile.dat

The files themself are stored on some sort of central file system server that I don't know anything about

share|improve this question
I cannot understand how does it works the test you use to say that ls is wrong. Can you explain better, please? – enzotib Nov 24 '11 at 7:53
Could you show output of both ls -t and ls -al – bbaja42 Nov 24 '11 at 8:21
Where do you store the file and from where do you check the file? Please be more precise and explain exactly what you do. – ddeimeke Nov 24 '11 at 8:21
Use ls -l and check the file times manually. – amphetamachine Nov 24 '11 at 8:45
You are using -u option, that in combination with -lt shows and sorts by access time, not modification time as you ask. – enzotib Nov 24 '11 at 10:51

Enzotib provided the correct answer in the comments on your original question. However there are still potential issues. You said the files are being stored on a remote file system. Most remote filesystems will use the time of the file server itself for the ctime, mtime, and atime attributes. Thus if the time of your file server is off, the times on the files will not be accurate.

share|improve this answer
I don't know if that's relevant or not but the date command provides the right time. – Yotam Nov 24 '11 at 20:33
@Yotam: That's only half the story. You've confirmed that the clock on your local system is set correctly, but not that the clock in the server is set correctly. To test that, try something like this: date ; touch /some/new/file/on/server ; ls -l /some/new/file/on/server ; date. See if the output is consistent. (Creating and listing the file might take some time; the two date commands give you a possible range of correct times). – Keith Thompson Nov 24 '11 at 22:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.