Bash Scripting for Beginners: Complete Guide to Getting Started - Where to Store Scripts (Part 10)

Поділитися
Вставка
  • Опубліковано 10 лис 2024

КОМЕНТАРІ • 30

  • @yuzhu2547
    @yuzhu2547 Рік тому +4

    Finally I know what's `/usr/local/bin` and how to properly use it. Thank you, Jay.

  • @Miguel_GM
    @Miguel_GM Рік тому +10

    I usually have my scripts on a folder in my home directory, and then to make them executable from anywhere I just create a symbolic link to the script in a path folder. Cheers!

  • @jojobobbubble5688
    @jojobobbubble5688 Рік тому +1

    And I finally understand how to add permanent scripts to the terminal! Thanks Jay!!

  • @emanuelwieland
    @emanuelwieland Рік тому +7

    I really like your videos and would like to thank you for all your work.
    In this video a small carelessness has crept in, to which I would like to draw attention briefly.
    At minute 6 after ls -l /usr/locacl/bin you see the following output:
    "-rwxrwxr-x" (775)
    However, it would be better and above all safer to set the permissions as follows:
    "-rwxrwxr--" (774)
    This way only root or root privileged user can execute this command.
    Hope this helps.
    Thanks again for your wonderful work. - Big THANK YOU!

    • @MrWaschbrettbaer
      @MrWaschbrettbaer Рік тому

      Your solution seems indeed cleaner since others have no business executing the command. But could a non-privileged user actually execute this script even though it contains sudo commands? Very late reply, but would be very curious since I am just starting to get into this stuff.

  • @jiasonghuang3602
    @jiasonghuang3602 Рік тому +3

    I’m not sure if i heard it wrong or it’s an honest mistake. But usr stands for Unix system resources instead of user. Very informative video tho!

  • @Theborg72
    @Theborg72 Рік тому +2

    Love this serie but would be handy if you also added the link in description to the wiki page you ran

  • @noweare1
    @noweare1 Рік тому +1

    Just make sure to backup usr/local/bin if you upgrade your linux version. Also, i think using the export command that way only changes your path for that session.

  • @maxbilo6191
    @maxbilo6191 Рік тому

    Just amazing pedagogy. Thank you sooooo much!

  • @doxdorian5363
    @doxdorian5363 Рік тому

    Incredibly useful. Thanks a lot.

  • @busdriver1261
    @busdriver1261 Рік тому +4

    I use ~/.local/bin/ for my scripts mainly because it is added to the $PATH (if present) via the .profile file (it also looks for ~/bin/ directory as well). This works for me as I have a single user system, however I would use /usr/bin/ as Jay suggests to make it system wide if I had more that one user.

  • @subee128
    @subee128 9 місяців тому

    Thanks

  • @eilayyosfan4417
    @eilayyosfan4417 4 місяці тому

    thank you

  • @k.chriscaldwell4141
    @k.chriscaldwell4141 17 днів тому

    _What’s the path Kenneth!_

  • @JohnBortins
    @JohnBortins Рік тому

    Outstanding!

  • @chandrachurmukherjeejucse5816

    Great lecture sir.

  • @DannyRoberts-u6l
    @DannyRoberts-u6l 5 місяців тому

    What desktop system do you have? I don't know why but I want that background and green glowy border very badly 😂

    • @Mugen_FB317
      @Mugen_FB317 4 місяці тому

      It's edited for video purposes. 🤣

  • @lk_8585
    @lk_8585 Рік тому

    wow really nice content

  • @zeppelinmexicano
    @zeppelinmexicano 9 місяців тому +1

    Does "export" to reconfigure the $PATH work only in that shell? I think so but I can't test it at the moment. Seems to me that we need a script that sets $PATH whenever we open a new shell.

    • @cpatra2696
      @cpatra2696 8 місяців тому

      You need to do it in actually vi in the path, and not used export

  • @treyquattro
    @treyquattro Рік тому

    I mostly keep my scripts in /home/$USER/scripts or /home/$USER/.local/bin because mostly it's just me using them; the .local/bin directory is in my $PATH but scripts is not.
    I find the Linux Filesystem Hierarchy Standard a little confusing, or maybe it's confused (even that's confusing). You're not supposed to create directories off the root, but the standard Linux directories seem liable to be not updated properly if you e.g. have to reinstall or you have a new installation. On Windows every app goes under the Program Files directory and e.g. Windows and Windows\System32 is not (usually these days) updated with user or application binaries. On Linux you have a plethora of directories under /usr and there's also the /opt directory if you're installing an application, maybe. Some apps install themselves there, some go in various directories under /usr. It doesn't seem like there are hard and fast rules as to what goes where, and I know that files go in slightly different locations on different distros which makes it even more confusing!
    If you're a developer with several users on a machine and you want to share source and include files for example, where are you supposed to put them? Include files probably go under /usr/include. but you don't really want to put them there because that's a distro-created directory that contains files specific to the C compiler. You could create a subdirectory but of course that won't be migrated to a new system without manual copies. Source files probably go somewhere under /usr/share or /usr/src or maybe it's /var. I really find it difficult to know where files should go that won't interfere with system/distro-provided files, and which won't get clobbered or left out on a system upgrade or migration.
    These days I'm considering putting my source and includes in containers and accessing them via HTTP or SMB e.g. (or NFS if I can ever figure it out). That won't answer my questions regarding directory hierarchy, but will make migration more straighforward, in theory.

    • @noweare1
      @noweare1 Рік тому +1

      Linux file system confuses me too. I use opt a lot as it seems not much used by the system but is out of my home directory

  • @guilherme5094
    @guilherme5094 Рік тому

    👍Nice.

  • @Roje8
    @Roje8 3 місяці тому

    This video is 1337 .... I mean length ;)

  • @ibrahimmorketa2093
    @ibrahimmorketa2093 Рік тому

    please, Sir! answer my question

  • @tobaakanbi7879
    @tobaakanbi7879 2 місяці тому

    the shop linux tv store is blocking the LIKE button

  • @Alpha_Sadigh
    @Alpha_Sadigh Рік тому

    ☯🙏

  • @tinacole1450
    @tinacole1450 11 місяців тому

    got root: illegal group name error