moving files to parent directory

This command will move all files & directories to the parent directory:

find . -maxdepth 1 -exec mv {} .. \;

... it will throw a warning when trying to move the current (.) directory:

mv: cannot move `.' to `../.': Device or resource busy

using GREP to search specific file types

Every developer knows and loves GREP, the great search utility available on all Unix-based systems; while it does a great job searching, the options are a little lacking. One such option is restricting the search to only specific file types/extension. Luckily that functionality can be easily wrapped up in a handy script.

Create the script file:

cd /bin sudo vim grepp

(You can name the script whatever you want, I named mine "grepp" for easier typing!)

Paste the following code:

  • Page 1