Create File or Modify the Existing UNIX/LINUX File With Old / New Timestamp

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Use touch command to change the timestamp of a file to newer or older one. Also, this command can be used to copy the timestamp between files.

touch –t  [[CC]YY]MMDDhhmm [.SS] filename

where          MM - The month of the year [01-12].

           DD - The day of the month [01-31].

           hh - The hour of the day [00-23].

           mm - The minute of the hour [00-59].

           CC - The first two digits of the year.

           YY - The second two digits of the year.

           SS - The second of the minute [00-61].
Example
touch -t 201502120742 tst
$ ls –ltr

-rw-r--r--   1 oracle   dba            0 Feb 12  2015 tst

Copy timestamp of one file to another

$ ls -ltr

-rw-------   1 lawdba   dba        11316 Jan  4 00:04 nohup.out

-rw-r--r--   1 lawdba   dba           58 Feb 12 11:01 040114_test.txt

$ touch -r nohup.out 040114_test.txt

ls -ltr

total 58

-rw-------   1 lawdba   dba        11316 Jan  4 00:04 nohup.out

-rw-r--r--   1 lawdba   dba           58 Jan  4 00:04 040114_test.txt

$ expdp dumpfile=tab_exp.dmp logfile=tab_exp.log tables=sthomas.dept directory=exp_dir

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer