route command show and/or manipulate the IP routing table under Linux and UNIX oses.
Route manipulates the kernel’s IP routing tables. Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured with the ifconfig program. When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables.
Display default route
Following three-command display the current routing table:
1. # route
2. $ /sbin/route
3. $ /sbin/route -n
use -n option, to display numerical addresses instead of trying to determine symbolic host names (via dns or /etc/hosts file). This is useful if you are trying to determine why the route to your nameserver has vanished.
Add / setup a new route
The syntax is as follows:
route add default gw {IP-ADDRESS} {INTERFACE-NAME}
Where,
IP-ADDRESS: Specify router IP address
INTERFACE-NAME: Specify interface name such as eth0
For example if your router IP address is 192.168.1.254 type the following command as the root
# route add default gw 192.168.1.254 eth0
OR use hostname such as dsl-router:
# route add default gw dsl-router eth0
Friday, January 11, 2008
Friday, January 4, 2008
Recover your sudoers file .......the mishandled one... ;)
you can use this commands to recover your sudoers file..
# vim -r /etc/sudoers
or
recover -r /etc/sudoers
# vim -r /etc/sudoers
or
recover -r /etc/sudoers
Yum Installation for php, mysql and apache on linux machine
This command is to install php, mysql and apache on linux machine
# yum -y install httpd php mysql mysql-server php-mysql
Enjoy Linux!!
# yum -y install httpd php mysql mysql-server php-mysql
Enjoy Linux!!
Backup and Restore Mysql data using Linux commands.
Backup and Restore Mysql data using Linux commands.The steps includes:
A)Backup:
1.Connect to server
2.Create a Directory where you would like to backup your data(like /bak).
3.using shell prompt(terminal) to to the dir(/bak)
4.use the following command to backup the data:
mysqldump -u username -ppassword dbname > filename.sql
please note there shouldn't be space between -p and password.
B)Restore:
1. Open SSh file browser
2. upload dump file somewhere (any directory)
3. Open SSH Secure shell client with your SSH uid and password
$mysql -u dbuid -ppass (Please note that there is no space between -p
and password)
mysql>use dbname
mysql>source /home/pinky/pairdum.sql (location of the dump file)
* for any help use help command
A)Backup:
1.Connect to server
2.Create a Directory where you would like to backup your data(like /bak).
3.using shell prompt(terminal) to to the dir(/bak)
4.use the following command to backup the data:
mysqldump -u username -ppassword dbname > filename.sql
please note there shouldn't be space between -p and password.
B)Restore:
1. Open SSh file browser
2. upload dump file somewhere (any directory)
3. Open SSH Secure shell client with your SSH uid and password
$mysql -u dbuid -ppass (Please note that there is no space between -p
and password)
mysql>use dbname
mysql>source /home/pinky/pairdum.sql (location of the dump file)
* for any help use help command
Subscribe to:
Posts (Atom)