Change time stamp of a file

Hi,

As i know , we can change the time stamp of a file by touch command, i did change in a file and it is looking as given

# ls -l abcd
-rw-r--r--   1 batsoqa    sicusers         0 Feb 17  2010 abcd

actually i want to see the output like this

-rw-r--r--   1 batsoqa    sicusers         0 Feb 17 10:50 abcd

Please let me know how we can get this type of output by using touch command.

Thanks
Amit

Try with below command:
The general format is:

touch -t YYYYMMDDHHMM.SS file_name/dir_name
touch -t 201002171050.00  abcd

try this,

ls -l --time-style="+%b %d %R" abcd

By default ls displays Mon dd ccyy format for files modified more than 6 months ago which is why pravin27 suggested --time-style

Are you trying to change the timestamp of the file or the display out from ls ?

1 Like