Multiple commands in Linux

For those that do not know how to string multiple commands together, here is a quick reference for you:

[user@server foobar]$ command1 ; command2

The command is executed in the order it was written, but command 2 is executed even if there was an error in command 1.

[user@server foobar]$ command1 && command2

The command command2 is executed only if command1 was successful, no errors.


Continue Reading

Configuring additional ETH interfaces in CentOS

Assuming you already have an ETH0 configured and working, log in at the console and configure it just like a normal RHEL/CentOS nic configuration:

  1. cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1
  2. vim /etc/sysconfig/network-scripts/ifcfg-eth1
    1. Update the ETH # to the next in line.  (ETH0 to ETH1…)
    2. Update the correct IP & Subnet
    3. :wq
  3. service network restart
  4. run ifconfig to ensure the settings have taken effect
Continue Reading