Linux command to find and run program

1152175 pts.
Tags:
Linux
In Linux, how am I able to find a specific program (through the directory and sub-directories) and then run it? If someone can just get me started, that would be great.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.
How to Find and Process Files Using the Find CommandPermalink
The -exec option runs commands against every object that matches the find expression. Consider the following example:

find . -name “rc.conf” -exec chmod o+r ‘{}’ \;
This filters every object in the current hierarchy (.) for files named rc.conf and runs the chmod o+r command to modify file permissions of the find results.

The commands run with the -exec are executed in the root directory of the find process. Use -execdir to execute the specified command in the directory where the match resides. This may alleviate security concerns and produce more desirable performance for some operations.

The -exec or -execdir options run without further prompts. If you prefer to be prompted before action is taken, replace -exec with -ok or -execdir with -okdir.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Subhendu Sen
    You can try this on Linux Terminal,

    find / -name filename

    OR

    wheris -b filename

    Replace filename with your file name or program name. Linux commands are case sensitive.

    141,190 pointsBadges:
    report
  • Subhendu Sen
    You can also do the same job with a GUI tool on Linux OS. For that purpose you can download/ install Gnome Search Tool, which is here, https://pkgs.org/download/gnome-search-tool

    Or you can use Nautilus which has built-in search facility.

    141,190 pointsBadges:
    report
  • pranavkrishna
    cmd: locate filename 
    this will work out.

    25 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: