Skip to content

Instantly share code, notes, and snippets.

@ApoGouv
Last active December 6, 2022 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ApoGouv/179965a6159ce8647d42214f04074234 to your computer and use it in GitHub Desktop.
Save ApoGouv/179965a6159ce8647d42214f04074234 to your computer and use it in GitHub Desktop.

Linux commands related to file permissions

To change all the directories to 755 (drwxr-xr-x):

find /opt/lampp/htdocs -type d -exec chmod 755 {} \;

To change all the files to 644 (-rw-r--r--):

find /opt/lampp/htdocs -type f -exec chmod 644 {} \;

Make the current user own everything inside the folder (and the folder itself):

sudo chown -R $USER ~/.folder_name

Change folder and files owner and group:

chown -R user:usergroup /path/to/folder

Fix/ Overcome out of memory problem with composer in cPanel

COMPOSER_MEMORY_LIMIT=-1 /opt/cpanel/composer/bin/composer 

Open crontab with nano (default is vim)

sudo env EDITOR=nano crontab -e

Change/Add mail reports for crontab crons

MAILTO="user@example.com"
  • For cPanel crons, there is a field "Cron Email" in the "Cron Jobs" page

Prevent sending report mails

Alter command like this: mycommand >/dev/null 2>&1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment