Small function to generate tags file for your project tags_init() { local root=$(pwd) local cmd="ctags -R -o .tags" for d in src test tst $*; do if [ -d "$root/$d" ]; then cmd="$cmd $d" fi done echo $cmd | sh 2>/dev/null }