touch <file>
→ Changes the modification date of file to NOW.touch -a <file>
→ Changes the access date of file to NOW.touch-c <file>
→ Changes the creation date of file to NOW.touch-cm <file>
→ Changes both the creation date and the modification date of file to NOW.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://github.com/aonez/Keka/issues/932#issuecomment-989762514 | |
# By Matt Sephton @gingerbeardman 2021-12-11 | |
# - Created all versions til then | |
# By @porg 2021-12-15 | |
# - Fixed base60 vs. base100 timestamp bug | |
# - Added more verbose script output | |
# Dependencies: p7zip, pipx, osxmetadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://github.com/aonez/Keka/issues/932#issuecomment-989762514 | |
# By Matt Sephton @gingerbeardman 2021-12-11 | |
# - Created all versions til then | |
# By @porg 2021-12-16 | |
# + Hiding file extension on all extracted files | |
# + Setting creation and modification date of output directory | |
# Dependencies: p7zip, pipx, osxmetadata, SetFile (ships with Xcode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -z "$1" || -z "$2" || "$1" == "-h" || "$1" == "--help" ]] ; then | |
cat <<EOF | |
USAGE: `basename $0` backupDir targetDir | |
Loops through all files on root level of backupDir. | |
For each file in backupDir it tries to find a same named file in targetDir. | |
- If not found in target (because renamed or removed meanwhile) the file is skipped. | |
- If found and they have the same modification timestamp nothing is done either. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# link2file /path/to/item1 /path/to/item2 … | |
# | |
# - Checks per each item that is is a macOS alias or a symlink and its target is a regular file | |
# - Replaces each alias or symlink with the file it points to | |
# - Names the newly created file with the filename of the alias/symlink it replaces | |
# - and if that alias has no extension, uses the extension of the file it points to | |
# - and if that file has no extension either, the newly created file has none too. | |
# - Is fast and space-efficient on APFS (copy-on-write). |