nik7
nik7

Reputation: 3058

Pasting executes command in unix

Sometimes in Unix kind of Operating Systems, just pasting a command in terminal executes the command instead of pasting and hitting enter. Is there a special reason for this behaviour ? Why is this useful ?

Upvotes: 2

Views: 720

Answers (2)

Houssem El Fekih
Houssem El Fekih

Reputation: 229

You pasted a newline character with it which executes the command

Upvotes: 3

Levon
Levon

Reputation: 143047

You have to be careful on how you copy (highlight) the command. If you go past the end of the command (or the next line), you are also copying the newline, so when you paste it, you'll get the newline acting like the <enter> key.

Once you know that, this feature can actually be quite nice .. especially if you do want the command to execute each time you paste.

Upvotes: 5

Related Questions