I have 200 zip files in a folder… I need to unzip them to the same folder and the content of each for a respective folder with the name of the zip file.
This is how:
find -name '*.zip' -exec sh -c 'unzip -d "${1%.*}" "$1"' _ {} \;
I have 200 zip files in a folder… I need to unzip them to the same folder and the content of each for a respective folder with the name of the zip file.
This is how:
find -name '*.zip' -exec sh -c 'unzip -d "${1%.*}" "$1"' _ {} \;
This is how I compare two folders on Mac and Linux.
diff -rq folder1 folder2
Backup a folder
tar -cvpzf /BackupDirectory/backupfilename.tar.gz /ImportantData/directory/path
c = Create
v = Verbose mode
p = Preserving Files and Directory Permissions.
z = This will tell tar that compress the files further to reduce the size of tar file.
f = It is allows to tar get file name.
Backup a MySQL database
mysqldump --opt -u [username] -p[password] [dbname] > [dbname.sql]
Backup all MySQL databases
mysqldump -u root -p --all-databases > all_databases.sql