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.

0
votes
0answers
44 views

How can I make a progress bar for a shell script calling an executable? [duplicate]

I don't want to make a progress bar for the script itself, but rather the duration of the executable that it calls. So for instance, #!/bin/sh echo "some stuff" <do some stuff> echo "some ...
0
votes
1answer
620 views

How to list all commands available from $PATH [duplicate]

I would like to list all commands available in $PATH. Any idea ?
3
votes
2answers
799 views

setgid: chmod g+s,g-x on executable

I'm not understanding setgid on executables on my platform (ubuntu). g-x,g+s is not giving the process effective group permissions of the program's owner. $ gcc perms.c -o perms; ls -l ; ./perms -...
0
votes
0answers
40 views

Variable expansion succeeds with echo but fails without a command (execution by expansion) [duplicate]

I created a file nano ~/uncwe/configurations/variables.sh. This file contains: set -a rse="~/${repo}/internal_software/rse.sh" set +a I sourced the file, then tried to execute: ${rse} bash ${rse} ...
3
votes
5answers
169 views

How to execute many files in the same directory in a minimal, DRY, pretty way?

I use Ubuntu 16.04 and I have a localization file, a file that executes many files, that I got after downloading my own GitHub project to my machine. This file contains a Bash script, and is named ...
0
votes
1answer
49 views

Set two or more files for execution (via source) in a comfortable way to read

I used the following way to execute a collection of Bash script files, in the current Bash session: source ~/myScripts/{assignments.sh,nginx_conf.sh,php_conf.sh,drush_install.sh} It feels to me ...
3
votes
2answers
949 views

How does bash execute commands

This is more of a general question I have been curious about but put simply: how does bash execute commands given to it via a script or terminal? It would be possible, I guess, to have a bunch of if ...
36
votes
4answers
11k views

What is the min and max values of exit codes in Linux?

What is the min and max values of the following exit codes in Linux: The exit code returned from a binary executable (for example: a C program). The exit code returned from a bash script (when ...
2
votes
1answer
263 views

Recovering from removing execute permission from ld-linux.so

After reading about removing the execute permission from chmod, I got curious. Is it possible to recover from removing the execute permission from ld-linux.so without rebooting if I haven't yet exited ...
-1
votes
1answer
10k views

Running executable file: No such file or directory [closed]

I am trying to run an executable file called i686-elf-gcc in my Kali Linux that I downloaded from this repository. It's a cross-compiler. The problem is that even though the terminal and a script that ...
1
vote
1answer
7k views

Cannot run .exe files

Normally my Linux OS allows me to create runnable executables (like a.out), but when I attempt to download an .exe from the Internet, it basically is permission restricted (neither user has execution (...
3
votes
1answer
131 views

Can you put multiple executable scripts in one directory, and by sourcing that directory make all of those commands available?

I want to put a bunch of executable scripts in the .command dir (which is also executable), and then only have to source that directory in my .bash_profile. Is this possible? I can get this to work ...
0
votes
1answer
921 views

How to start a console program at startup(inside ../openbox/autostart)

I have a console program: #include <iostream> #include <stdio.h> using namespace std; int main() { printf("please num1:"); int a; cin>>a; printf("please num2:"); int b; cin>>...
2
votes
5answers
459 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
1answer
201 views

Change the default executable for file with potentially missing shebang

I have a library - users are to create executable files, potentially with a hashbang to tell exec which executable to use. If they omit the hashbang, then I think most systems default to /bin/sh, I ...
4
votes
4answers
1k views

Overwriting a running executable or .so

I have a question about overwriting a running executable, or overwriting a shared library (.so) file that's in use by one or more running programs. Back in the day, for the obvious reasons, ...
5
votes
1answer
99 views

What are the main execution stages in Linux (how does a program basically gets executed in Linux)?

I understand that there are two stages of execution in Linux, dealing with every command we run. I'll name this how I understand them because I don't know the original phrasing: Shell handling --- ...
0
votes
1answer
436 views

Do we need c libraries when running a program?

The executable file should be in machine code. So, will make system calls without a need for c libraries. But, I can not figure out what this image means? Is it just an abstraction method?
-1
votes
2answers
140 views

How can a regular user circumvent a restriction on running ls imposed by root?

Suppose a root user denied all permissions to use the 'ls' command for a specific regular user in a system. How can that regular user overcome this denial and how can he use 'ls' command with out any ...
3
votes
2answers
547 views

xslt shbang: Using xslt from the command line

I have (foolishly?) written a couple of moderately general-purpose xslt scripts. I'd quite like to turn these into executables that read an xml document from standard in or similar. The way you do ...
-1
votes
1answer
163 views

Fstrim version and usage [closed]

I have one fstrim executable file and need a way of finding that executable file version.
0
votes
2answers
72 views

KDE consider programs as libraries (.so), How to change file assotiation for program?

Question: How to make the correct file extension association in KDE so programs are executable from the UI? Linux 4.9 Debian 9 (stretch) stable version 64bit 2017-09-28. KDE Plasma as included ...
0
votes
3answers
1k views

I'm unable to run AppImage applications in openSUSE Tumbleweed

I recently had to reinstall my system (openSUSE Tumbleweed), and I'm experiencing some problems to run AppImage applications. In particular, they are FontBase and Gravit Designer; the files are of ...
3
votes
2answers
371 views

In Aix is there any command which gives a path or link to executable of the process under /proc/<pid>

I tried ls -l /proc/17301504 there is no exe which gives me full path to command. Is there a way to get the full path of command in Aix 5 and above as in Linux? There is a.out in /proc/17301504/...
23
votes
1answer
9k views

What does “LSB” mean when referring to executable files in the output of /bin/file?

I have found the term "LSB executable" or "LSB shared object" in the output of the file command in Linux. For example: $ file /bin/ls /bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), ...
1
vote
2answers
544 views

How may I watch for the creation of a particular “trigger file”?

I need to create a shell script that executes an application when a file called start is created in a particular directory. How may I write a shell script that waits for the creation of a file with a ...
-2
votes
1answer
92 views

Permissions to a script in a folder acting weird [duplicate]

I created a script, and I want it to be rwx only by root. All other can only x. What I have now [root@localhost /]# chmod 755 scripts/ -v mode of 'scripts/' retained as 0755 (rwxr-xr-x) [root@...
3
votes
2answers
534 views

What's the purpose of the execute permission?

Suppose setuid/setgid bits are of no concern. Why is there a separate permission for execution? Philosophically, it feels to me that the write permission subsumes the read permission, and that the ...
1
vote
1answer
156 views

.desktop file will not launch the desired program, despite being identical in syntax to a working file

I have a game executable at ~/Games/factorio/bin/x64/factorio that I want to run from dmenu. I've created the shortcut below: [Desktop Entry] Type=Application Name=Factorio Path=/home/[USERNAME]/...
-1
votes
1answer
421 views

How to run a Executable file at boot time?

I am using Debian OS I have one executable file (a.out), Now I need to run this file after boot up Immediately. I tried with etc/rc.local. Any suggestion? Thanks.
1
vote
1answer
34 views

Copy an executable to an arbitrary number of hosts?

How can I copy an executable file to an arbitrary number of hosts and have it run on all of them? Sending this .exe to 20 hosts. Trying to have the files go into the /tmp directory. Setting up a lab ...
12
votes
3answers
19k views

Linux executable fails with “File not found” even though the file is there and in PATH

I want to launch the wine executable (Version 2.12), but I get the following error ($=shell prompt): $ wine bash: /usr/bin/wine: No such file or directory $ /usr/bin/wine bash: /usr/bin/wine: No such ...
1
vote
1answer
85 views

Restrict applications from accessing certain resources

Mobile operating systems like Android or iOS define sets of permissions (e.g. read contacts/send sms/access camera, ...) a user needs to specifically grant to an application in order for the latter to ...
1
vote
0answers
28 views

Custom executable cannot run shortly after boot up.

Having a strange issue when running some custom executables on a Yocto distribution with the Xilinx kernel shortly after booting. Here's a rundown of my actions: Boot system SSH into system once ...
2
votes
4answers
2k views

Is the bin/ directory for storing binary files?

I have seen many tutorials saying that the bin directory is used to store binary files, meaning there is only 0 and 1 in the files in that directory. However, in many cases, I see files in bin that ...
21
votes
1answer
821 views

How did the ~/.local/bin thing start? How widespread is it?

I find more and more tools that put executables into ~/.local/bin. I am old and for me ~/bin is the place in my $HOME for executables. Where did this crazy new fashion originate? Why are people doing ...
0
votes
1answer
868 views

Run a file automatically in terminal when you click on it

I'm using Linux debian 4.9.0-kali4-amd64 #1 SMP Debian 4.9.30-1kali1 (2017-06-06) x86_64 GNU/Linux and want to make /home/pantheon/Desktop/pycrust-20170611-2151.sh run in terminal when I klick on it. ...
10
votes
4answers
11k views

ls colors: why are some of my fonts black and others green in ls output

I uploaded some font files to AWS (running Amazon Linux) and moved them to the /usr/share/fonts directory using a cp command in .ebextensions. When I SSH in from my mac and use ls -a, I see some ...
6
votes
1answer
469 views

Does the noexec mount option imply nosuid?

Many guides on the internet recommend setting the nosuid and noexec options, for example on the /tmp mount point. But doesn't noexec imply nosuid? What cannot get executed cannot make use of the suid ...
1
vote
1answer
1k views

C compiler cannot create executables when installing gcc AND binutils

I've been having a problem with building pretty much any GNU program. I try to build Binutils, or GCC using: ./configure make make install However, ./configure always seems to throw the error: ...
2
votes
2answers
82 views

Can binaries built from source be installed on a second machine?

I'm not sure if this is the best place to ask this - please point me in the right direction if there's a better place. Let's say, hypothetically, that I have two machines - A is a development machine,...
-2
votes
1answer
3k views

Is it possible to convert a .exe file to runnable Linux file? [duplicate]

I have a file called ttsql in linux and windows machine. But that ttsql file builded separately for windows and linux. The windows file is working properly. But In linux , Which is not working. How ...
4
votes
1answer
1k views

a program made in c runs on double click in windows but not in linux

I have made a simple addition program in C in both OS, Linux (Ubuntu and CentOS) and Windows 7 with the same source code, which is as follows: #include <stdio.h> int main(){ int a,s,d; printf("...
4
votes
1answer
2k views

Despite execution privilege, getting permission denied

Compiled a binary from the golang source, but it won't execute. I tried downloading the binary, which also didn't work. Permissions all seem to be right. Running the file from go for some reason works....
5
votes
4answers
396 views

Include more instructions on how to run file in hashbang or elsewhere

I have this at the top of a script #!/usr/bin/env mocha as most people know, this tells the OS which executable to use to execute the script. However, my question is - how can we include more ...
4
votes
3answers
688 views

Will overwriting to an executable file affect a process which is running the original executable file?

When a executable file is run in a process, if the executable file is overwritten or deleted and then recreated by reinstallation, will the process rerun the new executable file? Does the answer to ...
2
votes
2answers
945 views

create executable files via piping

Using pipes, one can create files with simple shell built-ins. { echo "#!/bin/bash" \ echo "echo Hello, World!" \ } > helloworld.sh With chmod these can then be made executable. $ chmod 755 ...
6
votes
2answers
1k views

reason to add execute permissions to a shell script

It's a well-known fact that if one wants to execute a script in shell, then the script needs to have execute permissions: $ ls -l total 4 -rw-r--r-- 1 user user 19 Mar 14 01:08 hw $ ./hw bash: ./hw: ...
1
vote
1answer
103 views

Have Linux recognize custom extensions

This question is for a school project so i'm not looking to just be given a block of code or anything, just some direction on how to go about my work. I want to be able to have my own custom file ...
20
votes
4answers
2k views

What is a valid use case for an “execute only” file permission?

I was reading up on chmod and its octal modes. I saw that 1 is execute only. What is a valid use case for an execute only permission? To execute a file, one typically would want read and execute ...