Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Copy & Paste using Keyboard ONLY in Terminal?

  1. #1
    Join Date
    Apr 2010
    Beans
    79

    Copy & Paste using Keyboard ONLY in Terminal?

    I've installed linux server 12.04 LTS and I have run

    sudo blkid
    I want to edit the fstab file so another partition is mounted automatically and I wanted to copy and paste the uuid=XXXXXXXXXXXXXXXXXXXXX

    . . . how do I do that without the mouse?

    Thanks
    Last edited by GMHilltop; September 5th, 2013 at 08:02 PM. Reason: removing solved from the Title

  2. #2
    Join Date
    Aug 2006
    Beans
    54

    Re: Copy & Paste using Keyboard ONLY in Terminal?

    Hi:

    # first, make a backup
    cp /etc/fstab /etc/fstab.bak

    # append output of blkid at the end of fstab
    sudo blkid >> /etc/fstab

    # CAUTION:
    # >> append
    # > OVERWRITE - delete original contents of the file begin redirected

    # edit fstab
    sudo nano /etc/fstab

    # in nano:
    # ctrl+U cut
    # ctrl+K paste

    Cheers

  3. #3
    Join Date
    Apr 2010
    Beans
    79

    Re: Copy & Paste using Keyboard ONLY in Terminal?

    Thanks alarme. That helps

    Learning how to work in terminal is coming slowly, but surely.
    I am sort of surprised that there isn't a more graceful way to handle this.

    If the output were to be 'Huge' it could hammer in a awful lot of crap at the end of a file when all you want is one line.

    So far I've been pleasantly surprised with navigating and the shortcuts (like hitting TAB) in terminal - this is the first thing that I've run into that seem rather archaic.

    Is this the ONLY way of dealing with this sort of a situation?

  4. #4
    Join Date
    Dec 2007
    Location
    Rajapalayam, Tamil Nadu
    Beans
    28
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Copy & Paste using Keyboard ONLY in Terminal?

    If you are looking for keyboard shortcuts and if ctrl+c and ctrl+v didn't work for copy & paste, then you may use ctrl+shift+c and ctrl+shift+v to do the same as mentioned in the help page for working with terminal.

  5. #5
    Join Date
    Aug 2009
    Location
    Makati City, Philippines
    Beans
    2,269
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: Copy & Paste using Keyboard ONLY in Terminal?

    GMHilltop : Be at home in the command line. I recommend this free ebook. Easy to read and follow. http://www.rigacci.org/docs/biblio/o...TLCL-09.12.pdf

  6. #6
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Copy & Paste using Keyboard ONLY in Terminal?

    You can also use Ctrl-K to cut from the cursor position to the end of the line, and Ctrl-Y to retrieve ("yank") the cut text. These are the same commands used in Emacs and Emacs clones like jed.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  7. #7
    Join Date
    Apr 2010
    Beans
    79

    [SOLVED] Re: Copy & Paste using Keyboard ONLY in Terminal?

    Thanks everyone for the help. There simply doesn't seem to be a 'nice' way to do it.

    The second post vyalarme here works best for my purposes although the WARNING IS WELL NOTED - the difference between ONE ' > ' and TWO ' >> ' could be disastrous!
    Like I said, I'd have thought there would have been a better way to do this by now considering how long linux has been running. Oh well.

    ctrl+v, ctrl+shift+v, etc simply do not work.

    I'll just have to get used to the way of copying and pasting with VIM and NANO

    Thanks again everyone.

  8. #8
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,868
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: [SOLVED] Copy & Paste using Keyboard ONLY in Terminal?

    Using SSH to connect with a terminal app gives the greatest joy using copy/paste for text console tasks.

  9. #9
    Join Date
    Apr 2010
    Beans
    79

    Re: Copy & Paste using Keyboard ONLY in Terminal?

    Can you use the same method for copying info from one file to another?

    In other words:

    sudo /etc/my_first_file >> /etc/my_2nd_file

    Will that append the data in the first file to the 2nd?

  10. #10
    Join Date
    Apr 2010
    Beans
    79

    Re: Copy & Paste using Keyboard ONLY in Terminal?

    I am not sure what I am doing wrong:

    Code:
    sudo blkid>>test_file 
    -bash: test_file: Permission denied

    I created an empty file with
    Code:
    touch test_file
    Everything is owned by root, what am I missing?
    Why is the permission denied?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •