Ctrl-Backspace will delete the entire word to the left of your cursor in one keystroke, and Ctrl-Delete will delete the entire word to the right of the cursor. I was surprised to find that this works across all text editors/composers in linux!
For example, if I am typing a email within opera, I can use this trick to make fast edits.....in fact I can do this within blogger too...as I am editing this post..
Tuesday, October 24, 2006
Wednesday, October 11, 2006
The power of finding!
Everyone with a *nix box has used the "find" command. However, the keyword here is exploring its full potential.
Lets start with the basics:
To find files recursively, we execute
$find . -name "*.txt"
Should find all .txt files recursively starting from the directory it was executed in. If you want to search in some other directory replace the "." e.g.
$find ~/Documents -name "*txt"
Now for the fun part...
Did you know that you can tune the find command just to look for directories/links?
e.g. I executed the foll. in my home directory
$find . -type d -name "d*"
And obtained the foll:
./.gconf/desktop
./.gconf/desktop/gnome/screen/default
./.gnome2/panel2.d/default
./downloads
./.wine/dosdevices
./.wine/drive_c
./.wine/drive_c/windows/system32/drivers
./.wine/drive_c/Program Files/FreeMind/backup/doc
./.wine/drive_c/Program Files/wine_gecko/res/dtd
./.openoffice.org2/user/registry/data
./.openoffice.org2/user/database
./.openoffice.org2/user/psprint/driver
Cool, isn't it? But, we are not done yet....
Try this:
$find ~/Documents -size +128M
Nice, it finds file greater than 128MB. Ever think what the + sign was for? There must be a - equivalent, right?
Try this:
$find ~/Documents -size -128M
This finds files smaller than 128M
Finish up by trying this:
$find ~/Documents -size -128M -size +16M
Do remember when you type multiple args, you are in effect ANDing them, to or them type a -o before the args, and to perform an inverse type "!"
If you have been following this blog, I have shown you in the past how to combine find with xargs to perform actions on the files you found.
Some more examples
$find ~/Documents -name "*.jpg" -name "Pictures" | xargs -0 mv ~/tmp
$find ~/Documents -name "*.jpg" -o "*.gif" -o -name "Pictures" | xargs -0 mv ~/tmp
$find . -user mani -name *.mpg ! -name tosee* | xargs -0 rm
Hope I have helped you find the power in find!
Lets start with the basics:
To find files recursively, we execute
$find . -name "*.txt"
Should find all .txt files recursively starting from the directory it was executed in. If you want to search in some other directory replace the "." e.g.
$find ~/Documents -name "*txt"
Now for the fun part...
Did you know that you can tune the find command just to look for directories/links?
e.g. I executed the foll. in my home directory
$find . -type d -name "d*"
And obtained the foll:
./.gconf/desktop
./.gconf/desktop/gnome/screen/default
./.gnome2/panel2.d/default
./downloads
./.wine/dosdevices
./.wine/drive_c
./.wine/drive_c/windows/system32/drivers
./.wine/drive_c/Program Files/FreeMind/backup/doc
./.wine/drive_c/Program Files/wine_gecko/res/dtd
./.openoffice.org2/user/registry/data
./.openoffice.org2/user/database
./.openoffice.org2/user/psprint/driver
Cool, isn't it? But, we are not done yet....
Try this:
$find ~/Documents -size +128M
Nice, it finds file greater than 128MB. Ever think what the + sign was for? There must be a - equivalent, right?
Try this:
$find ~/Documents -size -128M
This finds files smaller than 128M
Finish up by trying this:
$find ~/Documents -size -128M -size +16M
Do remember when you type multiple args, you are in effect ANDing them, to or them type a -o before the args, and to perform an inverse type "!"
If you have been following this blog, I have shown you in the past how to combine find with xargs to perform actions on the files you found.
Some more examples
$find ~/Documents -name "*.jpg" -name "Pictures" | xargs -0 mv ~/tmp
$find ~/Documents -name "*.jpg" -o "*.gif" -o -name "Pictures" | xargs -0 mv ~/tmp
$find . -user mani -name *.mpg ! -name tosee* | xargs -0 rm
Hope I have helped you find the power in find!
Subscribe to:
Posts (Atom)