Executables vs Shared objects

I noticed something while doing find /bin -exec file {} \; : the file command reports some entries in /bin are shared objects , while others as executables . For instance, /bin/ntfsck: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=312d93fd0d8653e7236a61db2e67b93c63225a00, stripped Same report for gawk … Read more

Command to perform a recursive chmod to make all .sh files within a directory executable?

Trying to perform a recursive chmod on all the .sh files in a directory to make them executable Answer To make this possible you can use the find command and search for all files with a .sh extension and then run the chmod command on each one found: find /directory/of/interest/ -type f -iname “*.sh” -exec … Read more

Is there any way to stop a user from creating executables and running them?

Ransomware attacks could use zero-day exploits, but often an attacker will just fool a gullible user into running an executable by downloading and clicking. Suppose we have a naive user and want to restrict them to the normal path. Is there any way to restrict them from creating a file with executable privilege? Or, more … Read more

Bash: ./filename : Cannot execute binary file

I couldn’t execute a fortran compiled code in ubuntu 11.10 32 bit. Error message is bash: ./filename : Cannot execute binary file. I’ve installed the gcc and gfortran libraries too. Could anyone help? $ file um um: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped … Read more

What is the equivalent of an “exe file”?

I don’t know what the exact executable file extension is. Is it .deb or .tar.gz? Answer Linux extension Windows Equivalent Short description .so, .o .dll Object that can be loaded at runtime (Similar to DLL) .a .lib Static library [none], .elf(rare), .exe, .com(rare) Linux executables .bin(rare) .sh .bat Shell script .exe .exe Mono application, Wine … Read more

What is the difference between ./ and sh to run a script?

I have written a simple script. When I runsh <myscriptname.sh>, i got the correct output, but when I run ./<myscriptname.sh>, I got an error. What is difference between when I do sh and ./? Answer When you run any script by passing the filename to the script interpreter program, you are running the interpreter program … Read more

bash: ./program: cannot execute binary file: Exec format error

I’m trying to run a program, but an error happens like this: bash: ./program: cannot execute binary file: Exec format error The result of file program was: program: ELF-32-bit LSB executable, ARM, EABI4 version 1 (SYSV), dynamically linked(uses share libs), for GNU/LINUX 2.6.16, not stripped How can I fix this error? I’m using Ubuntu 14.04.2 … Read more