LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-07-2020, 10:01 PM   #1
hairypaulsack
LQ Newbie
 
Registered: Aug 2015
Posts: 2

Rep: Reputation: Disabled
Confusing results using which


Event Order:
  1. $apt install mosquitto
    mess around, failed, found out needed to build from source
  2. dl src and build then install
  3. $which mosquitto
    /usr/local/sbin/mosquitto
  4. $apt remove mosquitto
  5. $which mosquitto
    /usr/local/sbin/mosquitto
  1. I could swear 'which' has shown me 2 locations of a file just like windoze does with 'where'
  2. If I were to guess, the first 'which' was referring to the apt install and the second the source build? Or are these like shortcuts / symlink hardlinks?
 
Old 02-07-2020, 10:07 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,738

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
1. The responses to which appear to be the same.
2. To see if there are links use
Code:
ls -l /usr/local/sbin/mosquitto
 
Old 02-08-2020, 04:54 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
I find I sometimes have to close and reopen the terminal, otherwise 'which' doesn't tell the truth.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Confusing tutorials: Which one to follow? sam-the-6 Linux - Newbie 4 05-13-2015 04:56 AM
Kernel Confusing??? jISV Linux - Software 6 03-31-2002 11:52 AM
Samba stuff - never used it before...very confusing...help! Thymox Linux - Networking 1 10-08-2001 12:44 PM
Basic problem but still confusing hostage89 Linux - Newbie 1 03-12-2001 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration