nautilis fork ( File manager ) with tree view in sidebar.

Was searching for this for sometime now, finally found it.

sudo yum install nemo
sudo yum list nemo*

First just install nemo. Configure nemo not to interfere with default desktop and also make it default handler. So, here are the settings that would do it.

gconftool-2 --set  /desktop/gnome/applications/component_viewer/exec --type 'string' 'nemo "%s"'
gconftool-2 --set  /desktop/gnome/url-handlers/trash/command --type 'string' 'nemo "%s"'
gsettings set org.nemo.desktop show-desktop-icons false

Now, if you need more functionality in file manager then check the list of nemo packages from the output of second command of yum. It has plugins like file preview and so on. Install and enjoy.

 

Enhanced by Zemanta

inotify -watch for file to change

Here is a simple command for you. It uses inotify tools. So first you need to install :

sudo yum install inotify-tools

and then you can try something like this:

while true; 
do 
inotifywait -r -e modify --exclude=".swp" . && make; 
done

Here, once the file changes, we are running make, but you can do anything you want.

 

 

Enhanced by Zemanta

Delete all but some directories

I think, like me, you would have faced a lot of situations, where you wanted to delete all the files or directories in a location, leaving only the required files/directories. So, I have a directory containing lots of files/directories and I want to delete most of them except some 5/10 of them, how to I do it.

I finally wrote a small script to do that. First save list of files that you do not want to delete in file called “listnames” and then execute the below script. This will give you the rm commands that you need to execute. If you want you can execute the rm command from the script, but to be able to review, I just have the commands echoed.

#!/bin/bash -
#===============================================================================
#
#          FILE: del_all_logs.sh
#
#         USAGE: ./del_all_logs.sh
#
#   DESCRIPTION:
#
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka)
#      REVISION:  ---
#===============================================================================

all_runs=$(echo *)
while read line
do
    all_runs=$(echo $all_runs |sed 's/'"$line"'//')
done 
all_runs=$(echo $all_runs |sed 's/'"$0"'//')
all_runs=$(echo $all_runs |sed 's/'"listnames"'//')
echo rm -rf $all_runs


 

Enhanced by Zemanta