3

I often copy fully qualified filenames from Nautilus...

However I get a different paste result when I paste it into a Terminal vs. when I paste it into a "normal" text field (eg. a text editor, or web page).

I do know that the clipboard can contain any number of "paste formats"... from Standard-locale text format, to specialized Word-processor rich-text format, to a full URI format of a file-object, etc...

So there is nothing "wrong" here;
I just want a workaround to allow me to copy a filename from Nautilis, and paste a "normal" text format into the Terminal...

Assuming this file /home/fred/a c
Here is a copy/paste example ...(copy it in Nautilus, using <Ctrl>C )

# paste into "normal" text field using <Ctrl>V
/home/fred/a c

# paste into Terminal using <Ctrl><Shift>V
file:///home/fred/a%20c 
                       # with a trailing space!  

Is there some way I can copy only a simple text format into the clipboad in Nautilus...
...or is there a way to paste the simple text format into Terminal, rather than the URI format?

Peter.O
  • 24,681

1 Answers1

3

I found two workarounds for this:

  1. right click in your terminal and select "paste filename"
    this will result in '/home/fred/a c', there seems to be no shortcut for this.
  2. alternatively you could press ctrl+l in nautilus, this will show you the folderpath. After copy and pasting this in your terminal you can use tab completion to get the filename.
david
  • 2,430
  • Thanks.. option 1. is close but it still requires some re-editing which I'm trying to avoid.. copy/paste has no "human factor" typos ... I do :) .... option. 2.. Thanks for the suggestion, but again, it is typo prone, and too many twiddly steps :) ... getting close though... maybe there is a decicated utility or script for this, so I'll hang out for that for a while.... – Peter.O Nov 06 '10 at 13:21
  • re your first option; It is very easy to assign a hotkey to this item: The same item appears in the Edit menu.. see my question http://askubuntu.com/questions/5241/ubuntu-editable-menu-accelerators-on-a-per-app-basis-where-is-this-option ... so its looking a bit better...but another option may stil turn up.. one that doesn't assume I want the filename primed with quotes and trailing space (I can see that it might be handy, but it is different to my normal expectation of a clipboard action)... – Peter.O Nov 06 '10 at 15:07
  • 1
    I've been experimenting with it a bit more, and I'm starting to like it! (especially now that I've realized I can hot-key it) ... It handles multiple files nicely too; it lists them on a single line with a space seperator, and of course, the single-quotes.. Now that the clipboard is available in "normal" text, it will be easy (enough) to knock up script to strip the extras (when I get the time... and maybe it won't be worth it... I've still got an eye open for an alternative, but your workaround is pretty good!... thanks – Peter.O Nov 06 '10 at 15:32