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

10
votes
3answers
779 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 ...
4
votes
1answer
69 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
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 ...
8
votes
3answers
800 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 ...
2
votes
4answers
536 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
8
votes
1answer
997 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 ...
22
votes
6answers
50k 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
39 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] ...
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 ...
1
vote
2answers
32 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 ...
5
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 ...
125
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 ...
129
votes
9answers
18k 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: ...
36
votes
3answers
14k 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 ...
0
votes
0answers
55 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
31 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
73 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 ...
6
votes
0answers
118 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
62 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
22k 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
620 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
541 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 ...
19
votes
2answers
8k 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
50 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
310 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
99 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
34 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/ . ...
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
69 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
69 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
64 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
57 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 ...
3
votes
2answers
94 views

Handling duplicate programs names bash

I'm wondering if $PATH cascades entries. You'll all need to take a leap of faith with me here, but here it goes. Let's say we have a Java executable at /usr/bin/java but this version is very old and ...
21
votes
2answers
25k 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
408 views

Installing Wine 1.8 on Debian not working

I followed this link http://tecadmin.net/install-wine-on-ubuntu-and-debian/# to install Wine on Debian 7.9 Wheezy but to no avail. When I reached step sudo ./configure --enable-win64 it asked for ...
0
votes
0answers
44 views

Aardvark Control Center wants TLS/SSE2 Library

Environment: CentOS 7.1 64-bit using Intel i7-4771 Gnome 3 shell I downloaded the Aardvark Control Center (Total Phase) and tried to execute the controlctr bash file, however I received the error ...
-1
votes
1answer
124 views

Remote app - bash: cannot execute binary file [duplicate]

I have an app in a remote Linux machine. I am trying to execute the app via ssh, but I get the error: bash: /app: cannot execute binary file Why is this happening? The application works fine in the ...
3
votes
2answers
382 views

The type command can't distinguish between an executable command and a shell script

So I was reading the book The Linux Command Line, and it says that commands are of four types: (1) executable programs (2) shell builtins (3) shell functions (shell scripts) (4) ...
1
vote
1answer
140 views

Executable not visible when run with sudo [duplicate]

Platform: Ubuntu 10.04 VM running out of VirtualBox File details: -rwxr-x--- 1 myuser myuser 123 2013-10-31 16:10 myscript.sh The executable is visible in the directory: >type myscript.sh ...
3
votes
1answer
56 views

setuid example from Wikipedia: 4700

I was reading about setuid on Wikipedia. One of the examples goes as follows: 4700 SUID on an executable file owned by "root" A user named "tails" attempts to execute the file. The file ...
1
vote
2answers
878 views

Java does not run with error “No such file or directory”, despite it exists and is x86_64

The file exists but bash complains it doesn't when asked to execute it. $ ./Libs/openjdk-1.8.0_60-eap/bin/java bash: ./Libs/openjdk-1.8.0_60-eap/bin/java: No such file or directory $ ls -l ...
1
vote
1answer
25 views

a.out - Data segment and text segment are contiguous iff text segment is not shared. Why is this so?

I was reading the man page for the ancient a.out format (located here), trying to understand the evolution of Unix executable formats. I was wondering about something. The man page says that if the ...