Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd, 2017 please sign up again. Thanks!

  1. Follow us on twitter - we shoot all of our new original content out as well as random messages. https://twitter.com/linuxdotorg
    Dismiss Notice

Why is Terminal automatically entering my command after pasting? How can i solve this problem?

Discussion in 'Getting Started' started by AjayThakur3, Feb 4, 2019.

  1. AjayThakur3

    AjayThakur3 New Member

    Joined:
    Feb 4, 2019
    Messages:
    8
    Likes Received:
    0
    Why is Terminal automatically entering my command after pasting in terminal? I'm using ubuntu... vps?


    (Log in to hide this advertisement)

     
  2. Kryptoghost

    Kryptoghost New Member

    Joined:
    Jan 11, 2019
    Messages:
    25
    Likes Received:
    21
    Looks like you might be copying a return or another line when you copy. This might help though.

    Code:
    Prior to pasting type a # then paste your line. It will not execute and you can remove the # and hit enter when the modifications have been completed.
     
    wizardfromoz likes this.
  3. AjayThakur3

    AjayThakur3 New Member

    Joined:
    Feb 4, 2019
    Messages:
    8
    Likes Received:
    0
    but before this did not happen...what is the reason behind that and can I fix it like before?
     
  4. Kryptoghost

    Kryptoghost New Member

    Joined:
    Jan 11, 2019
    Messages:
    25
    Likes Received:
    21
    What are you copying? if you're copying a line from a terminal, i've noticed that if you copy the whole line then there is a return in there and it causes the paste to immediately resolve.

    This may vary between terminal emulators, but i would try copying different content to make sure its not the emulator you're using.
     
  5. AjayThakur3

    AjayThakur3 New Member

    Joined:
    Feb 4, 2019
    Messages:
    8
    Likes Received:
    0
    Yup, I'm using ssh root shell... for configuring VPS hosting. Whenever I was coping commands for that terminal automatically entering there a command line.
     
  6. Kryptoghost

    Kryptoghost New Member

    Joined:
    Jan 11, 2019
    Messages:
    25
    Likes Received:
    21
    do you copy the whole line or just the text with no white spaces at the end?
     
  7. AjayThakur3

    AjayThakur3 New Member

    Joined:
    Feb 4, 2019
    Messages:
    8
    Likes Received:
    0
    I'm coping command line like this sudo nano /etc/apache2/apache2.conf
     
  8. Kryptoghost

    Kryptoghost New Member

    Joined:
    Jan 11, 2019
    Messages:
    25
    Likes Received:
    21
    okay, i tested it. If you just copy the text only and not the entire line, it will paste without resolving

    if you copy the entire line, it will return once you paste. make sure only the text is highlighted and not the entire line.
     
    wizardfromoz likes this.
  9. AjayThakur3

    AjayThakur3 New Member

    Joined:
    Feb 4, 2019
    Messages:
    8
    Likes Received:
    0
    sorry I'm new at Linux... could you elaborate properly with an example?
     
  10. wizardfromoz

    wizardfromoz Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    2,294
    Likes Received:
    1,992
    G'day Ajay and welcome to linux.org :)

    Correct way is below



    [​IMG]

    SCREENSHOT 1 - RIGHT WAY TO BLOCK COMMANDS FOR COPY/PASTE



    Wrong way is below


    [​IMG]

    SCREENSHOT 2 - WRONG WAY TO BLOCK COMMANDS FOR COPY/PASTE

    You can likely see the difference?

    This does not occur in all cases.

    The use of "sudo" indicates to our Linux OS that a command of privileged status is to follow, and the excess highlighted colour in Screenshot 2 makes Linux think that the command has been typed and then Entered.

    Hopes this helps, and enjoy your Linux:D

    Chris Turner
    wizardfromoz

    No need - we have all been there, and some of us feel like we still ARE there :cool:
     
    Kryptoghost likes this.
  11. AjayThakur3

    AjayThakur3 New Member

    Joined:
    Feb 4, 2019
    Messages:
    8
    Likes Received:
    0
    but in my console, it is automatically entering after pasting?
     

    Attached Files:

  12. AjayThakur3

    AjayThakur3 New Member

    Joined:
    Feb 4, 2019
    Messages:
    8
    Likes Received:
    0
    Oh, I have got the issue behind that I'm using Evernote for copy my commands and pasting into the terminal. But in another case when I use different apps or like web etc. to copy the command and to paste into the terminal it does not enter my pasting command automatically. But what is the cause behind that can you tell me?
     
  13. Kryptoghost

    Kryptoghost New Member

    Joined:
    Jan 11, 2019
    Messages:
    25
    Likes Received:
    21
    This may not be helpful, but i highly recommend you not copy commands,

    1. you wont learn them as fast, typing them out every time concretes them into memory.
    2. you may accidentally do something you didn't intend to because you misunderstood the command as you glossed over.
    2.5. sometimes people will post malicious commands and you may not catch it if you don't read through it.

    I would say still make sure you're copying the way wizardfromoz mentioned on any software. Do not highlight white spaces after text.
     
    wizardfromoz likes this.

Share This Page