LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-18-2009, 11:48 PM   #1
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Rep: Reputation: 31
setting the command path


hi friends,
I am using ubuntu 8.10..In that i tried one command. But it says the following error..

Code:
bash: emulator: command not found
This command is used in android development.
i think i have to set the path. But i dont know how to set the path. This is the list of /bin
Code:
sharief@sharief-desktop:/bin$ ls
bash                  dnsdomainname  mountpoint      sleep
bunzip2               dumpkeys       mt              stty
bzcat                 echo           mt-gnu          su
bzcmp                 ed             mv              sync
bzdiff                egrep          nano            tailf
bzegrep               false          nc              tar
bzexe                 fgconsole      nc.traditional  tempfile
bzfgrep               fgrep          netcat          touch
bzgrep                fuser          netstat         true
bzip2                 fusermount     ntfs-3g         ulockmgr_server
bzip2recover          grep           ntfs-3g.probe   umount
bzless                gunzip         open            uname
bzmore                gzexe          openvt          uncompress
cat                   gzip           pidof           unicode_start
chgrp                 hostname       ping            vdir
chmod                 ip             ping6           which
chown                 kbd_mode       ps              zcat
chvt                  kill           pwd             zcmp
cp                    ld_static      rbash           zdiff
cpio                  ln             readlink        zegrep
dash                  loadkeys       rm              zfgrep
date                  login          rmdir           zforce
dbus-cleanup-sockets  ls             rnano           zgrep
dbus-daemon           lsmod          run-parts       zless
dbus-uuidgen          mkdir          sed             zmore
dd                    mknod          setfont         znew
df                    mktemp         setupcon
dir                   more           sh
dmesg                 mount          sh.distrib
sharief@sharief-desktop:/bin$
can anyone help me how to set this command in this path?
 
Old 10-19-2009, 12:07 AM   #2
eth1
Member
 
Registered: May 2008
Posts: 97

Rep: Reputation: 20
I don't see the command/binary emulator in the directory you've shown a listing of.

Can you type the following commands and provide the results ?

Quote:
whereis emulator
Quote:
updatedb &
Quote:
locate emulator
 
Old 10-19-2009, 12:10 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
First of all, you should determine the exact name and location of the command you want to execute. Are you sure you have the right command name? I don't see "emulator" in the output above, so it's not in /bin, at least. Check /usr/local/bin, for example, or try running a locate/find command.

Second, what is your current path? "echo $PATH" will print out your current path settings. Note that your path may be set differently for different users; root especially usually has extra directories such as /sbin added to it.

Once you know what directory you need to add to your path, the command itself is rather simple.
Code:
export PATH="/path/to/newdir:$PATH"
This will add the new directory to the front of the current path string. Note that this is only good for the current shell though. To make it permanent, you'll have to edit the PATH string in one of your shell startup files, usually ~/.bashrc for individual users, or /etc/bashrc for global settings, but this could vary.

(We're assuming bash here. If you're running another shell the syntax for setting variables may be slightly different.)


Alternately, you could just create a symlink from your executable in one of the directories already in your path.


Finally, you do know that this is a common question that's been asked and answered thousands of times before, don't you? You could've just done a quick search here or in google and found the answer.
 
Old 10-19-2009, 03:08 AM   #4
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
Yes this is the result for "whereis emulator"

Code:
sharief@sharief-desktop:~$ whereis emulator
emulator:
sharief@sharief-desktop:~$
the o/p for "updatedb &"
Code:
sharief@sharief-desktop:~$ updatedb &
[1] 5643
sharief@sharief-desktop:~$ updatedb: can not open a temporary file for `/var/lib/mlocate/mlocate.db'
sharief@sharief-desktop:~$
the o/p for "locate emulator"
Code:
sharief@sharief-desktop:~$ locate emulator
/etc/alternatives/x-terminal-emulator
/etc/alternatives/x-terminal-emulator.1.gz
/home/sharief/.local/share/Trash/files/linux-2.2.6.29/arch/mips/include/asm/fpu_emulator.h
/home/sharief/.local/share/Trash/files/linux-2.6.29/arch/mips/include/asm/fpu_emulator.h
/home/sharief/.local/share/Trash/files/linux-2.6.30/arch/mips/include/asm/fpu_emulator.h
/home/sharief/.local/share/Trash/files/linux-2.6.30.1/arch/mips/include/asm/fpu_emulator.h
/home/sharief/Desktop/SDK/android-sdk-linux_x86-1.5_r3/docs/guide/developing/tools/emulator.html
/home/sharief/Desktop/SDK/android-sdk-linux_x86-1.5_r3/docs/images/emulator-hvga-p.png
/home/sharief/Desktop/SDK/android-sdk-linux_x86-1.5_r3/docs/images/emulator.png
/home/sharief/Desktop/SDK/android-sdk-linux_x86-1.5_r3/tools/emulator
/home/sharief/Desktop/kernelroot/linux-2.6.29/arch/mips/include/asm/fpu_emulator.h
/home/sharief/Desktop/kernelroot/linux-2.6.30/arch/mips/include/asm/fpu_emulator.h
/usr/bin/x-terminal-emulator
/usr/share/app-install/desktop/qemulator.desktop
/usr/share/app-install/desktop/sugar-emulator.desktop
/usr/share/app-install/icons/qemulator.svg
/usr/share/man/man1/x-terminal-emulator.1.gz
/usr/src/linux-headers-2.6.27-7/include/asm-mips/fpu_emulator.h
/var/lib/dpkg/alternatives/x-terminal-emulator
[1]+  Exit 1                  updatedb
sharief@sharief-desktop:~$
 
Old 10-19-2009, 03:14 AM   #5
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
i dont know how to set the path. I tried but it seems wrong

Code:
sharief@sharief-desktop:~$ export PATH-$PATH:/home/sharief/Desktop/SDK/android-sdk-linux_x86-1.5_r3/tools/emulator
bash: export: `PATH-/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/sharief/Desktop/SDK/android-sdk-linux_x86-1.5_r3/tools/emulator': not a valid identifier
sharief@sharief-desktop:~$
i dont know what to do now..
 
Old 10-19-2009, 03:18 AM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
To assign a value to a variable you do var=value. There's no '=' in your command.
 
Old 10-19-2009, 10:23 PM   #7
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
yes thank you. Now its works fine. Thank you
 
Old 10-20-2009, 08:30 AM   #8
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
oh...Again i am having thus problem for other command..

Code:
sharief@sharief-desktop:~/Desktop/SDK/android-sdk-linux_x86-1.5_r3/tools$ export PATH=$PATH:/home/sharief/Desktop/SDK/android-sdk-linux_x86-1.5_r3/tools/android
i think this is correct to set the apth. But i dont know wht its not working

oh...Again i am having thus problem for other command..
Code:
bash: android: command not found
 
Old 10-20-2009, 09:41 AM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
If you have executables scattered all over the place it may be preferable to symlink them from the directories that are already in your $PATH. For example, as root:
Code:
cd /usr/bin
/bin/ls emulator  # Make sure the name is not already in use
/bin/ln -s /home/sharief/Desktop/SDK/android-sdk-linux_x86-1.5_r3/tools/emulator emulator
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get the absolute path information of a command from ps command output ratul_11 Linux - General 1 08-06-2008 03:10 AM
Setting PATH shridevi Linux - Newbie 4 12-11-2007 12:19 PM
setting the path for a command?? arunsri Linux - Software 1 03-13-2005 05:26 AM
setting a path mjkramer Linux - Newbie 8 11-18-2004 08:35 PM
Setting up PATH Sonny Linux - Newbie 4 01-28-2002 02:02 PM


All times are GMT -5. The time now is 12:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration