Linux, MySQL, Apache, and How to Add Bookmarks
Linux:
Quick guru
Item | Command |
---|---|
Get help | man cmd_name |
Change password | passwd |
List files | ls -lh |
notes | -l = long -h = human readable sizes |
Change directory | cd dir_name |
Copy file | cp file new_file |
Move file | mv file target |
Remove file | rm -f file |
notes | -f = force delete without prompt |
Print file to screen | cat file |
Set permissions | chown -R apache:apache /var/www/* |
Set executable | chmod -R 755 /var/www/cgi-bin/* |
notes | -R = Recursive |
Documentation
Man pages and more
Bash scripting
Mendel Cooper: Advanced Bash-Scripting Guide
A quick guide to writing scripts using the bash shell
VI editor
Bill Joy, VI creator: An Introduction to Display Editing with Vi
University of Hawaii at Manoa: Mastering the VI editor
MySQL:
Quick guru
Item | Command |
---|---|
Login | mysql -p db_name |
Run sql script | mysql -p db_name <script_file |
notes | -p = prompt for password |
List tables | show tables; |
List records in table | select * from table_name; |
Count records in table | select count(*) from table_name; |
Insert record | insert into table_name (field1, field2) values (‘value1_value’, ‘value2_value’); |
Update record | update table_name set field1 = ‘value1_value’, field2 = ‘value2_value’; |
Delete record | delete from table_name where field1 = ‘value1_value’; |
Delete all records | truncate table_name; |
Documentation
Official website: http://www.mysql.com/doc/
Apache:
Quick guru
Item | Command |
---|---|
Restart | apachectl restart |
Configure | vi /etc/httpd/conf/httpd.conf |
Set permissions | chown -R apache:apache /var/www/* |
Set executable | chmod -R 755 /var/www/cgi-bin/* |
notes | -R = Recursive |
Documentation
Official release: http://httpd.apache.org/