324

A handy linux tutorial for whom cares!

Comments
  • 17
    Will come to good use
    Thanks!
  • 9
    @ruhe i love it because it's simple and straightforward!
  • 15
    As a non linux user thank you for this. The rare cases I'm on linux this will help me find stuff easier
  • 35
    Not entirely accurate. The best way to learn it is to read their history, how UNIX was created and how and when each of them gets mounted.

    For example /bin is not user binaries. It's just binaries. Nothing to do with the user.
  • 3
    And this is getting saved.
  • 11
    And then there's those people who put everything in home.
  • 1
    @hashedram truee, like everyone put everything on desktop 😂😂😂
  • 7
    /opt: Additional add-on Apps

    Apps! APPS! FUCKING APPS! STUPID FUCKING APPS EVERYWHERE!
  • 2
    Never have I ever saved an image so fast before...
  • 2
    @paedub client-side machine code
  • 0
    Genius!

    ls /
  • 6
    But when you are on (at least) ArchLinux /bin and /sbin are symlinks to /usr/bin and /lib to /usr/lib as the differentiation is out of date.
  • 0
    @kenogo it's just simplified
  • 2
  • 2
    @Pogromist beautiful! Thanks
  • 7
    @hashedram Putting things in your home folder makes sense though, because it's your "safe stashing place" on the machine.

    On some distros, your home folder is encrypted, while the rest of the disk isn't. The permissions are usually set to something like 700 or 770, which disallows others from accessing the contents.

    The home directory is usually the place you should backup when buying a new machine -- when using linux as intended, you should be able to blindly delete all directories except /home, and reinstall any other distro and not lose any sleep over it.

    I never store code outside of my home directory, and I put a lot of personal tools & programs in ~/bin.
  • 1
    Wow.. simple and clear representation as well as useful.
  • 0
    Nice guide!
  • 2
    'man hier' can also help in times of need
  • 0
    Always wondered what the opt directory held. Never ventured in there
  • 0
    This is applicable to mac as well for anyone who uses iTerm. Macs have a very similar directory structure.
  • 1
    whom 😂 well played
  • 0
    @bittersweet agreed but, what about programs saved in /opt?
  • 3
    @hacker From what I have seen in the wild, /opt is for single-folder apps, usually based on Java/python/some other language. The idea is that these apps are called by something like "Java -jar /opt/applications/myapp/myappv1.jar". At least, that's how we do it at work.
  • 1
    @hacker

    I just did rm -rf /opt/*

    I'll report back to you in a few days with the results.
  • 3
    @hacker @julianmd Seriously though, opt(ional) is indeed for third-party, non-distribution-included binary applications like Chrome, Java, etc.

    In the past, a company would use a common Unix distribution, and have their own (possibly proprietary) set of tools and applications on top of that. These company-specific binaries would directly be dumped on every system in the /opt directory.

    On every system, you should be able to delete the contents of /opt without breaking the OS or losing settings -- but you might break applications.
  • 0
    @bittersweet @julianmd interesting. I have folders for Atom, Firefox Developer Edition, Processing, and pyCharm in /opt. And also Expo XDE (which is just a single AppImage file, and it can be moved elsewhere).
    If I remove them, I'm certain that the apps will stop working...
    That's my issue if and when I switch distros/devices.
  • 0
    The best description of the Unix/Linux (sorry for the generalisation) directory structure I've seen
  • 0
    Awesome @bittersweet!
    Thanks for the info. I very rarely use Linux with a GUI so I wouldn't know about Chrome or other such apps that store their stuff there.
  • 0
    This wouldve been helpful 6 years ago...
  • 0
    God, I just finished setting up an Ubuntu home collaboration server today, thinking srv was for server.
  • 0
    Saved! Hope to finally try out linux this summer
  • 0
    @hashedram oops 😅
  • 0
    What about /run or /sys?
  • 1
    Strangely enough /usr actually means Unix System Resources and not short for "user"
    I only learned this recently :/
Add Comment