How to call an executable from path? [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
A very basic question here..
I have an executable redis-server at /home/dave/redis/src. Usually I cd /home/dave/redis/src then ./redis-server to execute it.
How can I call redis-server in the path? something like /home/dave/redis/src./redis-server
Thank you

You almost got it right. Except for the . (dot).
Instead of
/home/dave/redis/src./redis-server
Do
/home/dave/redis/src/redis-server
It is called an absolute path to the file, and it is simply the directories+file names, seperated by / (with a leading /, to make it absolute), so the . does not belong there.

/home/dave/redis/src/./redis-server

Use a dot in front of the first slash.
For example, if I want to open netbeans from the executable in /home/jason/IDE/netbeans/bin/netbeans,
I just put a dot in front of /home/.../.../ and the executable starts.

Related

How to alias or rename a file on the fly in Linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I have the following challenge under Linux:
An application is writing a config-file "samename.cfg" into certain directories
I want to have the config-file named different for each directory
I do not want any file called "samename.cfg" written to the directories
I can not change it in the application
So I would like to have the application thinking that it accesses samename.cfg but in fact it reads and writes anothername.cfg. Symlink does not help, because then there still is a file called samename.cfg in every directory.
Anybody any idea?
Regards,
Axel
Try using a hard link instead of a soft link when using ln command (just remove the -s flag).
See ln man's page for more details.

how can i create a file in Linux, without using any program/command? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I have a question if I want to create a file without using command or programming?
I know mkdir hi.txt, but is there any way to make without using these?
The touch PATH program will create an empty file at the location entered for PATH.
Example: touch /var/tmp/file.txt will create an empty file at /var/tmp/file.txt
If you want to create a file in Linux, without using any program/command,
you can use > this sign
like > hi.txt it will create a file

How to add alternative to program that located in /usr/bin [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
Is it possible to substitute binary with same name alternative? I have /usr/bin/qtcreator
I want to use alternative version but /usr/bin/qtcreator is binary but not alternative.
What the way I should do this?
You could place your new qtcreator at /usr/local/bin/qtcreator, that location should have preference over /usr/bin.
You can check the possible locations for binaries and the order is which they are searched with echo $PATH and you can check which binary will be called with which qtcreator
In Bash:
$ alias qtcreator="/usr/local/bin/qtcreator"
or make sure the path to desired binary is mentioned before the undesired path in $PATH (... as mentioned by others).

windows equivalent of ./ (current directory) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
On Linux when I want to execute some file and use relative path.
For example I want to do something like this:
cd c:\windows
c:\windows>./System32/ipconfig.exe
However what I get is an error message telling me that "." has not been found.
A period denotes the current directory in Windows.
For your example you would use the following:
c:\> cd c:\windows
c:\Windows> .\System32\ipconfig.exe
Alternately, you could forego the .\ and do it like this:
c:\Windows> System32\ipconfig.exe
Use the correct slash marks and you should be good. Windows uses backslashes as the directory symbol instead of the forward slash.
The only caveat to this is if you have to change drive letters. The cd command will change the working directory, but not the drive. To change drives use [drive letter][colon]:
C:\Windows>cd P:\XenApp\Utils
C:\Windows>P:
P:\XenApp\Utils>

Mass file renaming (Linux) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a directory in linux with lots of images having double underscore (__), I have to make it single under score (_). Lets say file name is a__1.jpg. I have to make it a_1.jpg. I have to do it for all files inside a directory. What should be the command?
Thanks
There are several ways to achieve this goal.
If you have mmv installed (or are able to install it), you can do
mmv \*__* \#1_#2
If not, maybe rename is an option:
rename _ __ *
(but alas, here I am not so sure about the syntax.)

Resources