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

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

КОМЕНТАРІ • 33

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

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

  • @Miguel_GM
    @Miguel_GM 2 роки тому +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!

  • @viktorrighetti8344
    @viktorrighetti8344 10 днів тому

    finally after 9 months of using linux I finally understood what PATH means, thanks 🤣🤣

  • @emanuelwieland
    @emanuelwieland 2 роки тому +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.

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

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

  • @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!

  • @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.

  • @Theborg72
    @Theborg72 2 роки тому +2

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

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

    Just amazing pedagogy. Thank you sooooo much!

  • @busdriver1261
    @busdriver1261 2 роки тому +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.

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

    Incredibly useful. Thanks a lot.

  • @paulking75
    @paulking75 21 день тому

    Question: So if you move a script too /usr/local/bin that has txt files that the script writes data too; do you have to move those txt files to the same directory? Oh, nvm, I got my answer. If I include the absolute path in the script. I can leave the txt files where they are. Man, this series has been fun so far!

  • @urvishjaiswal6979
    @urvishjaiswal6979 Місяць тому

    Love it!

  • @k.chriscaldwell4141
    @k.chriscaldwell4141 Місяць тому

    _What’s the path Kenneth!_

  • @chandrachurmukherjeejucse5816

    Great lecture sir.

  • @zeppelinmexicano
    @zeppelinmexicano 10 місяців тому +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 9 місяців тому

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

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

    wow really nice content

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

    Outstanding!

  • @Eilay_Yosfan
    @Eilay_Yosfan 5 місяців тому

    thank you

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

    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 6 місяців тому

      It's edited for video purposes. 🤣

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

    Thanks

  • @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 2 роки тому

    👍Nice.

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

    got root: illegal group name error

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

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

  • @ibrahimmorketa2093
    @ibrahimmorketa2093 2 роки тому

    please, Sir! answer my question

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

    the shop linux tv store is blocking the LIKE button

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

    ☯🙏