I have tar.gz files accessible from
./parent/subfolder/tar_file_folder/*tar.gz
And I want to find them and move them into the ./parent/ directory, therefore one level up. However, there are several subfolders and tar_file_folders. Therefore, I want to call my command from the parent folders.
I have tried this command line:
cd ./parent
find -name '*.tar.gz' -exec mv {} /path/to/single/target/directory \;
However, I am not quite sure how to specify the path to one level up. Any help?
Two examples of path where in this case the tar files has to be either move to ./AU-ASM folder or ./AR-Vir/ folder:
./AU-ASM/[email protected]/LT51030752011211-SC20161014133947.tar.gz
./AR-Vir/[email protected]/LT51030751995263-SC20161014133510.tar.gz’
And this is an example on where the tar.gz are stored:
./Landsat_Data/AR-Vir/[email protected]/*tar.gz
The command line needs to be run from the ./Landsat_Data/ directory
d
should be replaced bytar
?$tar
fails while"$tar"
works. He also used globbing where you usedfind
.