files

## rename files in subdirs to name dirs (one level)

for x in */*; do
    dir2=${x%/*}; dir1=${dir2%/*}; dir2=${dir2#"$dir1"}
    mv -- "$x" "${x%/*}/${dir1}-${dir2}--${x##*/}"
done

## find spaces in files

find . -type f -name "* *"

## rename spaces in files

find . -type f -name "* *" | while read file; do 
	mv "$file" ${file// /_}; 
done

## find all files in this directory and its sub-directories and execute mv with target directory . for each file found to move them to current directory.

find . -mindepth 2 -type f -print -exec mv {} . \;

Revision #5
Created 6 September 2021 22:58:56 by j3d1n4
Updated 26 September 2021 16:14:38 by j3d1n4