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!
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!
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.
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.
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.
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!
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.
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.
Finally I know what's `/usr/local/bin` and how to properly use it. Thank you, Jay.
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!
Good stuff.
finally after 9 months of using linux I finally understood what PATH means, thanks 🤣🤣
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!
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.
And I finally understand how to add permanent scripts to the terminal! Thanks Jay!!
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!
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.
Love this serie but would be handy if you also added the link in description to the wiki page you ran
Just amazing pedagogy. Thank you sooooo much!
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.
Incredibly useful. Thanks a lot.
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!
Love it!
_What’s the path Kenneth!_
Great lecture sir.
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.
You need to do it in actually vi in the path, and not used export
wow really nice content
Outstanding!
thank you
What desktop system do you have? I don't know why but I want that background and green glowy border very badly 😂
It's edited for video purposes. 🤣
Thanks
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.
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
👍Nice.
got root: illegal group name error
This video is 1337 .... I mean length ;)
please, Sir! answer my question
the shop linux tv store is blocking the LIKE button
☯🙏