Running ffmpeg in Terminal Linux - linux

I've downloaded and unzipped ffmpeg at custom directory in my Ubuntu linux. Now I want to run this ffmpeg using terminal like I run on windows using command prompt. But everytime it says "ffmpeg: command not found". My question is how can I run ffmpeg using terminal through extracted libraries
thanks

First you need to make sure the file has execute permissions... or just add it with chmod +x filename
Secondly either the executables must be on the path or you need to specify the path to the executable. What I mean by this is, under Windows if you are in a directory with an executable you can type in the executable name and it will work... this is not the case for Linux. If you are in the executable's directory you execute the command like this ./command. The dot means you are executing a file in the current directory

Related

Opening AppImage does nothing. What can I do?

I am a complete newbie to Linux and trying to open an AppImage called Magick which is an Imagemagick application.
I tried right clicking on the AppImage and checked "run file as an executable" option but that didn't work. Another thing that I tried is running this command,
chmod a+x magick.AppImage
This gives me an error,
chmod: cannot access 'magick.AppImage': No such file or directory
I have also tried running the file by navigating into the folder that contains the file and opening up the terminal there but still no luck.
I am running Ubuntu on Oracle VM VirtualBox.
ImageMagick is a command-line tool, you don't run it by clicking on it.
To run it in a terminal you need to
Set the executable flag on the .AppImage (once for all): chmod +x TheApp.AppImage
Then to run it just invoke the AppImage: ./TheApp.AppImage <arg1> <arg2> ....
If the directory with your .AppImage is in your PATH, you can remove the ./ (or whatever directory the AppImage is in).
ImageMagick is also available as a regular application from your Ubuntu repository: sudo apt install imagemagick

How to run executables from terminal in Linux without entering the entire PATH

I'm trying to activate android studio directly from terminal (./studio.sh)
the installation dir is /usr/local/android-studio
and inside there's a bin folder with the script studio.sh
for that I've vi'd ~/.bashrc to include the following line:
export PATH=$PATH:/usr/local/android-studio/bin
When I do echo $PATH i do see the path above appended to the rest of the path
(/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/android-studio/bin)
Yet when I run ./studio.sh it prompts me with No such file or directory
Needless to say, if i cd /usr/local/android-studio/bin and then ./studio.sh it works fine
running debian (jessie 'edition')
I simply needed to do studio.sh without the ./
Thanks for ZanCoul for providing the answer.

Linux executable on cygwin terminal [duplicate]

This question already has answers here:
Executable file generated using GCC under cygwin
(5 answers)
Closed 7 years ago.
Let me tell you my problem. I've a shell script which execute a Linux executable. I don't have access to the source code of this exe.
When I run the script on the Linux machine, there is no problem.
But, if I try to run the script on my Windows laptop, using cygwin, I have the error "cannot execute binary file".
There is any solution ?
Thanks !
From https://stackoverflow.com/a/4144536/5704102:
"... Cygwin is a compatibility layer, which aims to implement as much as possible of the POSIX and Linux APIs within Windows. This means that programs have to be compiled specifically for Cygwin ..."
What does this script look like? Is it a bash script? If so, you may want to try sh <scriptfile> in Cygwin. If this doesn't work, and it is a bash script, make sure you have sh.exe. Type sh and hit tab twice to check.
Another potential issue if it is a bash script is that you don't have something installed that Cygwin requires to run the script. Make sure all the commands the script is trying to run will work. If not, you may have to run the Cygwin installer and install whatever is needed to run the script.
Also, you may want to check permissions.
If the file has an exe extension, it SHOULD work on Windows unless it was compiled for 64 bit architecture and you're running a 32 bit OS. Otherwise, you could be missing some .dll files that the executable relies on.
Edit:
If this is the contents of your script:
echo START
/oper/file.exe
then it's likely you have the incorrect path. Cygwin paths typically start with /cygdrive/c/ in Windows. Go to where the file exists and type pwd to get the correct path, then modify your script accordingly.
Content of Script.sh in oper folder :
echo START
/cygdrive/c/Users/jo/oper/file.exe
In Cygwin terminal (in the right folder):
sh Script.sh
(Path updated)

cygwin binary exec format error

I have a script file that I was given to run in windows using Cygwin. When I try to use this file I get the following error
-bash: /sigdet/filename: cannot execute binary file: Exec format error.
sigdet is the folder within the Cygwin directory that I have the script. Rawdata is the name of the directory with the raw data files that the script is supposed to analyze.
To try and solve this, I have changed the file permissions, I have checked to make sure that it is on a 64 bit machine and the script appears to have compiled on a 64-bit machine. After these steps, I don't know what else the problem could be. Here are the commands I've entered:
I first changed the directory like so:
$ cd /sigdet/
Then I ran the script that is suppsed to work:
$ /sigdet/filename -i rawdata
Does the script file need to have an extension in windows? I've tried changing it to a .sh extension with no luck. I'm told that it just works on other windows machines just how it is.
Thanks to anyone that can help with this.
Your file is not an executable. It most probably contains ELF executable which is designed for Linux operating system, or it's corrupt.
If your file was a shell script, or in fact anything that contained plain text, you'd get different errors (such as, "expected command name" or "unknown command: XYZ" etc.)
Scripts are not supposed to have file extensions, like any executables. On the other hand, they should have shebangs: small text located in the first line that tells the system the path to the interpreter. For example, a Python executable script might be named whatever and have #!/usr/bin/python3 or similar in the first line. When you run it through ./whatever in the shell, it'll look for python3 in /usr/bin and run your file like this: /usr/bin/python3 ./whatever. (In fact, thanks to this you can also specify additional parameters that get passed to the interpreter.)
There is also a chance that your script is valid, but it contains a shebang pointing to bad interpreter. If that is the case, then most likely the path is correct, otherwise you'd get /whatever/interpreter: bad interpreter: no such file or directory error or similar. But then, all the other points apply to the interpreter (which is just another executable...)
If the script and/or interpreter was meant to be executed on Windows or Cygwin at least, it should either contain aforementioned shebang (#!/path in the first name) or it should be Windows executable (in which case the file data should begin with MZ letters, you can inspect it in notepad.) If it isn't, it means the files you were given can't run on Cygwin.
Had this same problem. Added the following at the top of makefile:
export ARCH = CYGNUS
What happened during the make process is that Linux and Windows versions of the executables were created. You just have to use ./.exe versions.
In my case, I got the error when I used a wrong command to compile my C program. When I used the right command:
gcc myprog.c -o myprog.exe
the error was resolved.

sh file not found in linux command line

I'm an owner of synology's diskstation NAS server running on special OS (mainly linux)
It has only access from internet. I established command line interface to access it using synology wiki. Now I try to install Counter-Strike server on it using SteamCMD. I just look in Valve Developer Community for it.
I'm writing the next:
mkdir csServer
cd csServer
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar xvfz steamcmd_linux.tar.gz
./steamcmd.sh
But the last line causes -sh: ./steamcmd.sh not found. However, I can see this file in the directory.
What actually can cause it?
//ADDED
The file is executable!
Your script contains a header which says #!/bin/bash, that is use /bin/bash to execute this script. Apparently, on your system /bin/bash is not present. I am not familiar with Synology environment, but you should be able to fix this problem by installing bash and then pointing your script to the right path, which should be /opt/bin/bash. The first line of your script should therefore look like the following
#!/opt/bin/bash
You could also use Synology default ash, but beware that you script might not work as it was written for bash.
Windows style end-of-lines (CRLF) can cause this issue. If your sh file contains Windows style end-of-lines, convert it to Linux style.

Resources