Command to downsize the image quality for posting to WebFlow

magick 8597.jpg -quality 80 8597.jpg

Find an old terminal command:

history | fzf | cut -c8- | pbcopy
  • explaination:

“output history to terminal” “search with fuzzy finder” “cut results to just be the command” “after finding result, save it in clipboard.”

Search and Replace my file type in nested directory

find -type f -name "*.md" -exec sed -i '' 's/dg-publish/publish/g' {} +

for macOS: have to do sed -i '' instead of sed -i because it’s different by OS.


display the absolute path for files inside of the current working directory:

ls | xargs -I {} readlink -f {}

defines what you want to use as the input placeholder

 
xargs -I {}

this command will output the full path of the file passed to it

readlink -f path/to/file

Xargs examples and Gotcha’s


use the -p flag in order to prompt the user before running each command with each files.

This is the clearest video on the applications of xargs (watch for a review)


decrypting stenography cover images

the alias to use encrypt/decrypt program is stenog

if you want to specify the output directory you can do it with ending the command with:

-o output/directory

full command to encrypt is

stenog -cli -e -c /path/to/cover/image -f /path/to/secret/file

full command to decrypt is:

stenog -cli -d -c /path/to/cover/image