Last active
August 2, 2016 13:18
-
-
Save d1i1m1o1n/84195fb33a9afd774ed4a5900e70a752 to your computer and use it in GitHub Desktop.
Linux file and directories set privileges and owner and tar gz
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
To recursively give directories read&execute privileges: | |
find /path/to/base/dir -type d -exec chmod 755 {} + | |
To recursively give files read privileges: | |
find /path/to/base/dir -type f -exec chmod 644 {} + | |
Changing owner of a directory recursively: | |
chown -R user:group direcory_to_be_changed | |
How to find all Zero bytes files in directory including subdirectories: | |
find $dir -size 0 -print | |
создать .tar.gz (архив): | |
tar -czvf file.tar.gz /full/path | |
распаковать запаковывай .tar: | |
tar -xvf file.tar.gz | |
Бэкап базы mysql: | |
mysqldump -h 127.0.0.1 -u root -pPassword DBName | gzip > fileName.sql.gz | |
Заливаем бекап в базу данных | |
mysql -u USER -pPASSWORD DATABASE < /path/to/dump.sql | |
Заливаем архив бекапа в базу | |
gunzip < /path/to/outputfile.sql.gz | mysql -u USER -pPASSWORD DATABASE | |
или так | |
zcat /path/to/outputfile.sql.gz | mysql -u USER -pPASSWORD DATABASE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment