Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8758737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:37:28+00:00 2026-06-13T14:37:28+00:00

What is the order in which executables are searched by linux for executing when

  • 0

What is the order in which executables are searched by linux for executing when a command is executed. I have following:

  1. /bin/play
  2. /home/prabhat/playframework/play

both the above files are in path.

When I execute it from my home directory as in below

prabhat@localhost~/home/prabhat/$ play

/bin/play gets executed.

What is the order in which linux searches for files to be executed. Is there a way to change it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:37:29+00:00Added an answer on June 13, 2026 at 2:37 pm

    The order is defined by the entry order in your PATH variable.

    Note that your shell may cache this info and when you change the PATH you may need to refresh this cache. In bash this is done by the hash command. See here for more information.

    hash command maintains a hash table, which has the used command’s path
    names. When you execute a command, it searches for a command in the
    variable $PATH. But if the command is available in the hash table, it
    picks up from there and executes it

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have an order which has order lines and we have a multi-user
I have two entities say Customer and Order which exist on their own and
I have a table called order which contains columns id , user_id , price
I'm executing an external application using the CreateProcess function, in order which such application
Possible Duplicate: In what order are locations searched to load referenced DLLs? I have
What is the order in which the Windows command prompt executes files with the
I have a column called menu_order which has no default value. When I select
Is the order in which parameters are calculated before a procedure is called defined
Does the order in which parameters are passed to a stored procedure affect the
XmlElement has an Order attribute which you can use to specify the precise order

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.