What’s the difference between /usr/bin and /usr/local/bin?

0
11
Asked By CuriousCoder92 On

I'm curious about the difference between the /usr/bin and /usr/local/bin directories in a file system. If I want to add a command, which path should I use and why?

3 Answers

Answered By TechieTommy On

/usr/bin is typically reserved for system commands and may be altered during system upgrades. On the other hand, /usr/local/bin is the better option for adding your own scripts or programs without messing with system files. It's generally safer and more appropriate for user-specific commands, especially since some applications like VSCode prioritize commands in /usr/bin, so anything you add to /usr/local/bin will be easily accessible without interference.

Answered By SearchSavvySam On

Honestly, a simple search on the topic would clear this up quickly. But just to reiterate, /usr/bin is for the system commands maintained by your OS, while /usr/local/bin is the space for user-installed software, ensuring everything runs smoothly without clashes.

Answered By HelpfulHannah On

If you look up this topic, you'll find plenty of resources discussing it. Here's a quick recap: You usually want to add your personal commands to /usr/local/bin because it doesn't conflict with your system's commands. This way, your scripts stay intact even after upgrades.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.