How to make linux tool in nested folder to be available globally in linux terminal [closed] - linux

Closed. This question is not about programming or software development. 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 days ago.
Improve this question
So I have PostgreSQL installed via Asdf which is available and could be accessed via this command $HOME/.asdf/shims/pg_ctl
It's too much hustle to type so I'm trying to make it available globally just using pg_ctl command
I've tried using .profile like so,
export pg_ctl=$HOME/.asdf/shims/pg_ctl status
but I'm still need to add $ prefix
$pg_ctl
is there a way so I could make the $HOME/.asdf/shims/pg_ctl to be called just using pg_ctl and available globally in terminal?

Run this:
# Place export in bashrc file that is run before every shell session
echo "export pg_ctl=$HOME/.asdf/shims/pg_ctl status" >> ~/.bashrc
# Source the export command for your current shell
source ~/.bashrc
Now your custom command will persist in your PATH.

Related

Kali path variables messed up and now SUDO is useless [closed]

Closed. This question is not about programming or software development. 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 4 days ago.
Improve this question
I was watching this video shorturl.at/loG48 and got to the point 2:20. I was unable to install snap in the end but forgot to put $ behind the PATH in the environment variable setup. Now I can't run sudo without typing export PATH=$PATH:/usr/bin every single time. I just installed kali and I am really scared please help me.
Doing anything now gives me
`Command 'sudo' is available in the following places
/bin/sudo
/usr/bin/sudo
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
sudo: command not found
`
I just wanted to download snap but I ended up messing my PATH variables.
By following some guides here and there I managed to find this in my /etc/environment PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games even though I don't know what this is supposed to be. Please help fast.

Can I point /etc directory somewhere else when I run a specific program [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
Suppose I have a custom binary on Linux that references /etc/mybinary/my.conf file.
I can not change the binary, nor the config file, is it possible to fool the binary to look into my /home/hari/etc directory instead of /etc/mybinary folder when I run the binary. Maybe mount over the folder somehow prior to running it?
Your custom program might accept some program option (or some environment variable) to override its configuration file. Try to run yourcustomprogram --help to find out (then man yourcustomprogram) and read its documentation.
And you might consider using a bind mount (or a symbolic link) to solve your issue. See also mount(8)
Set environment variable to the main TOP directory from where config file is available
For example
before running set TOPDIR=/home/hari
and in your program read the environment variable TOPDIR and get config file from that path. ($TOPDIR/etc/mybinary/my.conf
If you can not change the code to modify binary, you can use softlink
create a link from /home/hari/etc/my.conf -> /etc/mybinary/my.conf

Typing "cd.." in Linux terminal instead of "cd .." [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 4 years ago.
Improve this question
I come from MS-DOS background, where it is permitted to type cd.. (without the space between cd and ..) instead of cd ... The Linux terminal, however, finds cd.. objectionable.
Is there a way to make Linux terminal understand cd.. to mean cd ..?
I'm using Ubuntu.
And I am well aware that this is a rather silly problem, but I have cd.. committed to muscle memory (since early childhood, my brain has been wired that way) and I've been making that mistake at least twenty times every day, for several years now, ever since I started using Linux on a regular basis.
You could create an alias:
alias cd..="cd .."
If you add this to some file that's loaded whenever you log in (e.g., .bashrc if you're using bash), you'd get the effect of having this alias permanently available.

Fedora: execute command on right click of mouse [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
I need to execute quite often a pdf split option on a file such as:
pdfseparate largefile.pdf part-%d.pdf
Is there a way to execute such a command on a selected file by right-clicking on it? I'm running a Fedora 22
Thanks
I assume that you are using a standard Fedora installation with Gnome 3.
Install nautilus-actions first:
sudo yum install nautilus-actions
Then, open it and configure an entry with the following configuration:
Notice that i wrote a double % symbol, because it would be otherwise matched and translated into the current directory.
I also advice you to disable the option Create a main menu for Nautilus Actions in the Preferences of the application.
You should not need to restart Nautilus for the changes to take place, but if needed use:
sudo pkill -9 nautilus
Although it's definitively better to just logout/login.

make 'srm' the default command instead 'rm' 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 7 years ago.
Improve this question
I want force users to use 'srm' instead of 'rm' command. is there any solution to execute 'srm' command when users run rm command? or deny users permissions to run 'rm'?
Just create an alias:
alias rm='srm'
You can put this command in the .bashrc file for the user you have to keep under control, so that it is automatically loaded at login.
You can also put it into /etc/bashrc, so that it's loaded for ALL the users.
You can use aliases to do this.
Create an alias as ,
alais rm="srm"
Add this in to the bash_profile or bashrc file or even better create a bash_alias file that will be called from bashrc file.
For a general intro on Aliases, refer this http://bit.do/freblogg-aliases

Resources