How to run the particular file in absolute path? - linux

I have Files called enum-pipeline-2.conf enum-ruby-filter-2.rb get_session_msgs_query.json lookup.json, which I was running by giving ./file_name in my linux script. I wanted to run those files using absolute path.
When I am trying to find it
readlink -f get_session_msgs_query.json --->
/root/PWG/logstash-pipelines/enum/logstash_templates/get_session_msgs_query.json
This I am getting, Can anyone please help how to run it in linux?

Related

./path of file to execute not executing

I am trying to execute matlab from desktop path of file is
/usr/local/MATLAB/R2017b/bin/matlab
executing ./usr/local/MATLAB/R2017b/bin/matlab
also tried .//usr/local/MATLAB/R2017b/bin/matlab
and ./ /usr/local/MATLAB/R2017b/bin/matlab
how it works?
Just run /usr/local/MATLAB/R2017b/bin/matlab to access the binary via the full path otherwise you will run try to run it via the relative path: <CURRENT DIR>/usr/local/MATLAB/R2017b/bin/matlab if you put a . before.
You can also change the add /usr/local/MATLAB/R2017b/bin/ to your path variable in order to be able to execute the command matlab without having to specify its whole path each time.
Also change your ~/.bashrc file and add PATH=$PATH:/usr/local/MATLAB/R2017b/bin to be able to keep those change after a reboot and just run matlab

Cannot find script files with OpenOCD

I'm trying to use OpenOCD together with my ST discovery board, following this tutorial: https://japaric.github.io/discovery/README.html. When verifying the OpenOCD installation I get the following error:
I've tried providing absolute paths to all files, it does not work. I also tried using the script files found in the scripts/board folder. They showed similar issues, the files cannot be found. Any pointers on solving this would be great.
My host computer is running Windows 10.
cd to /cygdrive/c/OpenOCD/share/openocd/scripts and then execute openocd -f file1 -f file2.
Alternatively, command shown in the picture of the question seems to work in the normal windows command prompt no matter the current working directory.

Error in running a binary file on ubuntu terminal

AM trying to run a binary file on ubuntu terminal but getting following error
cant find trained object detector file "object_detector.svm."
Well, obviously this file is missing or the program you are running can not locate it. What I will do:
First check if the file really exists:
find . -name 'object_detector.svm'
or you can try to locate at any other folder. On the extreme search everything as root:
find / -name 'object_detector.svm'
Also, if you have the source code and not only the binaries, then you can try to locate where this file is calling from. Maybe it's a misconfiguration and you can fix it editing the congig files (if there are any). Try
grep -R 'object_detector.svm'
If you are lucky enough maybe you spot it.
More data from your side needed for further help.

sudo ./sakis3g not found Python subprocess

I need subprocess in my script to connect with 3G. But unfurtunately it's throwing me alot of errors. So I was hoping maybe someone here could help me.
My code:
import subprocess
import time
subprocess.run('sudo ./sakis3g connect OTHER="USBMODEM" USBMODEM="12d1:1001" APN="internet"', shell=True)
When I run this simple script in my home directory I get the following error:
sudo: ./sakis3g: command not found
Is it maybe because the sakis3g script itself it located in /usr/local/bin. Any help would be appreciated, thanks in advance
I run this simple script in my home directory
./ means the current directory i.e. the home directory in this case.
Is it maybe because the sakis3g script itself it located in /usr/local/bin
/usr/local/bin is (likely) not your home directory. sudo can't find sakis3g in the current directory because there is no such file.
Use /usr/local/bin/sakis3g instead of ./sakis3g.
copy that saskis3g object file in your directory where you have your code then you can use the command directly without including any file path for the object file(i.e sakis3g) in your connect command.
if suppose you have a folder named sample. and your program resides in this folder then copy+paste the sakis3g object file to this folder[you can do this by using the CP command in linux ] and use the normal command ie " system("sudo ./sakis3g connect"); " no need of any path.

Running ffmpeg in Terminal 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

Resources