Read=4 Write=2 Xecute=1 It's not that difficult. You just add the ones you want: 4+2+1 = (r+w+x) = 7 4+2 = (r+w) = 6 4+1 = (r+x) = 5 4 = (r) = 4 2+1 = (w+x) = 3 2 = (w) = 2 1 = (x) = 1
@DudeSkinnyTall9 жыл бұрын
Nice and easy way to put it, thx. I'm still curious about umask though, do I need to type in "026" in order to give no permissions to "others"? What about executables?
@VperVendetta19929 жыл бұрын
DudeSkinnyTall umask is the inverse of chmod. The max for chmod is 777. The max for umask is 000 (because 777 - 000 = 777). So 026 means ALL permissions to you: (first number = 0; 7 - 0 = 7), Read and Xecute for your group: (second number = 2; 7 - 2 = 5), and just Xecute for other users: (third number = 6; 7 - 6 = 1). In order to give all permissions to you and your group and no permission to others, the number is 007. To give all permissions to you and nobody else, 077. Executables are files like everything else, so they work in the same way. Everything in Linux is a file, directories and executables included.
@binbashbuddy7 жыл бұрын
Actually your information per umask is incorrect. The file base permission is 666, not 777, as that would create security concerns. That's why umask of 022 creates files with 644 permissions (rw-r--r--). Because for a directory to be descendable the execute bit must be set, so directory base permission is 777, thus when you create a directory once combined with umask it is 755 (drwxrx-rx-).
@casperes09127 жыл бұрын
Only problem is I always forget which numbers are which. Most intuitive to me would be read 1, write 2 execute 4
@waltcms7 жыл бұрын
What it the difference between using this method and "ugo"
@balsabjelogrlic46308 жыл бұрын
made it this far and I'm thinking, this guy dedicated all this time to explain Linux without any payoff , thank you so much man! Very helpful videos, cheers! :)
@tutoriaLinux8 жыл бұрын
Heh, I really enjoy what I do :-D
@DominiqueWillkins6 жыл бұрын
I want to thank you as well. I have learned a lot in the past three weeks, and i found it very damn interesting. THANKS!
@tramellmalone91464 жыл бұрын
@@tutoriaLinux Trust that you have been a blessing to many. :-) Thanks a bunch!!!
@berkelunstad15085 жыл бұрын
Thanks for the video, it was super helpful. The one thing I would add would be an easy way to remember the different chmod values without having to look them up. Each number 0-7 represents an addition of 0 to 3 of the following numbers: 4 represents read, 2 represents write, 1 represents execute. So a 6 means rw- (4+2) and a 2 means -w- and a 0 means --- and so on. Edit: In retrospect this is just because of binary, rwx = 111 and r-x = 101 and so on. I didn't realize this until the next morning. Perhaps this is why I shouldn't try to learn Linux at midnight lol.
@usingvancedplzdontban11285 жыл бұрын
chmod notations @ 3;20: (easier to memorize in descending order actually) 0: - - - (no rights at all) 1: - - x 2: - w - 3: - w x 4: r - - 5: r - x 6: r w - 7: r w x
@J0nDaFr3aK4 жыл бұрын
By playing around with chmod, I've found out that you need to have both read and execute privileges in order to view the directory content and file attributes. Setting the value to 1 (execute only) will lock you out of the directory, preventing you to see its content. Setting the value to 4 (read only) allows you to see the directory contents but the file attributes aren't accessible. Cool, lots of new stuff learned today, thanks.
@BorrellRicard9 жыл бұрын
Thank you for these videos. I work in a research group in Computational Fluid Dynamics, we all use Linux and supercomputers but most of us learn just what we need and much less that what could be useful for us. Definitely, I'll recommend your entire course to new students coming to our lab.
@saltdomeguy3 жыл бұрын
Loving this series Dave. New to Linux, so this is gold. Thanks!
@classicsagat3 жыл бұрын
Been enjoying this Linux series! All of this has been really informative and well structured, thank you so much!
@habituallearner76803 жыл бұрын
Thanks so much. It's very kind and thoughtful of you to create and update this series. It's quite comprehensive and is a great review for me.
@nadiakateb36704 жыл бұрын
Thank you so much sir !!! I've seen a lot of videos about linux on youtube and yours are the best. You have a an incredible way for making everything so simple and easy to understand.
@manningermani9 жыл бұрын
if you don't want to learn the numbers you can use 'chmod u+x script' for example, to add execute rights to the user
@waltcms7 жыл бұрын
Is there a difference between using the two? I am already used to "chmod ugo" but am I selling myself short by not using or learning the numerical way of doing this? And will employers look down on using the "ugo" method?
@turbasammal6 жыл бұрын
No, there is no difference. Just use what you like the most.
@GabrielMartinez-ez9ue3 жыл бұрын
Excellent. I have been following your tutorials with a book called: Linux Pocket Guide. Thank you
@kennethnicklowicz10309 жыл бұрын
Amazing the moment you realize you've been using CHMOD and have an idea now what its actually doing KUDOS!
@nikolamilic63785 жыл бұрын
These videos are the best...you too. Thx a lot!
@GeveRetzah3 ай бұрын
If you don't want to talk about binary and how it's really being calculated, you could just teach the alphabetic version: chmod o+x (to add execute for the owner for example), then it's also way simpler to remember.
@klaraschumann41645 жыл бұрын
Your videos really are an eye opener. Thanks for the effort.
@AbdulRahman-cb8rc6 жыл бұрын
Thank you for teaching flawlessly
@danielgray10733 жыл бұрын
Hey thanks for the great videos! Just one question -- At 0:31 you say we've covered file types. In which video was that? I thinkk ive been watching them in order but maybe I missed one? Thanks! I will look them up on the side anyway!
@danielgray10733 жыл бұрын
ahh so if its d then it is a directory if it is a - than it is a file. nevermind
@patrickvidican931610 жыл бұрын
thank you for making these videos wow
@tutoriaLinux10 жыл бұрын
You're welcome! I'm currently traveling, but more videos are coming soon!
@PunmasterSTP2 жыл бұрын
Permissions? More like “Perfect explanations!”
@supercooper927 жыл бұрын
So, chmod 2 is the goldilocks of permissions? its just write, Can't unhear 3:34
@eoinkehoe69815 жыл бұрын
Thank you very much from Ireland!
@garretmkiii4 жыл бұрын
So for each owner/group/user there are positions OWNER 2^2, 2^1, 2^0; GROUP 2^2, 2^1, 2^0; and USER 2^2, 2^1, 2^0, where each position can be either 1 or 0 (yes/no, true/false). If position OWNER 2^2 = true (1), file is readable by OWNER, and since the "true" is in position 2^2, it's evaluated as 4. to make a 7, all bits have to be true (1), re: 2^2 + 2^1 + 2^0 = 4 + 2 + 1 = 7, in which case the file can be read, written to and executed for the respective user. And now I'm just going to copy and paste my comment into my KZbin Course Notes. :P
@litgeeksquadofficial6 жыл бұрын
Really digging these videos!
@Stevesteacher4 жыл бұрын
Amazing, this helped me so much with chmod! thank you :)
@tiavee11 ай бұрын
Thanks for sharing, but the Umask example confused me. Maybe I need to rewatch it.
@newwavex86654 жыл бұрын
Could you do a video on binary and octal notation? I have a hard time understanding it, aswell as hexadecimal
@abhimanyuvi5 жыл бұрын
Hats off to you sir, very nice videos thanks for making such nice videos
@tahirsengine4 жыл бұрын
So that's how it goes: rwx => 111(in binary) => 100 + 10 + 1 (Binary) => 4 + 2 + 1(Decimal). So 4 represents r or Read, 2 represents w or Write and 1 represents x or Execute. So if we want to enable r and w then 4+2 = 6. So for self groups and others = > 666
@retrosquash4 жыл бұрын
Lol trying to explain this without explaining bit masking. I applaud you
@ginoginoh8 жыл бұрын
When I create a newfile the default option is rw for owener and only r for the others, but in my login.defs UMASK is setted to 022, so why I don't get 755 but 644? I am on Linux Mint. Thanks for the answer and your videos!
@tutoriaLinux8 жыл бұрын
It sounds like the process that created this file has a default of 666 (programs like touch and mkdir don't set the executable bit by default), so the umask is actually applied to the program's 666 in this case, and not the theoretical max of 777. Here's a pretty good explanation of the whole thing: askubuntu.com/questions/44542/what-is-umask-and-how-does-it-work
@ginoginoh8 жыл бұрын
Oh I see! Thanks for your answer!
@איתיחזות-ה1כ Жыл бұрын
if i want to change the default file permissions to my needs, i do i do it?
@cptechno9 жыл бұрын
I find this form the command chmod to be more user-friendly and easier to remember.chmod u=rwx, g=rw,o=r
@wackaeleanor1966 жыл бұрын
I am glad I found you.
@stefanspinu53816 жыл бұрын
You said that when you create a file, by default the group category gets the permissions rw-, that is 6. However, in the login.defs you said that we are substracting 2 from 7 for the group category, which leaves the group with permissions of type 5 (that is r-x). Therefore, which one should we believe?
@rleften57885 жыл бұрын
I'm not sure what you are saying here, rw- is 6, and r-x is 5, regardless of which permission it is. Each section, User, Group, Everyone has 3 bits for their permissions. If you are familiar with binary representation, then you know this means we have the following numbers to work with: 4, 2 and 1. Each of the sections are broken down into these 3 bits. So whatever permissions you want, it is a matter of simple maths. Read is 4, Write is 2 and Execute is 1.
@J0nDaFr3aK4 жыл бұрын
why is it possible to use chmod without super user privileges? can't this possibility be exploited?
@ar5hadkhan6 жыл бұрын
When i run umask in terminal I get 0002 but in /etc/login.defs umask is set to 022?
@fih-l3x5 жыл бұрын
I'm a newbie so sorry if my question is a dumb one, but if I do something like chmod -r 000 / I end up f*king the whole system ? Nobody would have access to anything?
@craigmackenzie98865 жыл бұрын
Hey, thanks for the videos. The umask says '0' for user, but users don't have executable privelege on a new file, so it actually is taking something away?
@h4sh925 жыл бұрын
Default permissions is 666 for files and 777 for directories.
@ruiruivo8310 жыл бұрын
QUESTION, Love your videos, could you please teach us how to build the bottom minibar you have on this video?
@tutoriaLinux10 жыл бұрын
Ah, that's my fancy window manager (i3) -- I've made some videos about this here: kzbin.info/www/bejne/b6DJomedpaySoq8 . Enjoy!
@ruiruivo8310 жыл бұрын
Hope to see python soon. I took your videos as linux classes, wrote notes on paper and everything. Very usefull. Thank you.
@hello-do7pc6 жыл бұрын
@@tutoriaLinux how did you do the search @ 7:27 ?
@tutoriaLinux6 жыл бұрын
Searching for text in nano is done with ctrl-w
@hello-do7pc5 жыл бұрын
@@tutoriaLinux awesome! Thanks for the tutorials!
@SharvilShastri5 жыл бұрын
I've got one question. Can we use the chmod command with the pipe keyword I mean say I have a directory 'Abc' which contains lot of files . I'm inside of that directory, now i want to do chmod 777 on all the files. Is there any command for that? I know that I can just cd .. and type chmod 777 -R Abc to give all permissions to all the files along with the directories. But any other method than that. I'm a beginner at this course . Thank you Btw your tutorials are Awesome
@tutoriaLinux5 жыл бұрын
Yes! I'd recommend either using 'find' with the -exec flag or the 'xargs' command (which would let you use pipes directly). I just spend 5 minutes looking through my channel and realized there was an xargs video that I filmed last year but never released. I'll try to get that edited and uploaded soon.
@teddymills17 жыл бұрын
I always had a problems with say filename.txt. The file permissions of user=steve and group=staff. Then user Bob who is also in group=staff cannot read or write to filename.txt. Even if I make Bobs primary group=staff, he still cannot write to filename.txt. Filename.txt permissions are 775. Does Bob need read-write access all the way from / root to that path where filename.txt is located ?
@kawo6667 жыл бұрын
teddy mills Just guessing here, but check if your filename.txt does not actually belong to user=steve group=steve. Then it does not matter that Bob and Steve are in 'staff' group together.
@kawo6667 жыл бұрын
teddy mills And more importantly, check if the directory the filename.txt is in, belongs to the group 'staff' with all the right permissions. 'chgrp' command might help. As a disclaimer, I am not a Linux professional, just an aficionado ;)
@lobotplays10 жыл бұрын
Very helpful. Thank you.
@ivan46864 жыл бұрын
Is this number 6 video in course? Why doesn't it numbered?
@tutoriaLinux4 жыл бұрын
These were originally numbered but people complained about the titles being cut off on mobile. I've since removed the numbering -- just use the playlist if you want to ensure you're watching in order. Cheers!
@nerady7 жыл бұрын
i think for people who are new it would be easier to use chmod with -u -g -o arguments
@waltcms7 жыл бұрын
I use "ugo" but what is the difference between the two methods?
@Fernandez2182 ай бұрын
Read/Write, Read/Write, Read/Write, is the permission of the beast -- evil permissions. If you know what I mean ;)
@miketh12347 жыл бұрын
Is it correct to refer to characters as bits?
@tutoriaLinux7 жыл бұрын
The characters here represent actual bits (0's and 1's) of file metadata that can be turned on or off on a per-file basis.
@kraljict3 жыл бұрын
I've used both octal notation and symbolic mode and I prefer symbolic. To me, it's a lot more meaningful. There is no need to memorize these arbitrary numbers. Do I know them? I do. But I just prefer the first one. Anyone else? chmod a+rwx file.txt chmod 777 file.txt It's just personal preference, though.
@ctobi7074 жыл бұрын
it all clicked when i realised it was octal
@LeemanJ4 жыл бұрын
Checks Urban dictionary- "Homeslice" - A very close friend whom you have known for a long time. ..aw shucks :)
@kshitizgupta32643 жыл бұрын
read, write and execute number annotation could have been better, it is just a sum of the base values of read, write and execute
@christopherrodriguez65453 жыл бұрын
What you just said makes no sense to a beginner.
@kshitizgupta32643 жыл бұрын
@@christopherrodriguez6545 read 4, write 2, execute 1. Read + write =6 : hence the number Read + execute = 5 hence the same Write + execute = 3 Adding those base numbers in combination will be easy to remember
@miketh12347 жыл бұрын
Why is the "ls" command missing?
@tutoriaLinux7 жыл бұрын
Can you elaborate? I'm not sure what you mean.
@miketh12347 жыл бұрын
You typed "ls-" I missed that you typed "-" after "ls", sorry about that, should have investigated more closely. Though perhaps you removed that command for whatever reason. Anyways, thanks for such prompt responses and keep up the great work you have amassed!
@valkyritzaАй бұрын
Why is your linux term in romanian
@Hogis__5 жыл бұрын
You could've spent the time you were talking about how you don't need to know binary and octal to actually explain it, or direct to a resource. It's not really all that complicated. I explained what the hexadecimal colour values actually mean to my friend in less than 5 minutes and she seemed to understand it well. But thanks for this anyhow, I hadn't understood that the chmod commands people often paste online with numeric values were actually octal representations.
4 жыл бұрын
Smh... If you can do it better, make a tutorial too...
@Hogis__4 жыл бұрын
@ I didn't mean the whole tutorial was bad, I think it was valid criticism
@tomseinfeld71245 жыл бұрын
I don't understand the group
@TeamKomolo7 жыл бұрын
No chown? ;)
@LinucNerd7 жыл бұрын
Jesus... Now octal makes sense!
@hhvazquez3 жыл бұрын
What is this sexy bar at the bottom of this Bash session?
@TechnicolorMammoth Жыл бұрын
Dude, I understand file permissions and you somehow confused me. How each learns as it goes, I guess. I’ve set this playlist on to fall asleep to. This woke me up out of confusion and disappointment.