Monday, January 29, 2024

.::: Change the file created date & Modified file in Linux :::.

 1. check size & time file
[root@teguhth data]# ls -lh
total 932K
drwxr-xr-x 3 root root   19 Jan 17 18:01 backup
-rw-r--r-- 1 root root 924K Jun 23  2023 psqlodbc-15.00.0000.tar.gz
-rw-r--r-- 1 root root 7.9K Jan 16 14:59 teguhth_original.sql
[root@teguhth data]#
[root@teguhth data]#
[root@teguhth data]# cp psqlodbc-15.00.0000.tar.gz psqlodbc-15.00.0000_test.tar.gz
[root@teguhth data]# ls -lh
total 1.9M
drwxr-xr-x 3 root root   19 Jan 17 18:01 backup
-rw-r--r-- 1 root root 924K Jun 23  2023 psqlodbc-15.00.0000.tar.gz
-rw-r--r-- 1 root root 924K Jan 29 10:15 psqlodbc-15.00.0000_test.tar.gz
-rw-r--r-- 1 root root 7.9K Jan 16 14:59 teguhth_original.sql
[root@teguhth data]#
[root@teguhth data]#
 
2. change date create for a file
[root@teguhth data]# touch -t 2401221509 psqlodbc-15.00.0000_test.tar.gz
[root@teguhth data]# ls -lh
total 1.9M
drwxr-xr-x 3 root root   19 Jan 17 18:01 backup
-rw-r--r-- 1 root root 924K Jun 23  2023 psqlodbc-15.00.0000.tar.gz
-rw-r--r-- 1 root root 924K Jan 22 15:09 psqlodbc-15.00.0000_test.tar.gz
-rw-r--r-- 1 root root 7.9K Jan 16 14:59 teguhth_original.sql

3. change date modife for a file
[root@teguhth data]#
[root@teguhth data]# touch -m 2401251001 psqlodbc-15.00.0000_test.tar.gz
[root@teguhth data]# ls -lh
total 1.9M
-rw-r--r-- 1 root root    0 Jan 29 10:20 2401251001
drwxr-xr-x 3 root root   19 Jan 17 18:01 backup
-rw-r--r-- 1 root root 924K Jun 23  2023 psqlodbc-15.00.0000.tar.gz
-rw-r--r-- 1 root root 924K Jan 29 10:20 psqlodbc-15.00.0000_test.tar.gz
-rw-r--r-- 1 root root 7.9K Jan 16 14:59 teguhth_original.sql
[root@teguhth data]#
 


No comments:

Post a Comment

Popular Posts