Search This Blog

Friday, December 2, 2011

Display or print UNIX / Linux path ~ $PATH variable

In UNIX / Linux file systems, the human-readable address of a resource is defined by PATH. On Unix / Linux like operating systems, (as well as on DOS / Windows and its descendants), PATH is an environment variable listing a set of paths to directories where executables may be found.
Display current PATH

Use echo command:
$ echo $PATH
Output:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games

Modify current PATH

Use export command to add /opt/games to PATH, enter:
export PATH=$PATH:/opt/games

To format your PATH variable for easy viewing, add following code to your bash startup file (such as ~/.bashrc or ~/.bash_profile) :

function path(){
old=$IFS
IFS=:
printf "%s\n" $PATH
IFS=$old
}

(Function credit: usenet archive)

Now just run path:
$ path
Output:

/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
/usr/bin/X11
/usr/games

Source: http://www.cyberciti.biz/faq/howto-print-path-variable/

Thursday, December 1, 2011

How to Find the JAVA HOME Directory in ubuntu linux

Code:

$ whereis java
java: /usr/bin/java /etc/java /usr/share/java

That tells the command java resides in /usr/bin/java.

Dig again:

Code:

$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 2009-01-15 18:34 /usr/bin/java -> /etc/alternatives/java

So, now we know that /usr/bin/java is actually a symbolic link to /etc/alternatives/java.

Dig deeper using the same method above:
Code:

$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 31 2009-01-15 18:34 /etc/alternatives/java -> /usr/local/jre1.6.0_07/bin/java

So, thats the actual location of java: /usr/local/jre.....
You could still dig deeper to find other symbolic links.

Source: http://ubuntuforums.org/showthread.php?t=1054731

How to set JAVA HOME path in Linux

~/.bash_profile is a startup script which generally runs once. This particular file is used for commands which run when the normal user logs in. Common uses for .bash_profile are to set environment variables such as PATH, JAVA_HOME, to create aliases for shell commands, and to set the default permissions for newly created files.
Set JAVA_HOME / PATH for single user

Login to your account and open .bash_profile file
$ vi ~/.bash_profile
Set JAVA_HOME as follows using syntax export JAVA_HOME=. If your path is set to /usr/java/jdk1.5.0_07/bin/java, set it as follows:
export JAVA_HOME=/usr/java/jdk1.5.0_07/bin/java
Set PATH as follows:
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin
Save and close the file. Just logout and login back to see new changes:
$ echo $JAVA_HOME
$ echo $PATH
Tip: Use the following command to find out exact path to which java executable under UNIX / Linux:
$ which java

Please note that the file ~/.bashrc is similar, with the exception that ~/.bash_profile runs only for Bash login shells and .bashrc runs for every new Bash shell.
Set JAVA_HOME / PATH for all user

You need to setup global config in /etc/profile OR /etc/bash.bashrc file for all users:
# vi /etc/profile
Next setup PATH / JAVA_PATH variables as follows:
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin


Source: http://www.cyberciti.biz/faq/linux-unix-set-java_home-path-variable/

Wednesday, November 30, 2011

How to Install Java in Linux

1. Use following command to know the current jdk version available in apt-get
sudo apt-cache search jdk

2. Use following command to install JDK and JRE
apt-get install sun-java6-jdk sun-java6-jre

Friday, November 25, 2011

Error: gzip: stdin: not in gzip format

# gzip -d xxxxxx.x.tar.gz
# tar -zxvf xxxxxx.x.x.tar

It gives following error:
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors

Solution:
You used "tar -zxvf" for the second command. the 'z' option tells tar to use gzip to uncompress the file. Since you already uncompressed it in the first command, gzip doesn't know what to do with it, and it consequently croaks. Tar stops because gzip encountered a problem. So, with the file you have now, you would extract it with:
tar -xvf xxxxxx.x.x.tar

I would go back and re-gzip the tar file though (to save space):
gzip xxxxxx.x.x.tar
tar -zxvf xxxxxx.x.x.tar.gz

Source: http://www.linuxquestions.org/questions/linux-newbie-8/tar-error-child-returned-status-1-a-208083/

Sunday, September 18, 2011

How to install FileZilla FTP Software in Ubuntu 8.04

Here is the command to install FileZilla:

Just run your terminal and write:

sudo aptitude install filezilla

It asks you for password. Enter your password.

Thursday, July 7, 2011

HP Printer : Laser Jet M 1213 NF MFP

Qs. I have installed BOSS 4.0 O.S on my system I want add the printer above said....I install the drivers and the printer get detects but, when i want to print the page it comes in a Queue ang gives no print out

Similarly is the case with canon 3108p Printer.


Ans: Try with latest Hplip package from debian.
Refer this http://hplipopensource.com/hplip-web/install/install/index.html for installing hplip-3.11. In the distribution select debian-6.0 and proceed with the installation.

Courtsey: boss-support@googlegroups.com

Sunday, March 27, 2011

How to upgrade an existing kernel version to a newer version

Qs. I am having BOSS kernel 2.6.26 installed on my PC and I want to upgrade that version to 2.6.32 without deleting the existing applications installed on my previous version?

Ans:  download linux-image-2.6.32 from latest repo and install using sudo dpkg -i
         Installing a newer kernel will no way affect your other existing applications.
         You can straight away install any number of kernel in a existing partition and boot from that.

 
Qs. Is there is any system that we can Install some patches in the existing kernel and upgrade it??
Ans: If the kernel supports DKMS then you can upgrade individual drivers alone..not the whole kernel

Thursday, February 10, 2011

Unable to install BOSS 4.0 on Hp Laptop 8510P


Problem: Trying to install BOSS 4.0 on My HP laptop 8510P but it halts at software selection......



Solution:
press ctlr+alt+f4 / f5 in the hanging place and check what is wrong..
               the  DVD  may be corrupted..