parallax background

Common commands for amazon linux AMI ec2

Restore wordpress on amazon linux AMI ec2
Restore wordpress on amazon linux AMI ec2
04/01/2016
More apps & fixes for amazon linux AMI ec2
More apps & fixes for amazon linux AMI ec2
08/01/2016

Change  permission:

777 = everyone can read, write and execute the file (rwxrwxrwx)

664= (rw-r--r--)

File: sudo chmod 777 /var/www/html/wp-config.php  Or  File: sudo chmod 664/var/www/html/wp-config.php Or Folder: sudo chmod 777 -R /var/www/html/

Check permission:

 ls -l /var/www/html/ Or  ls -l /var/www/html/wp-config.php

Change the owner: User

File: sudo chown root /var/www/html/wp-config.php Or Folder: sudo chown root -R /var/www/html/

Change the owner: Group

sudo chown :groupname -R /var/www/html/

Create  Group:

sudo groupadd groupname

Create Directory:

sudo mkdir directoryname

Copy File Or Directory:

cp filename /var/tmp/ Or  sudo cp -avr /var/www/html/ /var/tmp/

Delete File Or Directory:

rm filename Or /var/tmp/* Or sudo rm -rf wp-content/*  Or sudo rm -rf /var/www/html/*

Show Disk Size:

df -h

Show Process:

top (To quit press q)

Create Cron:

export VISUAL=nano; crontab -e

Cron Location:

sudo ls /var/spool/cron

Copy from S3 to EC2:

sudo curl -O  https://www.yanivp.net//s3-eu-west-1.amazonaws.com/s3bucketname/public/test.txt

Copy from EC2 to S3: (make public folder)

aws s3 cp /var/www/html/filename s3://pac.files/

Leave a Reply

Your email address will not be published. Required fields are marked *