The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
There is no single command for running every Linux file: use the right interpreter for a script, or execute a program with its path. For a file in the current directory, that usually means ./filename—but first identify unfamiliar downloads and check what kind of file you have.
Run a local executable
Open a terminal in the directory containing the file, then check its name and permissions:
cd ~/Downloads
pwd
ls -l filename
file filename
If it is a native Linux program or a script designed for direct execution, run it by giving its path:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute./filename
If the execute bit is missing, add it for your user and try again:
#1 Best Overall
- KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
- EASY SETUP: Experience simple installation with the USB wired connection
- VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
- SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
- FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.
chmod u+x filename
./filename
The chmod step is needed only when the file lacks execute permission. It changes permission bits; it cannot turn a document, corrupted download, or incompatible program into a working executable.
Why use ./?
./ means “in the current directory.” When you type a command without a slash, Bash normally searches directories listed in $PATH, not the current directory. This avoids accidentally running a file in the current folder just because it has the same name as a familiar command. So use ./program for a program here, an absolute path such as /opt/myapp/bin/program for a specific location, or another relative path such as ../bin/program. Bash documents command lookup through PATH at its reference manual.
Identify the file before choosing a command
A filename extension is a convention, not proof of what the file contains. A file named setup.sh may not be a valid shell script, and a native program can have no extension. Check the file type and permissions:
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minutefile filename
ls -l filename
head -n 1 filename
file may identify an ELF executable, script, text file, archive, shared object, or even HTML saved accidentally instead of the expected download. The first line of a script may contain a shebang, such as #!/usr/bin/env bash, which names the interpreter used when the script is executed directly.
For an unfamiliar download, verify where it came from before running it. If the publisher provides a checksum, calculate and compare it:
sha256sum filename
A checksum match helps confirm that the file matches the publisher’s stated file; it does not, by itself, prove the software is trustworthy. Executing a program gives it the privileges of your account. Do not run or source an unknown file simply because it has an executable bit.
Rank #2
- Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
- Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
- Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
- Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
- Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites
Choose the command for the file type
| What you have | Typical command | Direct execution |
|---|---|---|
| Bash script | bash script.sh |
chmod u+x script.sh && ./script.sh with a suitable shebang |
| POSIX shell script | sh script.sh |
chmod u+x script.sh && ./script.sh with a suitable shebang |
| Python 3 script | python3 script.py |
chmod u+x script.py && ./script.py with a Python shebang |
| Node.js script | node app.js |
Possible with a valid Node shebang; running with node is the usual choice |
| Perl or Ruby script | perl script.pl or ruby script.rb |
Possible with the corresponding interpreter in a valid shebang |
| Java archive | java -jar app.jar |
A JAR is not normally launched with ./ |
| AppImage | chmod u+x app.AppImage && ./app.AppImage |
Same command |
| Native Linux executable | ./program |
Add execute permission first if needed |
Use the runtime the script requires. python3 explicitly requests Python 3; do not assume python maps to Python 3 on every system. Likewise, sh is not necessarily Bash. A Bash script using Bash-specific features should be run with bash, not an arbitrary sh.
Shell scripts: interpreter versus direct execution
To ask Bash to read a script, use:
bash ./script.sh
This does not require the script’s execute bit, but it does require that the file be readable and Bash-compatible. When you run bash script.sh, you have explicitly chosen Bash; the script’s shebang does not choose another interpreter.
For direct execution, the script needs execute permission and a usable shebang, for example:
#!/usr/bin/env bash
chmod u+x script.sh
./script.sh
The kernel uses the shebang to locate an interpreter for an interpreter script; native executables and interpreter scripts are handled through the execution mechanism described in the execve reference. Bash also documents running a script as a file argument and making scripts executable in its shell-scripts guide.
For syntax checking without executing commands, use bash -n script.sh. To trace Bash commands as they run, use bash -x script.sh. For shell-script authors, ShellCheck can flag common issues.
AppImages, archives, and documents
An AppImage is an executable application bundle, not a shell script. From its directory, the usual terminal workflow is:
Rank #3
- All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
- Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
- Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
- Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
- Plastic parts in K120 include 51% certified post-consumer recycled plastic*
chmod u+x MyApp.AppImage
./MyApp.AppImage
That workflow is also given in the AppImage quickstart. If it fails, run it from the terminal so the error remains visible. Do not try to run it with bash. AppImage packaging does not make a download trustworthy; see the AppImage run guide for details on running and inspecting AppImages.
An archive such as a ZIP or tar file is normally extracted, not executed. A PDF, image, or ordinary text document should be opened with an appropriate viewer or application, not launched as a program. If you are unsure, use file rather than guessing from the name.
Set permissions without overdoing it
In output from ls -l, the first characters show the file type and permission bits. For example, -rw-r--r-- is a regular file that its owner can read and write but not execute. Add execute permission for the owner with:
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →chmod u+x script.sh
chmod +x script.sh is also common; it adds execute permission for the applicable user, group, and other classes without replacing existing read and write bits. The x bit means execute for a regular file; on a directory, it means permission to traverse or search that directory. See the chmod manual for mode details.
Avoid chmod 777 as a generic fix. It gives everyone read, write, and execute permission, and still will not fix a missing interpreter, wrong architecture, broken download, missing library, or filesystem that forbids execution.
Use paths and filenames safely
If the file is elsewhere, run it by its absolute or relative path. To move into a directory with spaces, quote it:
Rank #4
- 【Dreamy Rainbow Gaming Keyboard】K521 Gaming Keyboard Adopts a Different LED Backlight Design, Upgraded on the Traditional LED Backlight Effect, Making the Light More Penetrating, Giving You a More Dazzling Visual Effect, Making Your Gaming Process More Enjoyable
- 【One Touch Opens & Visual Feast】The K521 Red Dragon Keyboard has a One-Touch on/off Lighting Button for Added Convenience. It also has a Three-Position Adjustable Breathing Mode and a Four-Position Adjustable Brightness Lighting Mode
- 【Mechanical Feeling & Fast Tapping】The PC Keyboard Keys are Designed for Mechanical Feeling, Giving You a Better Feel During Use and the Ability to Trigger Keys Quickly, Allowing You to Win All Your Games
- 【19 Keys Anti-Ghosting Keyboard】Anti-Ghosting Ensures Every Button Can Be Triggered. This Allows You to Trigger Key Combinations In The Game Accurately, And Each Skill Can Be Accurately Released to Increase Your Winning Rate. Redragon K521 Will Be Your Perfect Partner
- 【12 Multimedia Combination Keys】The K521 Wired Gaming Keyboard is Equipped with 12 Multimedia Keys That Can Greatly Enhance Your Gaming/Office Efficiency and Make It More Convenient to Use
cd "$HOME/My Files"
./"my application"
You can also escape spaces with backslashes: cd ~/My Files and ./my application. Press Tab to complete a path rather than typing a long name by hand.
Recommended Free Tools
Pass a program’s arguments after its path:
./program --verbose --output "result file.txt"
For a shell script, positional arguments are available as $1, $2, and so on; "$@" represents all arguments. Quote paths and arguments containing spaces so the shell passes them as one value. If a filename begins with a hyphen, giving it a path avoids some option-parsing confusion—for example, ./-script.
Run a program installed elsewhere
If a command is installed in a directory on $PATH, run it by name. Check what your shell will find with:
command -v program
type -a program
echo "$PATH"
If the program is not found, it may not be installed, may not be on $PATH, or may be a local file that needs ./. Do not add the current directory (.) to $PATH as a shortcut: doing so makes it easier to run an unintended file. A personal executable directory such as ~/.local/bin is a safer place for programs you trust, provided that directory is configured in your shell’s PATH.
Run a program in the background or stop it
To start a program in the background while keeping the terminal open, append &:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
./program &
For a simple command that should continue after you log out, nohup can redirect output to a log:
Best Value
- All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
- Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
- Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
- Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
- Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later
nohup ./program > program.log 2>&1 &
Use jobs to view jobs started by the current shell, fg to bring one to the foreground, or bg to resume a suspended job. Press Ctrl+C to interrupt a foreground program; Ctrl+Z suspends it. For a long-running service, use a service manager such as systemd rather than treating nohup as a service supervisor; systemd’s execution settings are documented in its execution reference.
Do not confuse executing with sourcing
Running a script normally starts it separately:
./setup.sh
Sourcing reads its commands into your current shell instead:
source setup.sh
# or
. setup.sh
That can change your current directory, environment variables, aliases, functions, or other shell state. Because the commands run in your session with your privileges, do not source an untrusted script. The Bash exec builtin is different again: exec ./program replaces the current shell process with the program, so the original shell does not return if execution succeeds; see the POSIX exec reference.
Free tools Windows power users keep installed
One-click scans. No signup required.
Troubleshoot common errors
| Message or symptom | What to check |
|---|---|
command not found |
If the file is in the current directory, try ./filename. If it is meant to be an installed command, check command -v name, spelling, installation, and $PATH. |
Permission denied |
Check ls -l filename and, if appropriate, add owner execute permission with chmod u+x filename. If execute permission is already present, check parent-directory access, mount options such as noexec, and security policy. |
No such file or directory |
Check pwd, the spelling and path, and whether the file exists with ls -l ./filename. For a script, the interpreter in its shebang may be missing; for a native program, its required dynamic loader may be unavailable. |
bad interpreter |
Inspect the first line with head -n 1 script and check that the named interpreter exists, for example with command -v bash. |
Exec format error |
Check whether the file is actually executable and compatible: run file ./filename and uname -m. A wrong CPU architecture, incomplete download, or script without a usable interpreter declaration can cause this. |
cannot execute: required file not found |
A malformed shebang, missing interpreter, or Windows CRLF line endings may be involved. Inspect the first line with sed -n '1p' script | cat -A. If line endings are the problem, convert them with an installed tool such as dos2unix script, or use an editor that can save Unix line endings. |
| Missing shared library | For a compatible native, dynamically linked program, ldd ./program may show unresolved dependencies. Consult the software’s installation instructions; do not treat ldd as a universal or risk-free inspection method for arbitrary untrusted binaries. |
| Window closes immediately | Start the program from a terminal instead of a file manager so its output remains visible. Immediately afterward, echo $? prints its exit status; 0 conventionally means success, while nonzero values are program-specific. |
If a script behaves differently than expected, check the working directory with pwd, because paths inside the script may be relative to where it was launched. Also consider the environment, interpreter, user, and PATH. To trace a Bash script, use bash -x script.sh.
An execute bit does not override a filesystem mounted with noexec. On systems with findmnt, findmnt -T ./filename can help identify the mount containing the file; mount tools and security policies vary by distribution and environment. Containers, WSL, network filesystems, and security controls such as SELinux or AppArmor can impose additional rules, so the basic commands may not explain every failure.
Use elevated privileges only when needed
sudo runs a command with elevated privileges, for example sudo ./installer.sh. Use it only when the task genuinely requires those privileges and you trust the program. It does not fix an invalid executable, missing interpreter or library, incompatible architecture, or noexec mount. Read the error first and use the least privilege needed.
Quick Recap
Quick reference
- Local executable:
./program - Bash script:
bash script.sh - Python 3 script:
python3 script.py - Make a script executable for yourself:
chmod u+x script.sh, then./script.sh - AppImage:
chmod u+x app.AppImage, then./app.AppImage - Run in the background:
./program & - Source into the current shell only when you intend its commands to change that session:
source setup.sh
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

