It’s the holidays and that means two things at Life After Coffee… 1) I have some fun posting gift ideas, and 2) I get a little lazy about blogging and do a lot of sniping from other people’s blogs. Today it’s yet another great product that Dee pointed out:
The book has been out for just a couple weeks and should be in book stores soon, but it can be had online right now! The best price on the book right now can be found at Rampant TechPress who is currently selling the book for $34.95. Amazon is currently selling the book at the cover price of $49.95.
In my post from earlier this week on removing the color output from the
ls command I mentioned that in some circumstances the color-coded output can cause permissions errors. Cloned Milkmen asked that I explain why this would be.
I was hoping someone would ask that. In Linux and UNIX if the execute flag is not set on a directory, as in the example below, the
ls --color=tty command will return
$ ls -ld ls_test/
dr-------- 4 jonemmons pg222211 4096 Nov 12 20:07 ls_test/
$ ls ----color=tty ls_test/
ls: ls_test/test1: Permission denied
ls: ls_test/test2: Permission denied
ls: ls_test/test3: Permission denied
$ ls ls_test/
dir1 dir2 test1 test2 test3
The execute flag is funny on directories. The main effect is that it will inhibit a user’s ability to
cd into a directory, but it will also keep you from being able to get information out of the file’s inode (the inode contains information about when a file was created, modified, accessed etc.) Since
ls requires information from the inode to properly color-code files in a directory it will fail if the execute bit is not set. An
ls -l will fail for the same reason.
Exactly 15 months after I first posted about it my book Oracle Shell Scripting: Linux and UNIX Programming for Oracle has finally been printed and is available!
The book offers an introduction to shell scripting, an in-depth look at many useful shell commands and tools and a bunch of example scripts to use as-is or as a basis for your own custom scripts. As a long-time database and system administrator I have compiled some of the best tools, tips and tricks I have found for administration, monitoring and automation of DBA tasks.
I know you’re just dying to go out and get it, but it will probably take a couple weeks for it to hit book stores and Amazon. The best way to buy the book is directly from the publisher. They have it in stock and ready to go.
I will be posting more about the book here in the near future. It really covers a lot of what I have learned in my professional career and I’m thrilled at the opportunity to share my experience in this form. If you have questions about the book please feel free to leave a comment. I don’t always get to my comments quickly, but I do read and reply to all of them.
Many popular varieties of Linux use a “feature” which causes the
ls command output to show files, directories, links, etc. all in different colors. I guess some people prefer this, but I find it at best annoying, and at worst illegible. Specifically the color-coding of symbolic links tend to show in such a light color that it is often impossible to read.
The color output is accomplished by adding the
--color=tty or a similar option to the
ls command. This is typically accomplished by creating an alias to
ls in either the user’s profile or in one of the system-wide profiles.
alias ls='ls --color=tty'
My personal preference is to remove this line from any system-wide configuration files (such as
/etc/profile) and allow users to set it in their own profile if preferred. If you don’t have the desire or ability to make this change universally than a user can easily disable the color output by using the
This can either be added to the user’s configuration file (e.g. the
.bash_profile in their home directory), or you can just type
unalias ls anytime to disable color
ls output for the rest of the current shell session. This can be especially useful to turn off the color output when you’re working on someone else’s system.
ls output can cause permissions errors in some circumstances, so in my opinion it is best left off, but if you’re stuck with it then it’s nice to know how it can be disabled when necessary.