Category Archives: Command Line

How do I find out if I am running 64bit or 32bit Centos?

Sometimes you can’t remember if you installed 64bit or 32bit centos, to find out which version you are using; uname -a And you will get a response like [root@monitor zenoss]# uname -a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx i686 i686 i386 GNU/Linux

Posted in Centos 5.2, Command Line, General Command Line | Tagged , , | 2 Comments

How Do I Find Which Version of Centos I Am Running?

Sometimes you install a centos machines ages ago and can’t remember what you installed. If you want to find out which version it is, easy tail /etc/redhat-release This will return something like; [root@]# tail /etc/redhat-release CentOS release 5.2 (Final)

Posted in Centos 5.2, Command Line, General Command Line | Tagged , , | Leave a comment

Upgrade from zenoss 2.5.2 stack installer to zenoss 3.0 on Centos

Instructions from http://nchc.dl.sourceforge.net/project/zenoss/Documentation/zenoss-3.0.x-docs/zendocs-3.0.0/Zenoss_Core_Installation_04-072010-3.0-v01.pdf Get the ZenPacks.zenoss.PreUpgrade30-1.0-py2.4.egg wget http://downloads.sourceforge.net/project/zenoss/zenpacks-3.0%20%28Latest%20Stable%29/zenpacks-3.0.0/ZenPacks.zenoss.PreUpgrade30-1.0-py2.4.egg?use_mirror=nchc&ts=1279596576 Change the permissions chown zenoss.zenoss ZenPacks.zenoss.PreUpgrade30-1.0-py2.4.egg chmod 777 ZenPacks.zenoss.PreUpgrade30-1.0-py2.4.egg Become the zenoss user su zenoss Run the install zenpack –install ZenPacks.zenoss.PreUpgrade30-1.0-py2.4.egg Restart zopectl zopectl stop zopectl start Start the zencatalog zencatalog start … Continue reading

Posted in Centos 5.2, Command Line, General Command Line, Open Source, Zenoss | Tagged , , , , | Leave a comment

How To Import a Mysql Database on the Command Line

Every so often its useful to import a .sql (exported sql file) into mysql. Make sure the database already exists. mysql -u root -p create database NAMEOFDB; exit then import you db.. mysql -uUSERNAME -pPASSWORD NAMOFDB < MYDATABASE.sql

Posted in Command Line, Mysql | Leave a comment

How To Add /usr/local/bin to your PATH on Centos

To find the directories in your PATH, run the following command: echo $PATH Adding to your PATH Add /usr/local/bin to yor PATH: export PATH=$PATH:/usr/local/bin /etc/profile file defines path for all users. Edit file vi /etc/profile My profile file looks like … Continue reading

Posted in Centos 5.2, Command Line | Leave a comment

How To Add a Symbolic Link in Centos

ln -s [TARGET DIRECTORY OR FILE] ./[SHORTCUT] For example: ln -s /usr/local/apache/logs ./logs

Posted in Centos 5.2, Command Line | Leave a comment

How To Install Suns VirtualBox tools on a Centos Virtual Machine

If you get the error Could not find the Linux kernel header files – the directories/lib/modules/2.6.18-128.el5/build/include and /usr/src/linux/includedo not exist. Then you need to install the following packages. yum install kernel sources yum install kernel-devel yum install gcc Create the … Continue reading

Posted in Centos 5.2, Command Line, VirtualBox | Leave a comment

How To Turn Off Overwrite Request on when you copy in Centos

When copying a folder in centos, it interactively asks if you want to overwrite a file, the -f flag does not work.  Simple solution, use \cp.

Posted in Centos 5.2, Command Line | Tagged , , | Leave a comment

How to Find Large Files using Linux Command Line

find / -type f -size +20000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’ or find / -type f -size +20000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 … Continue reading

Posted in Centos 5.2, Command Line | Tagged , | Leave a comment

Great Site For Scripting and Command Line

Twitter is a cool way to find great resources.  Shell fu is following me so I checked out their site, sounded good.  Great resource, lots of useful  and advanced shell scripts and command line tips. Check it out at http://www.shell-fu.org/ Follow … Continue reading

Posted in Command Line | Tagged , , , | Leave a comment