Remember those of you who found this site purely by accident – this site is mostly for my own use.

That said – here for my reference – the Bash commands that I end up using most often with the php exec(); command or in the shell – here in case I forget them… again. (I can remember what everyone ate at my last job interview, yet I have trouble remembering simple shell commands… odd.)

Use sudo as needed!
(more…)

Tagged with:
 

The other day a good friend of mine asked me what the number equivalent of drwxr-xrwx was.

Most people who are up to their arms in Bash everyday know how to compute this – but for everyone else the Terminal App in most Debian/BSD based operating systems display the permissions in alpha – yet kind of require that you change the permissions using number notation.

To compute this, it’s actually really simple – so long as you understand binary. 

Each subset of three letters can be assigned a binary value – 4, 2, 1.  For Example:

rwx r-x rwx
111 101 111
421 401 421

Then, computing in standard binary fashion, compute the  value, in this case, 4+2+1 = 7, 4+0+1 = 5, 4+2+1 = 7.

Put these all together, add the chmod command (and, in some cases the all too awesome sudo) and we get:

$ sudo chmod 757 filename.txt

Any questions? =)

Tagged with:
 
Pro Palma Deus Unus