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
# Copies files that have a specific extension to another directory while keeping directory structure and remove the prefix | |
# Example: ./dir_00000032.chk/Media/Backgrounds/Indoors/hall.jpg -> ../recov/jpg/Media/Backgrounds/Indoors/hall.jpg | |
# Replace the extension as you like | |
find -name "*.jpg" -type f -print0 | xargs -0 -i bash -c 'tt="$(echo -n '"'"'{}'"'"' | sed -e '"'"'s/[.]\/[^/]*\///g'"'"')"; mkdir -p "../recov/jpg/$(dirname '"\""'$tt'"\""')"; cp -v '"'"'{}'"'"' "../recov/jpg/$tt"' | |
# To remove the extension completely and just copy everything: | |
find -type f -print0 | xargs -0 -i bash -c 'tt="$(echo -n '"'"'{}'"'"' | sed -e '"'"'s/[.]\/[^/]*\///g'"'"')"; mkdir -p "../recov/$(dirname '"\""'$tt'"\""')"; cp -v '"'"'{}'"'"' "../recov/$tt"' | |
# Of course replace the things as you like | |
# This comes extremely useful when you have found.* folders from chkdsk which you want to extract | |
# files from. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# XZ (LZMA2 implementation) is a very strong and one of the most used compression utils | |
# Compress folder | |
# Specify 'noabrt' to prevent cancelling the process when an error occurs | |
# Specify 'nodel' to keep input files | |
# Specify 'force' to force compression and avoid some weird errors | |
function compressfolder() { | |
addnbrt="" | |
[[ " $@ " == *" nodel "* ]] && addnbrt="--keep" | |
[[ " $@ " == *" force "* ]] && addnbrt="$addnbrt --force" |
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 | |
# Source this file to have the functions in your shell, or add following line to your ~/.bashrc : | |
# source easyenc.sh | |
# Make sure to specify the correct path. | |
# Now you can: source ~/.bashrc | |
# $1: input file | |
# $2: output file (encrypted) | |
function encryptfile() { |
NewerOlder