Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux/Unix command to check when a file was renamed [closed]

Tags:

linux

unix

Is there a specific Unix/Linux command that would show when a file was renamed? I have a file in a Linux box and want to know when the file got renamed. I tried ls -ltr but that command only shows the date when it was created and not when it was last modified.

Is there a specific Unix/Linux command to do this?

like image 978
user2579439 Avatar asked Jul 22 '13 14:07

user2579439


People also ask

Can you see when a file was renamed?

There's no way to tell for sure whether a file has been renamed. When a file is renamed, its inode number doesn't change. (This may not be true for “exotic” filesystems, such as network filesystems, but it's true for all “native” Unix filesystems.)

How do you check when a file was last opened Linux?

Give me the files, stat!The stat command can show file size, type, UID/GUID and the access/modify time. Here is the stat of my “/etc” folder. Notice the simplicity of the command. You can see the date it was last accessed, the modify time and the last change.

How can I tell who changed a file in Linux?

You can use the ls command to list files including their modification date by adding the -lt flag as shown in the example below. The flag -l is used to format the output as a log. The flag -t is used to list last modified files, newer first.

How do you tell if a file has been edited?

You can use the stat command on a file to check access and modification times or set up RCS to track changes. You can use MD5 or sum to get the current state of the file, copy that value to a file and then that file to verify that the original file wasn't changed.


1 Answers

You can use

stat filename

Check Access when it was last read.

Check Modify when it was updated.

Check Change if it was renamed.

Plus other file info like blocks, inodes, etc.

like image 186
bsd Avatar answered Sep 27 '22 17:09

bsd