mirror of
https://github.com/sahinakkaya/til.git
synced 2024-11-22 00:29:37 +01:00
TIL: Changing the modification date of a file
This commit is contained in:
parent
8bc5cb91ff
commit
524c81460d
14
bash-scripting/changing-the-modification-date-of-a-file.md
Normal file
14
bash-scripting/changing-the-modification-date-of-a-file.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
You can use `touch` to change modification date or time of a file:
|
||||||
|
```
|
||||||
|
touch -d 20210703 filename
|
||||||
|
|
||||||
|
# Set the times on a file to a specific date and time:
|
||||||
|
touch -t YYYYMMDDHHMM.SS filename
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
or use the times from a file to set the times on a second file:
|
||||||
|
|
||||||
|
```
|
||||||
|
touch -r filename filename2
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user