Topics and Tools
Linux MySQL Apache (how to add bookmarks?)
Linux:
Quick guru |
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 |
|
Bash scripting |
|
VI editor |
|
MySQL:
Quick guru |
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 |
|
Apache:
Quick guru |
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 |
|