FG
💻 Software

How to execute python script from console without writing full path?

Fresh5 days ago
Mar 15, 202648125 views
Confidence Score0%
0%

Problem

I have a few python scripts on /usr/share/scripts/ that I use often, and I want to be able to execute them by just writing the name and not the full path, how could I do this? echo $PATH shows me: So I tried writing on the terminal: No errors shown and echo $PATH now shows my new scripts path, but …

Error Output

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/real/RealPlayer

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to execute python script from console without writing full path?

Low Risk

Set executable permissions for python scripts by "chmod +x *" Now you have two options: Add your scripts directory to PATH env variable, or Make symbolic links to your scripts one by one (or write another script to do the same) in directory. Example…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment