Difference between revisions of "Useful Commands"

From Peter Pap's Technowiki
Jump to: navigation, search
Line 34: Line 34:
  
 
   find . -inum INODE_NUMBER -ok rm '{}' \;
 
   find . -inum INODE_NUMBER -ok rm '{}' \;
 +
 +
 +
== Turn off all unnecessary Network Services ==
 +
 +
I've never used this, but I can see where it would be handy when you first build a box.  It turns off all unnecessary network services in one fell swoop:
 +
 +
  netservices limited

Revision as of 00:56, 21 September 2010

These are a number of useful commands that I have found over the years. See the 'man' pages for more detail.


Running 64-bit or 32-bit Solaris?

This command is more relevant with older versions of Solaris, as these days Solaris is 64-bit by default. However, if you're running an older version of Solaris and need to know if it's running in 64-bit or 32-bit mode, here's how you find out:

  /usr/bin/isainfo -kv


Set network interfaces with unique MAC addresses

So you have a Sun Sparc server with multiple network interfaces. You'd expect them to have different MAC addresses right? Wrong! By default they will present the same MAC address. In order to force the machine to use a different MAC address you need to do either of the following.

From the OpenBoot PROM ('ok' prompt):

  setenv local-mac-address? true

From the OS:

  eeprom "local-mac-address?=true"


Deleting unusual file names via INODE number

Ok, so you've accidentally created a file with a special character in it's name, like ~ or ` or something just as stupid. How do you delete it when the shell won't let you escape the character. Delete it via it's INODE number.

First, find out it's INODE number:

  ls -ali

Then delete it like so:

  find . -inum INODE_NUMBER -ok rm '{}' \;


Turn off all unnecessary Network Services

I've never used this, but I can see where it would be handy when you first build a box. It turns off all unnecessary network services in one fell swoop:

  netservices limited