Changing File’s Date and Time on Unix Systems

Change Data and Time of a File

At times, we might want to change date and time of a file, for record purposes. For example, when you copying log file from remote machine, when it’s extract on local machine, the date and time will reflect to current date time.

touch Command

To update the date and time of file, run;

touch -t ccyymmddhhMMSS filename

For more info, run;

man touch

Related posts:

  1. Modify or Adjust File Date Time on Unix/Linux You have folders or files in your server last modified...
  2. Linux/Unix Search and Replace Text from Multiple Files In Linux/Unix, for newbie to do search text from multiple...
  3. How to Change Hostname in Unix FreeBSD We have interesting hostname for our all our servers. Some...
  4. Quick File Copy on File Name with Sample Extension By default, some of the application installation provide you a...
  5. OS X Lion Release Date OS X Lion Release Date is Today, 20th July 2011...
  6. convert epoch using date command date -d ‘<Unix epoch> <epoch date> sec’ e.g. date -d...
  7. secure copy with failover – rsync & ssh e.g. rsync -av –progress -e ‘ssh -i /alternate/id/file’ sshusername@host:/directory/or/file /destination/directory/or/file...
  8. How to Change MySQL Data Directory in Linux Centos By default Linux CentOS or other Linux Distro installation, MySQL...
  9. How to Find Out Public IP Address via Command Line in Unix/Linux Machine If you have more than 100 servers in your network;...
  10. Set time & date automatically in KDE For NTP use in KDE : - apt-get install ntpdate...

Tags: , , , , ,

Leave a Reply