chmod text modes

I came across this blog post which praises text modes for /bin/chmod.

There are two ways you can change file permissions in Unix – one is using chmod‘s symbolic (text) modes (like chmod ug+x file), the other is using the octal modes (like chmod 0660 file). It turns out that symbolic modes are more powerful because you can mask out the permission bits you want to change! Octal permission modes are absolute and can’t be used to change individual bits. Octal modes are also sometimes called absolute because of that.

I have to agree, they are superior.  However I feel like the article needs more examples.  So here we go.

Use “u” for user, “g” for group, “o” for others, and “a” for all, or you can use a combination of letters, similar to how you do for access rights:


$ chmod ug+rw *.php

This will make all .php files in current directory readable and writable by both user and group.

Use several permission changes within one command.  Just separate them by comma.


$ chmod a-rwx,ug+rw,o+r *.php

The above will reset permissions on all .php files to readable by all and writable only by user and group.

And my favorite and most used example, which would be tricky with octal permissions is the “X”.  In recursive change mode, “X” will affect executable bit only on directories.  Difference by illustration:


$ chmod -R a+x /some/path

The above will add executable bit to all files and folders under /some/path.


$ chmod -R a+X /some/path

But the above will add executable bit only to folders under /some/path.  The files will remain as they are.

Medieval technical support

Yesterday I discovered that the video of medieval tech support might be too old now and that the younger generation of IT guys could have easily missed it.  Here it goes, a piece of classics, for everyone to enjoy.  By the way, you don’t have to work in IT to have a laugh at it.

[youtube=http://www.youtube.com/watch?v=0Cd7Bsp3dDo]

Shell keyboard shortcuts

I came across a very useful post with the listing of many shell keyboard shortcuts.  The article covers a mix of bash, csh, zsh, and Cisco shell keyboard shortcuts.  The article is in Russian, but I think it will be helpful for more people, so I took the liberty to translate it.  Continue reading for the translation.

Continue reading Shell keyboard shortcuts

Appreciate your sysadmin. At least today.

Today is the System Administrator Appreciation Day.  I wish a happy sysadmin day to everyone who ever took their time to answer a stupid question for a billionth time without resolving to violence, to everyone who ever spent a night or a weekend in the office fixing a problem that he didn’t create, to everyone who makes IT infrastructure invisible until there is a problem, to everyone who spent their own free time to make things better for the rest of the world, to everyone who despite working hard and taking a lot of initiative is often the first person to blame, to everyone who spent hours in the freezing datacenters or on pan-frying roofs or in dark and stinky basements, to everyone who’s mobile phone receives dozens of SMS messages every hour 24×7, to everyone who’s mobile number is posted on all office white-boards with the caption “Emergency”, to everyone … you got the idea.

If you know a sysadmin, take a minute of your time, go and say “Thank you”.  If you have some change in your pocket, buy your sysadmin a pint of beer.  If you are a hot girl, go give him a kiss and a hug.  Or her.  If you are not a sysadmin, you don’t have and probably won’t ever have an idea of how hard these people work to make your life easier.  It’s their day today.

If you still don’t understand what sysadmins do, have a look here.