DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone >

Linux : Open, Copy And Paste, Mouse Or Keyboard? Who Cares - With This.

Snippets Manager user avatar by
Snippets Manager
·
Aug. 14, 06 · · Code Snippet
Like (0)
Save
Tweet
453 Views

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.doc

    opens mswd.doc in OpenOffice or AbiWord (whatever your default is).

open tt.mov

    opens the QuickTime clip in a movie player.

open .

    opens a new Nautilus window showing the current directory.

open http://u32.net

    opens 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 | copy

    converts the contents of the clipboard to upper-case.

paste | tr A-Za-z N-ZA-Mn-za-m | copy

    will rot13 the clipboard. 

More in blog post...
Linux (operating system)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Why I'm Choosing Pulumi Over Terraform
  • 10 Books Every Senior Engineer Should Read
  • Debugging Deadlocks and Race Conditions
  • How to Leverage Method Chaining To Add Smart Message Routing in Java

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo