Questions tagged [executable]

The permission bit in a file mode that allows a file to be run as a program. Also, questions related the format of program files, and to locating and executing program files.

Filter by
Sorted by
Tagged with
66
votes
3answers
21k views

Shebang line with `#!/usr/bin/env command --argument` fails on Linux

I've got a simple script: #!/usr/bin/env ruby --verbose # script.rb puts "hi" On my OSX box, it runs fine: osx% ./script.rb hi However, on my linux box, it throws an error linux% ./script.rb /usr/...
0
votes
1answer
46 views

Problem running several programs or commands at the same time

I had a problem because I have to execute near 1700 times the same program with different data. That program do several calculations using iterations, and the answer is obtained 5 hours later ...
1
vote
2answers
43 views

Log which system executables have been used

I have an Ubuntu-based Dockerfile and I'd like to change it to be based on a minimal Debian or maybe even Alpine. The problem is that I'm relying on a lot of system executables that came preinstalled ...
26
votes
5answers
54k views

Running sh script: «Permission denied» despite the executable bit and root rights

I installed Debian in VirtualBox (for various experiments which usually broke my system) and tried to launch the VirtualBox guest addon script. I logged in as root and tried to launch autorun.sh, but ...
1
vote
0answers
51 views

can't uncheck “allow executing file as a program” from txt files

I can't remember how i have made all .txt files on my external hard-drive with NTFS executable in Ubuntu, so that whenever i double-click any .txt file on that disk or open the right-click menu, it ...
0
votes
0answers
40 views

Why I can't open text files when execetue “x” permission is on?

for example I have test_file and I run sudo chmod 775 test_file so now while I'm the owner I can read,write and execute it but with graphical interface it doesn't work, I don't have any error messages ...
2
votes
3answers
555 views

Is there any benefit to grouping similar programs into a single path directory?

I'm setting up prometheus in a web server, and I noticed that each exporter is its own program that must be added to a directory in $PATH. My question is, is there any advantage to making a ...
104
votes
4answers
83k views

Where should a local executable be placed?

I have an executable for the perforce version control client (p4). I can't place it in /opt/local because I don't have root privileges. Is there a standard location where it needs to be placed under $...
2
votes
6answers
13k views

File extensions and association with programs in linux

In windows we can associate a file's extension with programs. E.g. a file test.pl can be run by the installed Perl interpreter due to the pl extension. In linux though it needs #!/usr/bin/perl as the ...
15
votes
2answers
2k views

bash: ./*.exe: No such file or directory with executables named *.exe

Looks like I cannot run any normal linux binaries if their name ends with .exe, any idea why? $ cp /bin/pwd pwd $ ./pwd /home/premek This is ok. But... $ cp /bin/pwd pwd.exe $ ./pwd.exe bash: ./pwd....
74
votes
10answers
264k views

chroot: failed to run command ‘/bin/bash’: No such file or directory

When I run the chroot command an error is given: failed to run command ‘/bin/bash’: No such file or directory
0
votes
1answer
28 views

How can I make a specific piece of code portable for running on different systems through a pipe?

Quite often, when I search a solution to a problem, I end up finding lines of code like the following: curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python - ...
0
votes
1answer
850 views

lmgrd: No such file or directory

While there are comparable questions out there, I have not found a solution for this specific circumstance. And I admit that this particular question may be appropriate to only me; however, the ...
5
votes
3answers
59k views

-ksh: revenue_ext.ksh: not found [No such file or directory]

I am getting the same not found [No such file or directory] error when trying to execute a ksh script. Read tips about the PATH and running the script with a ./ in the posts here and here and tried ...
2
votes
1answer
93 views

How to create a desktop entry for .jar files?

I created a desktop entry and moved it to ~/.local/share/applications, but it doesn't execute when I click on it from the start menu. This is my .desktop file: [Desktop Entry] Type=Application ...
2
votes
2answers
9k views

Which of /usr/bin/perl or /usr/local/bin/perl should be used?

If I have both /usr/bin/perl and /usr/local/bin/perl available on a system, which one should I use?
0
votes
0answers
25 views

How to add library to executable file and view it with ldd command?

I want to know how to add library to executable file and view it with ldd command?
44
votes
7answers
23k views

List all binaries from $PATH

Is there a one-liner that will list all executables from $PATH in Bash?
3
votes
3answers
3k views

Is there a way to embed an executable binary in a shell script without extra tools?

I'm looking for a way to have an executable binary hardwired into a script. Something like this: #!/bin/bash ...some shell code execute binary: >>> binary code ......
58
votes
4answers
45k views

What is the difference between running “bash script.sh” and “./script.sh”?

If script.sh is just something typical like #!/bin/bash echo "Hello World!" Is there a preferred way to run the script? I think you first have to chmod it so it becomes executable?
3
votes
2answers
2k views

Set executable heap

The execstack program can be used to mark ELF-binaries as needing an executable stack. Is there a similar way to mark the heap as executable? Preferably for a single binary but if that's not ...
1
vote
2answers
2k views

Preserve file permissions and symlinks in archive with 7-Zip

I have a directory test with three files, ls -l test: total 8 -rw-r--r-- 1 mb mb 16 Jul 25 11:12 regular_file -rwxr-xr-x 1 mb mb 19 Jul 25 11:02 script.sh lrwxrwxrwx 1 mb mb 12 Jul 25 11:14 symlink -&...
2
votes
0answers
87 views

“No such file or directory” but the binary exist

I recently installed an dynamic binary translation program to run x86_64 binary on my ARMv8 server. After I uninstall the DBT tool, I found some weird error messages and it is very comfusing. A little ...
2
votes
2answers
215 views

Find all executable files excluding certain directories

I'm looking to find all executable files that are NOT in my $PATH. Currently I'm doing this find / \( -path "/opt" -prune -o -path "/var" -prune -o -path "/bin" -prune -o ...
7
votes
6answers
42k views

Running python script from Linux Terminal

I have downloaded this script named, pyAES.py and put it in a folder name codes, inside a Desktop directory of my Linux, According to this example, http://brandon.sternefamily.net/2007/06/aes-...
33
votes
5answers
23k views

Binary compatibility between Mac OS X and Linux

Brace yourselves, this question will likely appear naive and/or foolish, seeing as I am relatively new to the inner workings of unix like systems, and programming in general. Ready? Ok! I will go ...
7
votes
2answers
3k views

Default to “Execute” when double-clicking on a shell script in PCManFM

Is it possible to get an executable to execute by default? What I mean is this. I have an .sh file, which if I click on twice, it will show me this: If I then click Execute, it does the right thing....
45
votes
8answers
74k views

Different ways to execute a shell script

There are several ways to execute a script. The ones I know are: /path/to/script # using the path (absolute or relative) . script # using the . (dot) source script # using the `source` ...
37
votes
2answers
171k views

sudo: unable to execute ./script.sh: no such file or directory

I'm stumped. I have a script in my /home directory which is executable: [user@server ~]$ ll total 4 -rwx------ 1 user user 2608 Jul 15 18:23 qa.sh However, when I attempt to run it with sudo it says ...
0
votes
3answers
136 views

Do 'executable' file systems exist?

Are there any Unix/Linux filesystems that do the following? if the file is executable, return a virtual file containing the stdout generated by executing it (it would have to be non-writable, I ...
10
votes
1answer
2k views

Accidentally ran chmod +x /* - How bad did I just mess up?

I wanted to mark all of the files in the directory I was in as executable, and I ran chmod +x /* because I thought that was the command to mark all the files in the directory you were currently in as ...
111
votes
5answers
331k views

Why do we use “./” (dot slash) to execute a file in Linux/UNIX?

Why do we use ./filename to execute a file in linux? Why not just enter it like other commands gcc, ls etc...
4
votes
4answers
163 views

I want to terminate a python script if it doesn’t output anything to the terminal in 2 min

Here's my current bash which is just a loop while true ; do python3 /Users/Name/Desktop/pythoncode.py done I want to terminate pythoncode.py if it doesn’t output anything to the terminal in 2 ...
0
votes
0answers
12 views

How to set timeout [duplicate]

I am using a bash executable to run a python script in a loop Sometimes the browser (run by the python script) will stop loading and stop working for hours until I manually come and close the window ...
0
votes
1answer
244 views

How to run external executables within firejail

My machine is home desktop(personal) running Debian Buster with i3 window manager. I recently installed firejail with apt install firejail* firetools and also downloaded the new Firefox 83 browser ...
4
votes
4answers
17k views

Find executable files recursively

I have got the directory called Test and a few directories inside it. Both Test and the directories inside it have executable files. I'd like to print them with ls. I'd use this command. ls -l `find ...
1
vote
1answer
1k views

Fish: The file is not executable by this user

I made fish function in ~/.config/fish/functions/confgit.fish: function confgit /home/john/Projects/confgit $argv end But when I run this function it just says: fish: The file “/home/john/...
0
votes
1answer
175 views

Recursively setting all files in a directory as non-executable [duplicate]

I have an external hard-drive formatted as NTFS which I use to back-up and store files from both Linux and Windows (as I am dual-booting). I recently bought a new computer and installed Linux Mint 20 ...
0
votes
0answers
62 views

Compiling C on Manjaro

First of all, I'm pretty new to the whole Linux world so sorry if this question may seem stupid. I'm currently studying informatics and telecommunications, I tried Linux for the first time about 2 ...
1
vote
3answers
2k views

How to display all the unix commands available on the system?

I'm reading a book, Learning Unix for OS X by Dave Taylor. It says: To quickly see all of the binary executables—Unix programs—on your system, Open the Terminal, hold down the Shift key, ...
0
votes
1answer
75 views

Unix Executable to the directory it is housed in Mac

I am trying to make an executable script on Mac where it makes the directory it is housed in the current directory (cd) and then runs some more commands. I started with a find command however in the ...
0
votes
0answers
69 views

Blacklist/whitelist applications in Linux

I would like to learn about solutions/alternatives for managing execution access to applications in Linux-based systems (specifically Fedora flavours). I already researched into possibilities like ...
6
votes
1answer
1k views

Why does Unix set the executable flag for FAT file systems? [closed]

I've noticed that when I mount a FAT filesystem on Linux, all of the files have their executable permissions set. Why is this? There's almost no chance that you can or want to directly execute any ...
6
votes
6answers
2k views

Fastest way to determine if shebang is present

If I have a file with #!/usr/bin/env foobar what is the fastest/best way to determine if this file has a hashbang? I hear you can just read the first 2 bytes? How?
0
votes
0answers
53 views

No such file or directory but the file is clearly there

I run my make file and get an output E1code3 which I then try to execute by typing ./E1code3 I get the error message no such file or directroy but it is clearly there! I have tried to change name to ...
44
votes
3answers
89k views

How to convert a shell script into a binary executable?

I want to convert my shell scripts into binary executable so that nobody else could edit or read it. Is there a way to convert it into a binary executable?
0
votes
1answer
2k views

Why am I receiving the “zsh: exec format error: ./metal” error?

I am attempting to run a Unix executable program (Metal; https://genome.sph.umich.edu/wiki/METAL_Quick_Start) from the terminal. I continue to get the following error: zsh: exec format error. I have ...
1
vote
0answers
20 views

How to produce ANOM_EXEC event in auditd journal?

I am using Ubuntu 16, and want to produce ANOM_EXEC event in auditd journal, like such i found in internet: type=ANOM_EXEC msg=audit(1222174623.498:608): user pid=12965 uid=1 auid=2 ses=1 msg='op=PAM:...
1
vote
1answer
501 views

Is it possible to have systemd open a program running in a clean terminal automatically after startup?

First off apologies for the simple question- there is more to it that I will explain below. I am new to Linux style systems and evidently I have A LOT to learn. With that said... My System I am ...
4
votes
0answers
258 views

Linux kernel cannot execute any binary (error -12)

Problem: Memory Allocation Problem my platform: SOC = STM32H743 (ARMv7E-M | Cortex-M7) Board = Waveshare CoreH7XXI Linux Kernel = 5.8.10 (stable 2020-09-17) initial defconfig file = stm32_defconfig ...

1
2 3 4 5
11