tar este arhivatorul clasic din sistemele UNIX – Tape ARchiver. In sistemele UNIX si UNIX-Like este preferat in locul altor arhivatoare – zip, rar, lha etc. Utilizarea din consola chiar daca pare putin ciudata e usoara. Pun mai jos cateva exemple:
1. Pentru arhivarea unui fisier/director
# tar -cf fisier.tar fisier
Parametrul -c indica aplicatiei faptul ca trebuie creata o arhiva iar -f spune numele arhivei. Al doilea parametru, fisier, e numele fisierului care va fi arhivat.
# tar -zcf fisier.tar.gz fisier
In cazul in care se specifica si parametrul -z, tar nu doar va arhiva ci va si comprima fisierul astfel ocupand mai putin spatiu pe disc.
# tar -zcfv director.tar.gz director
Daca dorim arhivarea si comprimarea unui director (folder) putem folosi parametrul -v (verbose) care ne arata toate detaliile arhivarii.
2. Pentru dezarhivare
# tar -xf fisier.tar
Comanda de mai sus extrage din fisier.tar fisierul arhivat. Se foloseste parametrul -x care ii spune aplicatiei ca e vorba de o extragere din arhiva nu de o arhivare.
# tar -zxf fisier.tar.gz
Daca fisierul de dezarhivat e comprimat cu gzip se poate folosi parametrul -z pentru ca fisierul sa fie decomprimat inainte de a fi dezarhivat.
# tar -zxvf fisier.tar.gz
Bineinteles, ca in cazul arhivarii, putem folosi parametrul -v (verbose) care ne raporteaza fiecare faza prin care trece aplicatia, fiecare fisier care este dezarhivat.
Reset parola mysql
In ultimul timp am vazut multi detinatori de servere care nu stiu sa reseteze parola mysql din...