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 814035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:27:25+00:00 2026-05-15T01:27:25+00:00

I know that when you are on shell, the only commands that can be

  • 0

I know that when you are on shell, the only commands that can be used are the ones that can be found on some directory set on PATH.
Even I don’t know how to see what dirs are on my PATH variable (and this is another good question that could be answered), what I’d like to know is:

I come to shell and write:

$ lshw

I want to know a command on shell that can tell me WHERE this command is located. In other words, where this "executable file" is located?

Something like:

$ location lshw
/usr/bin
  • 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-05-15T01:27:26+00:00Added an answer on May 15, 2026 at 1:27 am

    If you’re using Bash or zsh, use this:

    type -a lshw
    

    This will show whether the target is a builtin, a function, an alias or an external executable. If the latter, it will show each place it appears in your PATH.

    bash$ type -a lshw
    lshw is /usr/bin/lshw
    bash$ type -a ls
    ls is aliased to `ls --color=auto'
    ls is /bin/ls
    bash$ zsh
    zsh% type -a which
    which is a shell builtin
    which is /usr/bin/which
    

    In Bash, for functions type -a will also display the function definition. You can use declare -f functionname to do the same thing (you have to use that for zsh, since type -a doesn’t).

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

Sidebar

Related Questions

I know that cd is a shell built-in ,and I can run it by
I'm writing a simple shell that accepts some standard commands like cd and ls
I'm trying to write a shell script that, when run, will set some environment
I know that you can use the shortcutting boolean operators in shell scripts to
I want to open html files from a shell script. I know that Ubuntu
Whenever I open a Bash shell, my classpath is someProgram. I know that adding
I know that Phonegap has an event for back button, but it's only available
I recently discovered that you can set breakpoints in Xcode that will print to
I would like to write a bash script or a few shell commands that
Does anyone know of a C# spell check library that would underline misspelled works

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.