Add command to modify timestamp of files

This commit is contained in:
exu 2023-07-29 15:12:57 +02:00
parent 86847f6086
commit d15b3d3b7c

View File

@ -31,6 +31,32 @@ find (directory) -type f -exec chmod 744 {} +
Replacing `-type f` with `-type d` would execute the `chmod` for directories instead. Replacing `-type f` with `-type d` would execute the `chmod` for directories instead.
## Arch Linux
### Detect AUR package rebuilds
Install the package `extra/rebuild-detector`
It will create a `pacman` hook to check which packages need to be rebuild, but can also be executed with the following command.
[shuser]
```sh
checkrebuild
```
[/shuser]
The packages might be rebuilt automatically a lot of the time, but sometimes it is necessary to for a rebuild using the AUR helper.
This is an example using `paru`
[shuser]
```sh
paru -S --rebuild=yes <package>
```
[/shuser]
## Various ## Various
### Overwrite disk with pseudorandom data ### Overwrite disk with pseudorandom data
@ -91,28 +117,38 @@ lsusb -d 0781:55a3 -v | grep bcdUSB
[/shuser] [/shuser]
## Arch Linux ### Change file modify time
### Detect AUR package rebuilds Using `touch` it is possible to change the timestamps on a file.
_Note: The file has to be owned by the user executing the command_
Install the package `extra/rebuild-detector` Example changing the access and modify timestamps:
It will create a `pacman` hook to check which packages need to be rebuild, but can also be executed with the following command.
[shuser] [shuser]
```sh ```
checkrebuild touch -a -m -t 202307291506.07 <file>
``` ```
[/shuser] [/shuser]
The packages might be rebuilt automatically a lot of the time, but sometimes it is necessary to for a rebuild using the AUR helper. ```
This is an example using `paru` -a: accessed time
-m: modified time
-t: timestamp - [[CC]YY]MMDDhhmm[.ss] time format
```
Alternatively to `-t` it is also possible to use `-d` for a looser format.
[ISO8061](https://en.wikipedia.org/wiki/ISO_8601) obviously works as well.
[shuser] [shuser]
```sh ```
paru -S --rebuild=yes <package> touch -a -m -d "2 hours ago" <file>
touch -a -m -d "2023-07-29T00:23" <file>
``` ```
[/shuser] [/shuser]
> [Linux - modify file modify/access/change time](https://stackoverflow.com/questions/40630695/linux-modify-file-modify-access-change-time)
> [How can I change the date modified/created of a file?](https://askubuntu.com/questions/62492/how-can-i-change-the-date-modified-created-of-a-file)