Centos commands from websites

How do I update Centos?


How do I install Apache in Centos?

yum install httpd

How do I set Apache to start on boot in Centos?

chkconfig –-levels 235 httpd on

How do I install MySQL in Centos?

yum install mysql mysql-server

How do I get MySQL to start at boot in Centos?

chkconfig –-levels 235 mysqld on

How do I Secure my MySQL install in Centos?


Then run through the basic configuration accepting the defaults such as removing the guest accounts and passwords.

How do I restart MySQL in Centos?

 service restart mysqld

How do I install PHP in Centos?

yum install php

How do I restart the Apache service in Centos?

 Service httpd restart

How do I list a directory in Centos?


How do I locate a specific file in a directory in Centos?

find . -name FILENAME

How do I locate a file with a certain word in it in Centos?

Lets say you wanted to find a file that had the word log in it.

locate log

How do I restart IPTables in Centos?

 service iptables restart

How do I flush the cache of my IPTables in Centos?

 iptables -f

How do I see what services are running and their status under Centos?


and to exit CTRL+X. This service will give you information on what CPU usage and memory usage is being used for a given service.

How do I list in order what service is using the most memory in Centos?

ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10

How do I change the name of my server in Centos?

 hostname yourchosenservername

How do I create a new user in Centos?

adduser thentheusername

How do I change the password for the user I am logged in as in Centos?


How do I edit files in Centos? I presonally use Nano, so lets first install it.

yum install nano

original from :http://www.techieshelp.com/basic-centos-commands-and-information/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s