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

100
votes
6answers
6k 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 ...
15
votes
1answer
375 views

How to trick a particular command into thinking it is a different date?

How can I execute a command making it believe that is on a different date than system one? For instance, if I have this script: #!/usr/bin/env bash date +"%B %d, %Y" It prints the actual date: ...
7
votes
5answers
5k 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?
4
votes
1answer
156 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 ...
2
votes
3answers
180 views

Shell script not executing

Not sure what is happening. Lets call script a.sh with the following /users/guru$ cat a.sh #! /usr/bin/ksh echo "Hello" date Execute with ksh. It gets done. /users/guru$ ksh a.sh Hello Tue Jul ...
2
votes
1answer
44 views

Bash Script Permission denied & Bad Interpreter

I'm on a kali linux 64 bit. I have created a python script which takes 2 arguments to start. I don't want to type out every time the exact same paths or search in the history of the commands I used ...
0
votes
1answer
313 views

Can't run executable file on Ubuntu, terminal expects sudo, or gives errors like “Invalid or incomplete multibyte or wide character”

I'm trying to run executable files on Ubuntu, but it's not working, although the exact same executable file works fine on others' machines, which are also running Ubuntu 12.04 like me. Based on this, ...
4
votes
2answers
46 views

Find out extension of executable files?

When I am building software from source on a GNU+Linux system, during the ./configure stage I frequently see the following line: checking for suffix of executables... How do I create such a check ...
0
votes
2answers
57 views

Why do I have to execute bash programs with ./? [duplicate]

Why is it that some bash programs will only run on my system when I type ./ before their name? An example: In my [...]/android/sdk folders I have to execute adb like this: ./adb devices Why not ...
4
votes
1answer
47 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 ...
1
vote
1answer
491 views

How to add a program to be indexed by Synapse?

I downloaded the IntelliJ community edition and I'm currently running it by clicking the shell script that is in the folder of IntelliJ I was wondering how I can make Synapse recognize the idea.sh ...
2
votes
3answers
146 views

How is it possible to do a live update while a program is running?

I wonder how killer applications such as Thunderbird or Firefox can be updated via the system's package manager while they are still running. What happens with the old code while they are being ...
4
votes
2answers
217 views

Why there are multiple folders for executable files in Linux? [duplicate]

I'm trying to understand Linux file system, and one of the question is: 1- Why there are multiple folders for executable files: /usr/bin, /usr/sbin/ and /usr/local/bin? Is there any differences ...
2
votes
0answers
97 views

Shebang: History and Purpose

I have few questions about the magic number #!, the shebang. I read that it was introduced by Dennis Ritchie in the 70s as a way to see a script as an executable file. I don't understand, why it was ...
2
votes
3answers
520 views

Run script without ./ before the name

I am running a quite complicated script which changes directories and runs many other commands. All these commands are run using 'scriptname', which works fine when I execute the main script from my ...
18
votes
2answers
2k 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?
1
vote
1answer
296 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 ...
1
vote
2answers
55 views

How many sections can I create in object file?

I'm following the course of Baking Pi – Operating Systems Development. In it they created another section .init. So can we create as many sections as we want (not just .data, .bss, .text) and can we ...
24
votes
2answers
11k views

Getting “Not found” message when running a 32-bit binary on a 64-bit system

I have currently a strange problem on debian (wheezy/amd64). I have created a chroot to install a server (i can't give any more detail about it, sorry). Let's call its path /chr_path/. To make things ...
0
votes
0answers
10 views

make: arm-elf-gcc: Command not found [duplicate]

I'm working on an application for a Moxa UC-7110, and I have installed their tool chain, which provides a cross compiler for their arm architecture on uClinux. I'm on on Ubuntu 12.04 LTS. I'm having ...
5
votes
1answer
201 views

How do I view executables run by a program?

Is there a way to view or get a list of executables that a program uses? A particular example is file-roller. Is there a way to see which executables it uses, if there is more than one executable it ...
27
votes
5answers
1k views

Execution of possibly harmful program on Linux

I'm writing a program that will test programs written by students. I'm afraid that I can't trust them and I need to make sure that it won't end up badly for the computer running it. I was thinking ...
0
votes
6answers
1k 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 ...
0
votes
1answer
36 views

Compiling for Red Hat 5.9

I need to compile a C++ application to run on Red Hat 5.9, but I don't have access to a development server that runs Red Hat 5.9. My current executable compiled on Ubuntu 10.04 produces the error ...
1
vote
1answer
82 views

can't get hello world shell script to run in FreeBSD

Server is running FreeBSD 9.2. Using vim, I wrote the following script called hello: #!/bin/sh echo "hello world" Then I set it as executable: >chmod 755 hello Then I tried to run it from ...
0
votes
2answers
3k views

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

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

A file exists but executing it doesn't work

I downloaded a Java tarball, extracted the archive and copied over scp to a remote machine. Using the ls command, the java executable exists: ubuntu@Ubuntu:~$ ls -la /home/ubuntu/jre1.7.0_55/bin/ ...
1
vote
1answer
44 views

How to compile to a specific executable format?

I'm a bit confused. I just read this: http://www.es.freebsd.org/doc/handbook/binary-formats.html, which basically says that freeBSD uses the elf binary format. But when I compile my code I using cc, I ...
0
votes
1answer
48 views

Create a package for debian that contain other program/deb package

I need some direction about this matter. I need to create a package or an executable program that will install some other deb package like tightvnc... So basically when I user execute my package, ...
6
votes
3answers
2k views

If I see a process running using ps, how can I find the executable?

If I can see a process running using ps -e, how can I find the file which launched it?
0
votes
1answer
54 views

Trouble creating symbolic link [closed]

I installed a software on OpenSUSE. However, to open it one has to type /usr/local/software/start_software everytime. I tried creating a symbolic link using sudo ln -s ...
8
votes
3answers
204 views

where to put binaries so they are always in path and can be found easily

I am making quite some binaries, scripts etc that I want to install easily (using my own rpms). Since I want them accessible for everyone, my intuition would be to put them in /usr/bin; no need to ...
4
votes
3answers
6k views

Running python script from terminal without .py extension

I want to call a python script script.py from the terminal by simply typing script. Is this possible? If so, how? I know I can avoid typing python script.py by adding #!/usr/bin/env python to the top ...
1
vote
1answer
76 views

List files, directories and executables in current directory

I have php shell and I have function that do just that (but it give me error when I call scandir($path) function because of restriction in php), so I need to use my bash shell to do the same. It can ...
1
vote
5answers
114 views

override hardcoded paths in executables

I'd like to override some hardcoded paths stored in pre-compiled executables like "/usr/share/nmap/" and redirect them to another dir. My ideal solution should not require root priviledges, so ...
12
votes
1answer
835 views

Loading of shared libraries and RAM usage

I'm wondering about the way Linux manages shared libraries. (actually I'm talking about Maemo Fremantle, a Debian-based distro released in 2009 running on 256MB RAM). Let's assume we have two ...
4
votes
6answers
195 views

List all binaries from $PATH

Is there one-liner that will list all executables from $PATH in bash.
8
votes
2answers
1k views

Test whether Linux binary is compiled as position independent code

I recently learned that (at least on Fedora and Red Hat Enterprise Linux), executable programs that are compiled as Position Independent Executables (PIE) receive stronger address space randomization ...
2
votes
3answers
299 views

How to recover from recursive 'chmod -x' on my home folder

I pressed ENTER after typing the following stupid command on my home directory: find . -type f -exec chmod -x '{}' ';' What do you advise as a fix for this. My guess is that I can't do anything but ...
1
vote
1answer
83 views

How to find out the dynamic libraries executables loads when run

I want to find out the list of dynamic libraries a binary loads when run (With their full paths). I am using CentOS 6.0. How to do this?
5
votes
3answers
393 views

Why does this executable still execute after I deleted it?

I deleted the executable, so why is it still running? root@raspberrypi:/test# ls -la total 11096 drwxrwxrwx 2 pi pi 4096 Mar 12 18:26 . drwxrwxr-x 11 pi pi 4096 Feb 28 13:50 .. -rwxrw-rw- 1 ...
14
votes
2answers
1k views

How are system commands like ls created?

I'm a *nux newbie and I have some doubts regarding *nix. I don't know which type of executable file is ls, whether it is .sh or .ksh or any other kind of system executable if it is, what is that? ...
5
votes
2answers
7k views

Viewing Linux Library / Executable version info

In Windows, EXE and DLL have version info, including at least the following fields: file version product version internal name product name copyright In Linux Library / Executable: Which fields ...
2
votes
0answers
36 views

Set list of applications allowed for execution by unprivileged user

I am working on a project of security enforced Linux-based system (kernel 2.6.32 + Gnome 2 + Centos package base mostly). We need to implement the restriction of execution of unallowed executables. ...
2
votes
0answers
108 views

/proc/self/maps - 3rd mapped piece of file?

I'm running Arch linux on my laptop, which is kernel 3.12.9 right now. Something has changed about the way the kernel maps in a dynamically-linked executable and I can't figure it out. Here's the ...
4
votes
2answers
127 views

run perl script with unknown perl location

I'm developing a perl script which expected to be downloaded by Mac users with a very small knowledge of shell, linux etc, let's say office managers and accountants. After the downloading the script ...
0
votes
0answers
15 views

Restore system with no execute permissions for bash and chmod [duplicate]

Good day everyone! One of my friends asked me a question: how to restore an unbootable Linux system (let it be CentOS or whatever) in the following situation: no execute permissions for bash no ...
3
votes
1answer
655 views

Why is permission denied for npm start using node-dev?

I am trying to start a node.js application with on a low permissions user. All the files I know of are owned by the correct user and have permissions set reasonably well. I'm trying to use a script ...
2
votes
2answers
890 views

Why does sshd requires an absolute path?

Why does sshd require an absolute path when restarting, e.g /usr/sbin/sshd rather than sshd Are there any security implications? P.S the error message: # sshd sshd re-exec requires execution with ...
4
votes
2answers
72 views

File executable by all, yet still cannot be executed?

As shown by the following code: ll total 136 -rwxr-xr-x 1 kaiyin kaiyin 19067 May 9 2013 dbmeister.py -rwxr-xr-x 1 kaiyin kaiyin 1617 Jul 29 2011 locuszoom -rwxr-xr-x 1 kaiyin kaiyin 112546 May ...