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.

learn more… | top users | synonyms

34
votes
8answers
3k views

Why does Bash's source not need the execution bit?

with Bash's source it is possible to execute a script without execution bit set. This is documented and expected behavoir, but isn't this against the use of an execution bit? I know, that source ...
1
vote
1answer
359 views

“Illegal instruction” on a static MIPS binary

On my MIPS box I'm trying to run a program. I use a cross compiler for mips. When I run my program, I'm getting Illegal instruction I pulled of one binary from it, called cputest. It basically ...
3
votes
1answer
803 views

Directories showing up in green(executable) even after removing execute permission for all [duplicate]

I just copied a directory from a USB flash drive. I copied it from an NTFS drive and so all the files had execute permission. I executed chmod -x * to undo the execute permission. Despite that, all ...
6
votes
4answers
1k views

Join the executable and all its libraries

Lets say I have a /bin/cat executable that uses the following shared libraries: linux-vdso.so.1 libc.so.6 /lib64/ld-linux-x86-64.so.2 Is it possible to somehow "join" that stuff together (...
32
votes
2answers
1k views

Difference between “command not found” and “no such file or directory”?

For example: $ node -bash: /usr/local/bin/node: No such file or directory $ foo -bash: foo: command not found What's the difference? In both cases, node and foo are invalid commands, but it seems ...
9
votes
1answer
1k views

Can capabilities be used in scripts without setcap'ing the interpreter binary?

Right now I'm using cap_net_bind_service MY_USERNAME in /etc/security/capability.conf. Now I just need to set cap_net_bind_service+i on the interpreter of my favouite scripting language to be able to ...
3
votes
1answer
36 views

How to receive input from 2 files on an executable

Basically, I want to receive input from 2 different files whem I'm calling an executable on terminal Like: ./a.out < file1.pgm file2.pgm I want to read both the files input on my code, one ...
35
votes
7answers
21k views

Can a script be executable but not readable?

Is it possible to execute a script if there is no permission to read it? In root mode, I made a script and I want the other user to execute this script but not read it. I did chmod to forbid read and ...
2
votes
2answers
70 views

Is there a way to route all commands through a shell script instead of running directly?

Sorry about the title, I can't explain it very well without an example. I want to be able to have everything being executed, rather than running the program, runs a shell script with the executable as ...
4
votes
1answer
110 views

Why can't I execute Android x86 executables on Linux

I am trying to port Android apps to Linux (don't laugh :) and I have come across a problem. When trying to execute an Android executable (app_process) after adding the executable permission with ./...
1
vote
1answer
45 views

Combining Bash Script and Script Resources into One Executable

When trying to execute a bash script, it is often execute inside some directory, and requires access to local resources. I was wondering if there was a way to combine both the bash script and the ...
3
votes
1answer
11k 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 ...
10
votes
3answers
795 views

How does a shell execute a program?

If I compile a program using gcc, and try to execute it from the bash shell, what is the exact sequence of steps followed by bash to execute it ? I know fork(), execve(), loader, dynamic linker (and ...
1
vote
1answer
1k views

How to add 'Make executable' and 'Run' entries to Elementary OS file manager context menu?

I know this is to be done by creating a .contract file in /usr/share/contractor. For example, one like this will add a menu option to open a folder as root. [Contractor Entry] Name=Open folder as ...
9
votes
3answers
815 views

Detect if an ELF binary was built with gprof instrumentation?

Is it possible to check if given program was compiled with GNU gprof instrumentation, i.e. with '-pg' flag passed to both compiler and linker, without running it to check if it would generate a gmon....
2
votes
4answers
574 views

Execute binary code

I have a binary code and I want to run it. 01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010 01101100 01100100 How can I create a file "application/x-executable" and ...
70
votes
1answer
7k views

Why does the following script delete itself?

If you create an executable file with the following contents, and run it, it will delete itself. How does this work? #!/bin/rm
22
votes
6answers
52k views

#!/bin/bash - no such file or directory

I've created a bash script but when I try to execute it, I get #!/bin/bash no such file or directory I need to run the command: bash script.sh for it to work. How can I fix this?
1
vote
1answer
42 views

Rc.local not running commands properly

I am running arch Linux and have used this rc-local service: [Unit] Description=/etc/rc.local compatibility [Service] Type=oneshot ExecStart=/etc/rc.local RemainAfterExit=yes [Install] WantedBy=...
2
votes
1answer
6k views

“No such file or directory” on files that exist? [duplicate]

In the past day, I've found at least 4 binaries that say "bin-name: No such file or directory" when I try to run them. Even if I type part of the name and tab complete it, I get the same error. I'm on ...
0
votes
1answer
32 views

Is my compilation false?

I thought my compliation was okay because no errors were printed out, yet when I try to run the executable, he tells me that it's unreachable... coppan12@b048-08:~$ gcc -Wall prog.c -o prog coppan12@...
1
vote
2answers
37 views

How to know the path of a running executable?

I am working on a Linux server, and I running different jobs on different node. However, when compiling my program, I didn't set their specific name, so they are all a.out Now I found one of the ...
6
votes
2answers
12k 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 ...
0
votes
0answers
19 views

autocomplete in noexec mounted drive

I noticed that bash won't let me tab-complete executable files in a noexec file system. I'm assuming that in order for it to actually auto-complete, the file has to be within the PATH and at least ...
126
votes
1answer
8k views

How is Mono magical?

I'm learning C#, so I made a little C# program that says Hello, World!, then compiled it with mono-csc and ran it with mono: $ mono-csc Hello.cs $ mono Hello.exe Hello, World! I noticed that when I ...
131
votes
9answers
19k views

How to chmod without /usr/bin/chmod?

Today I was told a tale by a Unix trainer, a tale where the root password got leaked to the students, and one of the fellas removed the execute permission from /usr/bin/chmod itself. How do you ...
1
vote
1answer
3k views

permission denied when executing binary despite “rwx” privilege and root user

I'm trying to execute some binary with bash. I am getting a "Permission denied" message despite having given the full privileges (chmod 777) and being the 'root' user: This is the file description: -...
38
votes
3answers
15k views

Does the shebang determine the shell which runs the script?

This may be a silly question, but I ask it still. If I have declared a shebang #!/bin/bash in the beginning of my_shell_script.sh, so do I always have to invoke this script using bash [my@comp]$...
0
votes
0answers
57 views

Unable to run executable on secondary machine

My primary computer can run a program (hc12-coff-gcc) located in the usr/local/bin directory. My secondary computer cannot run the same program. the usr/local/bin directory is in the PATH for both ...
0
votes
1answer
35 views

executable files to normal files via terminal CentOS7

Today I copied some files from the shared folder (Host is a Win7) to my VM ( Guest is a CentOS7). I did this with root permissions. Then I copied th files to my apache location /var/www/html/test I ...
3
votes
1answer
102 views

How can I extract Signatures data from a Windows `exe` file under Linux using cli

If you go to the VirusTotal link , there is a tab called file info(I think; mine is dutch). You'll see a header called "Authenticode signature block and FileVersionInfo properties" I want to ...
7
votes
0answers
130 views

Why does OS X `install` errors on redirected input when the same version of `install` on linux works fine?

I would like to use install command in order to create a new executable file with pre-populated content (e.g. with single pwd command in it). So I've extended this example which creates a new empty ...
4
votes
0answers
74 views

Why doesn't `strip` remove section headers from ELF executables?

A minimal ELF executable only requires the ELF header and at least one program header in order to be functional. However, when I run strip on a short executable, it decides not to throw out the ...
26
votes
6answers
23k views

Can we get compiler information from an elf binary?

Is there some chance to know how a binary was built, under Linux? (and or other Unix) Compiler, version, time, flags etc... I looked at readelf and couldn't find much, but there might be other ways ...
9
votes
4answers
648 views

How to install executables

I sometimes run into software that is not offered in .deb or .rpm but only as an executable. For example Visual Studio Code, WebStorm or Kerbal Space Programm. For this question, I will take Visual ...
6
votes
1answer
554 views

Check last time .sh file used

When you run ./myscript.sh is that considered as "access" time? I need to know the last time a script was run, but I'm not sure if this counts as mtime, ctime or atime (differences described here).
0
votes
4answers
1k views

noexec on /tmp and /var/tmp directory

Our client servers are running old version of jboss (Jboss 4.0) which has lots of known vulnerabilities. Result is that the server is hacked and we are seeing some unknown executables running from /...
20
votes
2answers
9k 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 $...
0
votes
0answers
16 views

Bash fails to run executable with No such file or directory [duplicate]

I have an executable copied to an Ubuntu 14.04 AWS instance, and I: chmod +x MyExe.bin ./MyExe.bin And I get: -bash: ./MyExe.bin: No such file or directory This is strange because: The file is ...
1
vote
1answer
66 views

Linux: How to mount a drive from command line

I normally mount my drives just by opening it from filesystem. It automatically mount when I open/click on a drive. But I wanted to mount a drive from command line. I did ran this command sudo mount -...
1
vote
2answers
368 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?
3
votes
1answer
119 views

Can not run executable files from a mounted drive

I have downloaded eclipse and rubymine and previously placed in home folder. Then I used to open both programs by double clicking on eclipse.sh and rubymine.sh. Now I moved these two folders in a ...
0
votes
2answers
40 views

Executable file isn't “really there” after rsync [duplicate]

I am issuing the following rsync command (obfuscating the exact path & host), which should copy two binaries: rsync -e "ssh -p 443" -a --info=progress2 -z user@remote:/srv/cgi-bin/ . user@remotes'...
8
votes
7answers
2k views

List all binaries from $PATH

Is there one-liner that will list all executables from $PATH in bash.
0
votes
1answer
82 views

File does exist but won't execute [duplicate]

I have a file that does exist but won't execute. It says : "No such file or directory". This file is created by a script while creating a "custom toolchain" to compile native libraries for Android ...
1
vote
2answers
72 views

Difference between /usr/bin and /usr/local/bin [duplicate]

What is the difference between /usr/bin and /usr/local/bin? Why are there both directories and why do some executable programs exist in both directories?
1
vote
1answer
69 views

Where is the nginx executable on Debian? [closed]

I've installed the nginx-light package on debian, but I can't find the executable. It's not in /usr/bin, like it says on the official nginx website. Where is it, then?
0
votes
0answers
65 views

Equivalent to OS X's py2app and Windows's py2exe?

I'm writing an application in Python. I don't expect my end users to be particularly tech-savvy, so I'd like to package it up like a familiar native executable. For OS X, that means running it ...
5
votes
3answers
4k views

“No such file or directory” when executing a cross-compiled program on a Raspberry Pi

I recently bought a Raspberry Pi. I already have configured it, and I install a cross compiler for arm on my desktop (amd64). I compiled a simple "hello world" program and then I copy it from my ...
2
votes
0answers
11 views

How can I add my program to system program list (Ubuntu 14.04)? [duplicate]

I made a my program in c++ and generated its executable but every time I need to use my program I need to change my directory to the folder and then execute it. How do I make my program run like an ...