Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to change the colour displayed of some folders when I do ls.

Right now I have a directory with movies and I would like to be able to see the ones that I haven't seen in a different colour of the ones that I have already seen.

Anyone can help me?

Thanks!

share|improve this question

2 Answers 2

up vote 1 down vote accepted

There isn't really a way to make it automatically change the color of a folder or file that you view, but you could do something with changing the permissions on the file, to make it change colors after viewing the movie. First, we will make sure that we have color enabled in our terminal. If you already see different colors for stuff in terminal, you can skip this step.

Edit ~/.bashrc, and make sure to uncomment the following line, if it is commented (simply remove the leading #'s)

#force_color_prompt=yes

You will have to close and re-open a terminal for this to take affect. Now that we have color in the terminal, a simple way to "mark movies as watched" would be to play with the permissions.

If your movies are all files, you could do something like setting the executable bit, which would make them green, by default. This shouldn't really be much of a security issue.

chmod +x MyMovie.mkv

If your movies are stored in separate folders, and you want to mark the containing folder as watched, you could do something like adding the sticky bit, which means that only the owner/creator of the folder (and files within the folder) can delete/rename them. In a typical household scenario, this shouldn't pose any real security risks (in fact, it would be more secure). This will make the "watched" movie show up as white, with a blue background.

chmod +t MyMovieFolder
share|improve this answer
    
Thanks mate for your help –  Vndtta Oct 31 '12 at 0:03
    
No problem. I'm just trying to share the Ubuntu love. –  reverendj1 Oct 31 '12 at 14:02

Sure in fact it's already in .bashrc, You just need to copy and edit the file.

dircolors -p > ~/.dir_colours

Edit .dir_colours to your liking and then source ~/.bashrc

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.