Rubrika: Linux

Jak rekurzivně nahradit text v souborech

Pokud hledáte jak v linuxu rekurzivně nahradit text v souborech, tedy například ve všech soiborech v aktuální složce a všech soboirech v podřízených složkách najít text „opensource“ a nahradit ho za „otevrenykod“, tak zkuste příkaz: find . -type f -print0…

Změna timezone na centos7

Pokud potřebujete změnit timezone (časové pásmo) na CentOS7, tak si nejprve: vylistujeme dostupné zóny: timedatectl list-timezones Z výpisu si vybereme tu správnou např tu pro ČR ( Europe/Prague ) a změníme jí na serveru: timedatectl set-timezone Europe/Prague ověříme že je…

tmpwatch example

Tmpwatch is linux tool to automate temporary file cleanup. When you need examples for your inspiration try this example: Delete older files than 48 hours: tmpwatch -m 48 /var/www/cache/ Delete older files haven’t been accessed 30 days: tmpwatch  30d /var/www/cache/…

Missing comand in Centos7

You install new centos7 and yours classic command missing? Here is small list of lost commands and new alternatives: ifconfig alternative: ip addr or install ifconfig: yum install net-tools service httpd restart alternative: systemctl restart httpd.service chkconfig servicename on/off  alternative:…

Selinux – allow fwrite php in centos7

How to allow fwrite php command in centos7? You must set exact directory for writing.  ( e.g. cache dir ): semanage fcontext -a -t ‚httpd_cache_t‘ ‚/path/to/www/cache(/.*)?‘ restorecon -Rv /path/to/www/cache Tip: do not disabling Selinux ! Is good reasons for prevent…