Frequently Used Linux Command Lines

Install WordPress


wget http://wordpress.org/latest.tar.gz
tar xfz latest.tar.gz
cp -r * ~/public_html/your/website/folder/

Change Permissions (rwx => 4 + 2 + 1 = 7)

For Directories:


find /path/to/your/directory/ -type d -exec chmod 755 {} \;

For Files:


find /path/to/your/file/ -type f -exec chmod 644 {} \;

Permissions


chmod -R 755 directory
chmod -R 644 files

Remove files and directory (use carefully)


rm -rf YourDirectory

Change Owner


chown -R apache new_name //change entire directory

Rename Directory


mv {old} {new}

Database


mysql -u root -p //To access database
mysql> create database [database name];
mysql> show databases;
mysql> drop database [database name];