Many times when I bowse the internet I copy some text from web page, open nano with command nano some.txt, paste copied text and then save it.
(i prefer command line this case but I use XFCE so if there is a GUI way I would like to know it too)
Is there a command like (this is my imagination)
saveclipboardtofile --file=some.txt
If I understand you correctly, then what you wish to do is paste the contents of the clipboard into a terminal window, with or without a character-mode application running, is that correct?
If so, it’s not that hard. Just position the cursor where you want the contents of the clipboard pasted, and then press Ctrl+Shift+V.
Now, you’re running XFCE, and I myself am running Plasma, so I don’t know whether the following shortcut is supported in XFCE too, but in Plasma, you can also use Shift+Ins, which works in both character-mode applications in a terminal and in GUI applications.
Not exackly.
I would like to copy (or mark some text in Firefox) and then, in terminal I would like to use a command that will save copied text into the text file. Without even opening vim or nano
You can simply use echo and bash’s built-in file commands > and >> (> overwrite output to file, and >> to append output to file).
For example, to create a new file with with pasted text
echo ' < paste text > ' > some.txt
The single quotes are to help the pasted text be interpreted as one string.
If your clipboard manager has the facility to output a copied item/s via terminal you may be able to do it a bit cleaner (as linux-aarhus mentioned). I use copyq and this command works for me, I still use echo so a newline is appended to the string. Using the append flavor (>>).