How to Make Files Executable in Linux – Terminal & File Manager Guide!

Опубликовано: 27 Февраль 2026
на канале: LinuxHowTo
54
0

Need to make a file executable in Linux? In this video, we’ll show you how to do it using both the terminal and the file manager. Whether you prefer the command line or a graphical interface, we’ve got you covered. Follow these simple steps to make your files executable and ready to run!

Learn:
1. Using the Terminal

You can use the chmod command to make a file executable.

-Make a File Executable for the Owner (User):

chmod u+x filename
u = user (owner)
+x = add execute permission

-Make a File Executable for Everyone:

chmod +x filename
or
chmod a+x filename
a = all (user, group, others)

-Make a File Executable with Specific Permissions:

chmod 755 filename
7 (user: read + write + execute)
5 (group & others: read + execute)

-Verify Permissions:

ls -l filename

Example output:
rw-r--r- 1 user group 0 Aug 17 10:00 filename # Not executable (no 'x')
-rwxr-xr-x 1 user group 0 Aug 17 10:00 filename # Executable (has 'x')
(x means executable)


2. Using the File Manager (GUI)

-In Nautilus (GNOME Files), Dolphin (KDE), Thunar (XFCE), etc.:

Right-click the file.
Select Properties (or Permissions).
Look for "Allow executing file as program" (or similar).
Check the box to enable execution.
Click OK or Apply.

-Alternative Method (Nautilus):

Right-click → Properties → Permissions → Set "Execute" dropdown to "Anyone" or "Owner only".

✅ Important Notes
Scripts: If the file is a script (e.g., Bash, Python), ensure it has a proper shebang (e.g., #!/bin/bash or #!/usr/bin/env python3).
Filesystem: If the file is on an NTFS/FAT32 partition, Linux may ignore permissions. Use chmod after copying to a Linux filesystem (ext4, btrfs, etc.).
Execution: If you get a "Command Not Found" error when running, try:

./filename
(instead of just filename).

✅ Summary:

Terminal (user-only) chmod u+x filename
Terminal (all users) chmod +x filename
File Manager Right-click → Properties → Allow execution


✅ Why Make Files Executable?
Run Scripts: Execute shell scripts, Python scripts, and other programs directly.
Control Access: Specify who can execute the file (user, group, others).
Security: Ensure only authorized users can run certain files.

✅ Pro Tips:
Use Absolute Paths: When running executable files, use absolute paths (e.g., /path/to/file).
Check Permissions: Regularly verify file permissions to ensure they are set correctly.
Backup Files: Always keep backups before making permission changes.

You can find the tutorial PDF for this guide at this GitLab link: https://gitlab.com/hatem-badawi/linux.... This PDF includes detailed steps and examples for making files executable in Linux .

Hit subscribe for more Linux tips and like if this helped.
Let us know: What method will you use to make files executable?

👉 Watch now and make your files executable with ease!

#LinuxTips #FilePermissions #ExecutableFiles #TerminalTips #FileManager

(Short, clear, and packed with practical knowledge!)