Announcement

Collapse
No announcement yet.

Missing directories?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Missing directories?

    Online, I see people mentioning a couple directories that I cannot find on my system. These are:

    ~/.local/bin
    for user-specific binaries

    ~/.local/share/applications/​
    for user-specific desktop entries

    How come these don't exist in my Kubuntu?

    #2
    .local/share/applications does exist in your user home directory (~).

    .local/bin does not.
    Using Kubuntu Linux since March 23, 2007
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Probably a distro difference.

      Please Read Me

      Comment


        #4
        Originally posted by Snowhog View Post
        .local/share/applications does exist in your user home directory (~).
        I don't have it

        https://files.catbox.moe/e4cu73.png
        Last edited by Thwompin; Sep 17, 2023, 12:29 PM.

        Comment


          #5
          Application paths don't need to exist, if they are not being used. These ones are not in any way mandatory.

          In the case of ~/.local/share/applications, it won't exist unless you modify a menu entry, or have a local install of something that creates a user-specific .desktop file - appimages installed using Appimagelauncher, or something installed via a script that creates a desktop file. Steam game launcher icons, and
          flatpaks as well.

          The directory won't exists unless it is created by something or someone.

          It is similar with ~/.local/bin​, though this requires a user create the dir, unless a local install script does so.
          This dir is not part of the $PATH hierarchy in many distros (including *buntu), but is really easy to add, if desired.

          the $PATH is a list of locations that the system looks inside of, in order, for when someone enters a command without including the full path.
          entering ls instead of entering /usr/bin/ls.

          entering echo $PATH will show this list:

          Code:
          $ echo $PATH
          /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin​
          If you want to add ~/.local/bin​ as a location for custom things, you can easily do so. You just need to tack the following line to the end of your ~/.bashrc:
          Code:
          export PATH="$HOME/.local/bin:$PATH"
          or
          Code:
          export PATH="/home/username/.local/bin:$PATH"

          or any path you might like.

          $HOME here is just a shorthand for "the current user's home directory"

          After that, you will need to enter the command source ~/.bashrc to load the new setting in your current terminal, or logout and back in.



          Comment


            #6
            ~.local/bin is newish (from my perspective, having used ~/bin for several decades) and installing some Python packages will create it and complain if it's not in your path. I tried symlinking it to ~/bin and that proved to not work well.

            (BTW, installing Python software to ~/.local/bin was a mistake, too, always use a "venv" with user Python.)

            2nd aside, I swear by this alias
            Code:
            alias path='echo -e ${PATH//:/\\n}'
            ​
            Regards, John Little

            Comment


              #7
              Originally posted by jlittle View Post
              2nd aside, I swear by this alias Code:Copy Code

              alias path='echo -e ${PATH//:/\\n}' ​
              I don't see any difference in the output of your alias over just typing path.
              Using Kubuntu Linux since March 23, 2007
              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

              Comment


              • jlittle
                jlittle commented
                Editing a comment
                Code:
                unalias path
                path
                zsh: command not found: path
                bash
                unalias path
                path
                Command 'path' not found, did you mean....

              #8
              Originally posted by claydoh View Post
              the $PATH is a list of locations that the system looks inside of, in order, for when someone enters a command without including the full path.
              entering ls instead of entering /usr/bin/ls.

              entering echo $PATH will show this list:

              Code:
              $ echo $PATH
              /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin​
              There should be this in $HOME/.profile by default (also in *buntus):
              Code:
              # set PATH so it includes user's private bin if it exists
              if [ -d "$HOME/bin" ] ; then
                  PATH="$HOME/bin:$PATH"
              fi
              
              # set PATH so it includes user's private bin if it exists
              if [ -d "$HOME/.local/bin" ] ; then
                  PATH="$HOME/.local/bin:$PATH"
              fi​
              Which adds these directories to $PATH if they exist, so there really is no need to add them manually (they'll get added after creation the next time user's .profile is sourced)
              Last edited by kubicle; Sep 18, 2023, 01:12 AM.

              Comment

              Working...
              X