Friday, May 3, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 1895  / 2 Years ago, thu, january 27, 2022, 4:17:13

I have some command I can run directly from the terminal:



my_command


and it runs well. However, I want to disable it to run this way. I know where it's located:



which my_command


and it gives me the location of the file of my_command. However, how do I figure out where is a symbolic link pointing to it and letting it run vai terminal without specifying the full path? Or a record in a file like ~/.bashrc. where else do I look for it?



I looked for a link or a record for my_command in /usr/bin and ~/.bashrc but didn't find anything. But it might also mean that I just couldn't find it.


More From » command-line

 Answers
7

I think you may be looking at the wrong way. The bash shell doesn't only look at /usr/bin but a entire set of directories:



echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/braiam/.rvm/bin


Your command either should be on one of the directories, or have a function/alias that calls it. For those cases you might prefer type:



$ type ls
ls is aliased to `ls --color=auto'
$ type jobs
jobs is a shell builtin
$ type apt-get
apt-get is /usr/bin/apt-get

[#28248] Saturday, January 29, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
looweets

Total Points: 52
Total Questions: 114
Total Answers: 111

Location: Turkmenistan
Member since Sat, Apr 16, 2022
2 Years ago
looweets questions
Fri, Apr 29, 22, 09:47, 2 Years ago
Thu, Nov 3, 22, 03:32, 2 Years ago
Sun, Mar 5, 23, 00:43, 1 Year ago
;