Append dirname to all filenames in directory and subdirectories
Took a while to find it out:
find -type f -execdir bash -c 'var=$(basename "$PWD"); mv -- "$1" "${var%-*}_$(cut -c 3- < <(echo ${1}))"' execbash {} \;
Took a while to find it out:
find -type f -execdir bash -c 'var=$(basename "$PWD"); mv -- "$1" "${var%-*}_$(cut -c 3- < <(echo ${1}))"' execbash {} \;
awk '{gsub(/"/,"",$7); print $7}' access.log
Alle Zeilen mit # Am Anfang ergaenzen.
:%s@^@#&@
find -maxdepth 1 -type d -not -name "*hide*"
= Show all directories directly located in the current directory which do not have the word 'hide' in their name.
Useful and fast:
find -type f -name 'filename' -exec grep -H 'text to find' {} +
Same result and maybe even better performance:
Put all pdf's you want to combine in a directory. Name them in the order, you want to combine them.
qpdf --empty --pages *.pdf -- NameOfMergedFile.pdf
Easy way to repeat often used commands on the linux console ... add history search backwards to .inputrc in your home directory:
cd ~
vim .inputrc
cd /into/directory/one_level_above
grep -rnw . -e 'string to be searched'
With image styles and responsive breakpoints drupal generates automatically smaller images from the original uploaded ones.
cd dir_containing_files
sed -i '/_core\:/d' *
sed -i '/default_config_hash/d' *