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