LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-20-2014, 05:54 AM   #1
massy
Member
 
Registered: Nov 2013
Distribution: CentOS 6.4
Posts: 198
Blog Entries: 1

Rep: Reputation: Disabled
How to perform a command from another Path


For example echo;
type -a echo

echo is a shell bultin
echo is /bin/echo
echo is /usr/local/bin/echo

I want to use third part of it.
 
Old 01-20-2014, 06:52 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,716

Rep: Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035
In general just provide the full path the command / file you want to use in your script or on the command line.

For example in a bash script:

Code:
#!/bin/bash

echo "This is the shell builtin"
/bin/echo "This is /bin/echo"
/usr/local/bin/echo "And this is from /usr/local/bin/echo"
 
2 members found this post helpful.
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script to perform more than one command stevo520 Linux - Newbie 6 06-24-2012 09:43 AM
[SOLVED] Command path is in PATH but bash does not find the command. stf92 Linux - Newbie 17 03-23-2012 04:19 AM
How to perform command in time interval? your_shadow03 Linux - Newbie 2 06-16-2009 01:11 AM
Can't perform root command by using Sudo acbenny Linux - General 6 05-07-2008 08:19 PM
How do I perform a command on all files + subdirectories robertbrownell Linux - Newbie 2 02-11-2007 08:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:17 AM.

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