Useful Solaris commands for BMC Remedy newbies

I wish I had this list a few years ago – anyone who’s been around Solaris for any length of time won’t find this helpful.  But I would have liked it on the first day I was exposed to Solaris and Remedy (also, I’d like to be that age again….).   It’s a good short list of common commands for beginners.

The bullet points below each question demonstrate the actual Solaris commands (which are the same on most flavors of unix).

1.) How do I start/stop the Remedy server?

  • cd /<install dir>/ar/bin
  • arsystem start
  • arsystem stop

2.) If I have multiple instances running on a server how do find out which (if any) are running?

  • ps -ef | grep arserverd

When looking for processes running as a particular user (for example, if you have multiple installs of the product running as different system users…).  In this example the unix UID is “remedydev”

  • ps -ef | grep arserverd | grep remedydev

3.) How do I set an environment variable like ARNONROOTINSTALL=TRUE

  • export ARNONROOTINSTALL=TRUE

or

  • cd /<home directory of user>
  • vi .profile
    • vi is the editor most people use in Solaris – .profile (note the dot in front of it) is where the user configured enviroment is stored
    • add the lines below:
  • ARNONROOTINSTALL=TRUE
  • export ARNONROOTINSTALL

4.) How do I tell what version of Solaris I’m on?

  • uname -a

5.) How do I tell if a certain value like “Oracle-Two-Task” is in a file like ar.conf file?

  • cd /<install dir>/ar/conf
  • grep Oracle-Two-Task ar.conf

You can grep just about anything using the redirect, ie, the pipe sign |.  For example, you can grep the results of a directory hierarchy listing if you are looking for a file.  Let’s say the file is 123.so and all you know is that it’s under the install directory somewhere.  You could navigate to that directory and type this:

  • ls -lR | grep 123.so

That will take the entire list, redirect it to grep, and return the listing(s) that have 123.so in them.

6.) How do I change permissions on a file?

  • chmod 777 filename

777 is of course wide open permissions – normally you would not do this.  However, their is a complete listing of the file commands in numerous places on the internet.  The thing to remember is you are setting three permissions - owner, group, and world.  Each number represents the respective permission.  WinSCP does this visually like this (if you choose the properties of a file):

file_permissions

Also, to change permissions to an entire directory hierarchy you can do this:

  • chmod -R 777 directoryname

7.) How do I….

  • Make a directory?
    • mkdir directoryname
  • Copy a file in the same directory (ie, ar.conf to ar.conf.bak?)
    • cp ar.conf ar.conf.bak
  • Copy a file in a different directory to this one?
    • cp /full-path-to-file/filename .
  • Copy a file from here to a different directory?
    • cp filename /full-path-to-file
  • Delete a file?
    • rm filename
  • Delete an entire directory (THIS IS NOT RECOVERABLE)?
    • rm -r directoryname