Linux : Open, Copy And Paste, Mouse Or Keyboard? Who Cares - With This.
Join the DZone community and get the full member experience.Join For Free
From http://news.u32.net/articles/2006/07/31/shell-vs-file-manager: Would you rather click on files or type at them? This is the root of a dichotomy that has existed ever since day one (day one was some time in mid 1964 according to my sources). Except for TwoDudes' short-lived FinderShell, I have never seen a program that effectively combines the strengths of each environment. Why must we choose? Here's a stupid trick that makes it easier to move data from mouse mode to finger mode and back. Add the following to ~/.bashrc or equivalent:
alias open=gnome-open alias copy="xclip -i" alias paste="xclip -o"Now open opens pretty much anything:
open mswd.docopens mswd.doc in OpenOffice or AbiWord (whatever your default is).
open tt.movopens the QuickTime clip in a movie player.
open .opens a new Nautilus window showing the current directory.
open http://u32.netopens a new browser window showing this blog. And copy and paste manipulate the clipboard: * paste (with no arguments) prints the clipboard to the terminal. * Select some text in a text editor and then run paste > newfile to save that selection to a file. * copy bigfile copies the contents of bigfile into the clipboard. * copy *.log copies the contents of all log files in the current directory. Of course, you can combine these tricks:
paste | tr a-z A-Z | copyconverts the contents of the clipboard to upper-case.
paste | tr A-Za-z N-ZA-Mn-za-m | copywill rot13 the clipboard. More in blog post...
Linux (operating system)
Opinions expressed by DZone contributors are their own.