To get the current path:
pwd
To convert .HEIC
files to .JPG
files, use the heif-convert
tool:
-
Install the package:
sudo apt install libheif-examples
-
Convert all
.HEIC
files in the current directory to.JPG
while keeping the original names:for i in *.HEIC; do heif-convert "$i" "${i%.HEIC}.jpg"; done
To delete all files with a certain name or extension:
find . -name '*.json' -exec rm {} \;
To move all .mp4
files to a specific folder:
mv *.mp4 /home/lukas/Documents/Pictures/Handy/Galaxy/Google/Fotos/Photos/from/2023/Videos
To extract single images from videos using ffmpeg
:
ffmpeg -i inputfile.avi -r 1 -f image2 image-%03d.jpeg
-r 1
: Extracts 1 image per second of the video. Replace this number to adjust the number of images per second.-f image2
: Forces the output format to images. This can often be omitted asffmpeg
tries to select the format based on the file extension.image-%03d.jpeg
: Specifies the output file name pattern.%03d
means the images will be numbered with three digits, padded with zeroes (e.g.,image-001.jpeg
).
To find disk hogs, including hidden files, use the following command:
du -sch .[!.]* * | sort -h
du -sch
: Displays disk usage for each file and directory in human-readable format..[!.]*
: Matches hidden files and directories in the current directory, excluding.
(current directory) and..
(parent directory).*
: Matches all non-hidden files and directories in the current directory.sort -h
: Sorts the output in human-readable format (e.g.,1K
,234M
,2G
).
This command helps you identify large files and directories, including hidden ones like /home/myAccount/.local/share/Trash
.