chore(kb): improve tagging-related commands

This commit is contained in:
Michele Cereda
2024-10-13 20:45:50 +02:00
parent f6fe2dc42a
commit c8323579a2
3 changed files with 71 additions and 23 deletions

View File

@@ -1,42 +1,85 @@
# ExifTool
Platform-independent Perl library and command-line application for reading, writing and editing meta information in a wide variety of files.<br/>
Platform-independent Perl library and command-line application for reading, writing and editing meta information in a
wide variety of files.<br/>
It supports many different metadata formats as well as the maker notes of many digital cameras.
## Table of contents <!-- omit in toc -->
1. [TL;DR](#tldr)
1. [Further readings](#further-readings)
1. [Sources](#sources)
1. [Sources](#sources)
## TL;DR
<details>
<summary>Setup</summary>
```sh
# Installation.
brew install 'exiftool'
sudo zypper in 'exiftool'
```
</details>
<details>
<summary>Usage</summary>
```sh
# Show metadata in files.
exiftool 'path/to/image-1.jpg' 'path/to/image-n.jpg'
# Only show specific metadata tags.
# Tags selection is case *in*sensitive.
# Spaces in tags must be removed from the selector.
exiftool -'tagName' 'path/to/image-1.jpg'
# Add or edit metadata tags.
exiftool -author='linuxConfig' -title='Linux penguin' 'image.jpg'
# Remove metadata tags.
exiftool -author='' -title= 'image.jpg'
exiftool -all='' 'image.jpg'
```
</details>
<details>
<summary>Real world use cases</summary>
```sh
# It would be the same to use '-imageheight', '-ImageHeight' or '-imageHeight'.
exiftool -ImageHeight 'Downloads/meme.png'
# Print formatted date/time for all JPG files in the current directory.
exiftool -d "%r %a, %B %e, %Y" -DateTimeOriginal -S -s *'.jpg'
# Extract all GPS positions from an AVCHD video.
exiftool -ee -p "$gpslatitude, $gpslongitude, $gpstimestamp" 'a.m2ts'
# Recursively extract JPG images from Canon CRW files in the current directory.
# Add 'C<_JFR.jpg>' to the name of the output JPG files.
exiftool -b -JpgFromRaw -w '_JFR.jpg' -ext 'CRW' -r '.'
```
</details>
## Further readings
- [Website]
- [Github]
## Sources
All the references in the [further readings] section, plus the following:
### Sources
- [Top 5 ways to view and edit metadata]
<!--
References
Reference
═╬═Time══
-->
<!-- Upstream -->
[github]: https://github.com/exiftool/exiftool
[website]: https://exiftool.org/
<!-- In-article sections -->
[further readings]: #further-readings
<!-- Others -->
[top 5 ways to view and edit metadata]: https://daminion.net/articles/tips/top-5-ways-to-view-and-edit-metadata/

View File

@@ -1,10 +1,8 @@
# `getfattr`
## Table of contents <!-- omit in toc -->
1. [TL;DR](#tldr)
1. [Further readings](#further-readings)
1. [Sources](#sources)
1. [Sources](#sources)
## TL;DR
@@ -13,6 +11,9 @@
apt install 'attr'
dnf install 'attr'
# Get values for all attributes.
getfattr -d 'path/to/file.1''path/to/file.N'
# Get values for specific extended attributes.
getfattr -n 'name' 'path/to/file.1''path/to/file.N'
```
@@ -21,20 +22,16 @@ getfattr -n 'name' 'path/to/file.1' … 'path/to/file.N'
- [`setfattr`][setfattr]
## Sources
All the references in the [further readings] section, plus the following:
### Sources
- [`man` page][man page]
- [Tag files in GNU/Linux]
<!--
References
Reference
═╬═Time══
-->
<!-- In-article sections -->
[further readings]: #further-readings
<!-- Knowledge base -->
[setfattr]: setfattr.md
[tag files in gnu/linux]: tag%20files.md

View File

@@ -1,7 +1,5 @@
# The `touch` command
## Table of contents <!-- omit in toc -->
1. [TL;DR](#tldr)
## TL;DR
@@ -11,4 +9,14 @@
# End the time with 'Z' to specify the new time is UTC instead of local time.
touch -cd '2017-08-15T13:28:42' '20170815_132842.mp4'
touch -cd '2017-08-15T12:28:42Z' '20170815_132842.mp4'
# Change only the access time.
touch -ca -t '201801211200.10' 'file.txt'
touch -c --time=access -t '201801211200.10' 'file.txt'
touch -c --time=atime -d '2018-01-21T12:00:10' 'file.txt'
# Change only the modification time.
touch -cm -t '201611161200.10' 'file.txt'
touch -c --time=modify -t '201611161200.10' 'file.txt'
touch -c --time=mtime -d '2016-11-16T12:00:10' 'file.txt'
```