- Joined
- Jul 11, 2016
- Messages
- 24
- Points
- 3
As a Linux administrator, you will need to know more commands to control your hosting server effectively. I would sum up some of the most basic commands required for sysadmins and webmasters. The command has been tested on CentOS 5 and 6 operating system.
1. The basic commands
2. Networking (limited use when in remote mode)
3. Check System
4. Webserver and MySQL
5. Zip and unzip
If you have any other useful commands for Linux, please write down and I appreciate that.
Hope it helps!
1. The basic commands
Code:
# ls // like dir command in windows
# vi // open the text editor
# passwd // change the current user password
# chmod // grant permissions for folders and files
# chgrp //change group for folders and files
# chown // change the directory and file owner
# cp a b // copy a file into the folder b
# reboot // reboot the system //
# shutdown -h now // shutdown system (shutdown)
# shutdown -r now // shutdown system (restart)
Code:
# ifconfig // view and config ip of server
# setup // select Network Configuration to set IP for server
# vi /etc/resolv.conf // configure dns for server
# ifdown eht0 // down network card eth0
# ifup eht0 // up network card eth0
# service network restart // restart network service
Code:
# top // whether the resource usage of RAM, the system's CPU
# uptime // average view the status of the system and the system was online time
# fdisk -l // see the HDD on server
# df -h // check usage HDD
# cat /proc/cpuinfo // Check CPU
# cat /proc/meminfo // Check RAM ussage
# du -hs // check folder usage
Code:
# service httpd status // view webserver status
# service httpd restart // restart webserver
# service mysqld restart // restart mysql
# mysqlcheck -Aao -auto-repair -u[MySqlAdmin] -p[Password] // check and optimize mysql database
Code:
# tar -cvzpf archive.tgz /home/example/public_html/folder // compress a folder
# tar -tzf backup.tar.gz // list gz files
# tar -xvf archive.tar // decompress a tar file
Hope it helps!