List running processes: ps aux
Enable network interface: ifup eth0 (the first interface, lan, is eth0, and goes on with eth1 etc)
Mound CD/DVD drive: mount /dev/cdrom /mnt
Edit a file using text editor: vi /path/to/file
Press ESC and then type :w and hit Enter to exit discarding changes
Press ESC and then type q! and hit Enter to exit saving changes
Install a program using yum: yum install httpd (httpd is Apache)
Restart a service: service httpd restart
View the firewall rules: cat /etc/sysconfig/iptables
Add a firewall rule: (this example enables port 80) iptables -I INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
After the change you need to save and restart the iptables:
service iptables save
service iptables restart
Create a user:
useradd uddika
passwd uddika
Give sudo access:
sudo adduser <username> sudo
static IP: http://www.cyberciti.biz/faq/linux-configure-a-static-ip-address-tutorial/
DNS: http://www.unixmen.com/dns-server-installation-step-by-step-using-centos-6-3/
Connect to mysql: mysql -u root -p
To auto start a new service:
- Find out the name of service’s script from /etc/init.d/ directory e.g. mysqld or httpd
- Add it to chkconfig
sudo /sbin/chkconfig --add mysqld
- Make sure it is in the chkconfig.
sudo /sbin/chkconfig --list mysqld
- Set it to autostart
sudo /sbin/chkconfig mysqld on
To stop a service from auto starting on boot
- sudo /sbin/chkconfig mysqld off
live log view: tail -f logfile
Samba (windows share): yum install samba3-client
mount.cifs //SERVER_ADDRESS/SHARE_NAME MOUNT_POINT -o user=USERNAME
mount.cifs //192.168.10.118/Downloads /mnt -o user=share,pass=password
umount -l
Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.