CTRL+D vs CTRL+C

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












-2















Is it true to say that CTRL+D stops input execution while CTRL+C stops output displaying (as plain data, without execution)?










share|improve this question

















  • 2





    If not a dupe, at least related: What is the difference in using Ctrl+D and Ctrl+C to terminate cat command?

    – Kusalananda
    Feb 5 at 18:52















-2















Is it true to say that CTRL+D stops input execution while CTRL+C stops output displaying (as plain data, without execution)?










share|improve this question

















  • 2





    If not a dupe, at least related: What is the difference in using Ctrl+D and Ctrl+C to terminate cat command?

    – Kusalananda
    Feb 5 at 18:52













-2












-2








-2








Is it true to say that CTRL+D stops input execution while CTRL+C stops output displaying (as plain data, without execution)?










share|improve this question














Is it true to say that CTRL+D stops input execution while CTRL+C stops output displaying (as plain data, without execution)?







keyboard-shortcuts output input






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 5 at 18:24









JohnDoeaJohnDoea

7811134




7811134







  • 2





    If not a dupe, at least related: What is the difference in using Ctrl+D and Ctrl+C to terminate cat command?

    – Kusalananda
    Feb 5 at 18:52












  • 2





    If not a dupe, at least related: What is the difference in using Ctrl+D and Ctrl+C to terminate cat command?

    – Kusalananda
    Feb 5 at 18:52







2




2





If not a dupe, at least related: What is the difference in using Ctrl+D and Ctrl+C to terminate cat command?

– Kusalananda
Feb 5 at 18:52





If not a dupe, at least related: What is the difference in using Ctrl+D and Ctrl+C to terminate cat command?

– Kusalananda
Feb 5 at 18:52










1 Answer
1






active

oldest

votes


















1














No, it is not true.



However, it is true to say that Ctrl+D signals an End of Transmission (EOT) event which will generally cause a program reading input to close the input file descriptor.



Ctrl+D is used for this because its place on the ASCII table corresponds to the analogous End of File control character, even though the actual EOF control character is not actually transmitted in this case.



Pressing Ctrl+C will generally (it's configurable with stty) generate an interrupt signal (SIGINT) which will be delivered to the processes that are in the current terminal (see man kill; man 3 tcgetpgrp).






share|improve this answer




















  • 2





    I'm curious as to the reasoning behind the downvotes to this answer to the question. How would you who have downvoted this improve this answer? Edits or constructive comments are always welcome.

    – DopeGhoti
    Feb 5 at 19:25












  • There are a few more steps to Ctrl+D, but I don't feel it's important in this context. The process reading will get a zero back from read(), signalling an End of File state on that fd. That in turn is due to other things.

    – Kusalananda
    Feb 5 at 19:52






  • 1





    @mosvy I feel this comment isn't helping. How can the short question be improved IYO?

    – JohnDoea
    Feb 8 at 5:24






  • 1





    @mosvy demagogia means loss of time for all of us. I was really serious in my intention to ask how to IYO the difference could be best learned in a question here. I you think the difference should be learned by deepening the learning of each keyboard shortcut, this was indeed helping.

    – JohnDoea
    Feb 8 at 18:59






  • 1





    Digressions aside, I'm hopeful that my tweaks to the answer both clarify what is actually happening and do not diminish from the simplicity of the larger point, which is that it would not be true to say that ^C and ^D terminate stdout and stdin respectively, as asked at the outset of this adventure.

    – DopeGhoti
    Feb 8 at 20:14










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f498870%2fctrld-vs-ctrlc%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














No, it is not true.



However, it is true to say that Ctrl+D signals an End of Transmission (EOT) event which will generally cause a program reading input to close the input file descriptor.



Ctrl+D is used for this because its place on the ASCII table corresponds to the analogous End of File control character, even though the actual EOF control character is not actually transmitted in this case.



Pressing Ctrl+C will generally (it's configurable with stty) generate an interrupt signal (SIGINT) which will be delivered to the processes that are in the current terminal (see man kill; man 3 tcgetpgrp).






share|improve this answer




















  • 2





    I'm curious as to the reasoning behind the downvotes to this answer to the question. How would you who have downvoted this improve this answer? Edits or constructive comments are always welcome.

    – DopeGhoti
    Feb 5 at 19:25












  • There are a few more steps to Ctrl+D, but I don't feel it's important in this context. The process reading will get a zero back from read(), signalling an End of File state on that fd. That in turn is due to other things.

    – Kusalananda
    Feb 5 at 19:52






  • 1





    @mosvy I feel this comment isn't helping. How can the short question be improved IYO?

    – JohnDoea
    Feb 8 at 5:24






  • 1





    @mosvy demagogia means loss of time for all of us. I was really serious in my intention to ask how to IYO the difference could be best learned in a question here. I you think the difference should be learned by deepening the learning of each keyboard shortcut, this was indeed helping.

    – JohnDoea
    Feb 8 at 18:59






  • 1





    Digressions aside, I'm hopeful that my tweaks to the answer both clarify what is actually happening and do not diminish from the simplicity of the larger point, which is that it would not be true to say that ^C and ^D terminate stdout and stdin respectively, as asked at the outset of this adventure.

    – DopeGhoti
    Feb 8 at 20:14















1














No, it is not true.



However, it is true to say that Ctrl+D signals an End of Transmission (EOT) event which will generally cause a program reading input to close the input file descriptor.



Ctrl+D is used for this because its place on the ASCII table corresponds to the analogous End of File control character, even though the actual EOF control character is not actually transmitted in this case.



Pressing Ctrl+C will generally (it's configurable with stty) generate an interrupt signal (SIGINT) which will be delivered to the processes that are in the current terminal (see man kill; man 3 tcgetpgrp).






share|improve this answer




















  • 2





    I'm curious as to the reasoning behind the downvotes to this answer to the question. How would you who have downvoted this improve this answer? Edits or constructive comments are always welcome.

    – DopeGhoti
    Feb 5 at 19:25












  • There are a few more steps to Ctrl+D, but I don't feel it's important in this context. The process reading will get a zero back from read(), signalling an End of File state on that fd. That in turn is due to other things.

    – Kusalananda
    Feb 5 at 19:52






  • 1





    @mosvy I feel this comment isn't helping. How can the short question be improved IYO?

    – JohnDoea
    Feb 8 at 5:24






  • 1





    @mosvy demagogia means loss of time for all of us. I was really serious in my intention to ask how to IYO the difference could be best learned in a question here. I you think the difference should be learned by deepening the learning of each keyboard shortcut, this was indeed helping.

    – JohnDoea
    Feb 8 at 18:59






  • 1





    Digressions aside, I'm hopeful that my tweaks to the answer both clarify what is actually happening and do not diminish from the simplicity of the larger point, which is that it would not be true to say that ^C and ^D terminate stdout and stdin respectively, as asked at the outset of this adventure.

    – DopeGhoti
    Feb 8 at 20:14













1












1








1







No, it is not true.



However, it is true to say that Ctrl+D signals an End of Transmission (EOT) event which will generally cause a program reading input to close the input file descriptor.



Ctrl+D is used for this because its place on the ASCII table corresponds to the analogous End of File control character, even though the actual EOF control character is not actually transmitted in this case.



Pressing Ctrl+C will generally (it's configurable with stty) generate an interrupt signal (SIGINT) which will be delivered to the processes that are in the current terminal (see man kill; man 3 tcgetpgrp).






share|improve this answer















No, it is not true.



However, it is true to say that Ctrl+D signals an End of Transmission (EOT) event which will generally cause a program reading input to close the input file descriptor.



Ctrl+D is used for this because its place on the ASCII table corresponds to the analogous End of File control character, even though the actual EOF control character is not actually transmitted in this case.



Pressing Ctrl+C will generally (it's configurable with stty) generate an interrupt signal (SIGINT) which will be delivered to the processes that are in the current terminal (see man kill; man 3 tcgetpgrp).







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 8 at 20:17

























answered Feb 5 at 18:30









DopeGhotiDopeGhoti

45.8k55988




45.8k55988







  • 2





    I'm curious as to the reasoning behind the downvotes to this answer to the question. How would you who have downvoted this improve this answer? Edits or constructive comments are always welcome.

    – DopeGhoti
    Feb 5 at 19:25












  • There are a few more steps to Ctrl+D, but I don't feel it's important in this context. The process reading will get a zero back from read(), signalling an End of File state on that fd. That in turn is due to other things.

    – Kusalananda
    Feb 5 at 19:52






  • 1





    @mosvy I feel this comment isn't helping. How can the short question be improved IYO?

    – JohnDoea
    Feb 8 at 5:24






  • 1





    @mosvy demagogia means loss of time for all of us. I was really serious in my intention to ask how to IYO the difference could be best learned in a question here. I you think the difference should be learned by deepening the learning of each keyboard shortcut, this was indeed helping.

    – JohnDoea
    Feb 8 at 18:59






  • 1





    Digressions aside, I'm hopeful that my tweaks to the answer both clarify what is actually happening and do not diminish from the simplicity of the larger point, which is that it would not be true to say that ^C and ^D terminate stdout and stdin respectively, as asked at the outset of this adventure.

    – DopeGhoti
    Feb 8 at 20:14












  • 2





    I'm curious as to the reasoning behind the downvotes to this answer to the question. How would you who have downvoted this improve this answer? Edits or constructive comments are always welcome.

    – DopeGhoti
    Feb 5 at 19:25












  • There are a few more steps to Ctrl+D, but I don't feel it's important in this context. The process reading will get a zero back from read(), signalling an End of File state on that fd. That in turn is due to other things.

    – Kusalananda
    Feb 5 at 19:52






  • 1





    @mosvy I feel this comment isn't helping. How can the short question be improved IYO?

    – JohnDoea
    Feb 8 at 5:24






  • 1





    @mosvy demagogia means loss of time for all of us. I was really serious in my intention to ask how to IYO the difference could be best learned in a question here. I you think the difference should be learned by deepening the learning of each keyboard shortcut, this was indeed helping.

    – JohnDoea
    Feb 8 at 18:59






  • 1





    Digressions aside, I'm hopeful that my tweaks to the answer both clarify what is actually happening and do not diminish from the simplicity of the larger point, which is that it would not be true to say that ^C and ^D terminate stdout and stdin respectively, as asked at the outset of this adventure.

    – DopeGhoti
    Feb 8 at 20:14







2




2





I'm curious as to the reasoning behind the downvotes to this answer to the question. How would you who have downvoted this improve this answer? Edits or constructive comments are always welcome.

– DopeGhoti
Feb 5 at 19:25






I'm curious as to the reasoning behind the downvotes to this answer to the question. How would you who have downvoted this improve this answer? Edits or constructive comments are always welcome.

– DopeGhoti
Feb 5 at 19:25














There are a few more steps to Ctrl+D, but I don't feel it's important in this context. The process reading will get a zero back from read(), signalling an End of File state on that fd. That in turn is due to other things.

– Kusalananda
Feb 5 at 19:52





There are a few more steps to Ctrl+D, but I don't feel it's important in this context. The process reading will get a zero back from read(), signalling an End of File state on that fd. That in turn is due to other things.

– Kusalananda
Feb 5 at 19:52




1




1





@mosvy I feel this comment isn't helping. How can the short question be improved IYO?

– JohnDoea
Feb 8 at 5:24





@mosvy I feel this comment isn't helping. How can the short question be improved IYO?

– JohnDoea
Feb 8 at 5:24




1




1





@mosvy demagogia means loss of time for all of us. I was really serious in my intention to ask how to IYO the difference could be best learned in a question here. I you think the difference should be learned by deepening the learning of each keyboard shortcut, this was indeed helping.

– JohnDoea
Feb 8 at 18:59





@mosvy demagogia means loss of time for all of us. I was really serious in my intention to ask how to IYO the difference could be best learned in a question here. I you think the difference should be learned by deepening the learning of each keyboard shortcut, this was indeed helping.

– JohnDoea
Feb 8 at 18:59




1




1





Digressions aside, I'm hopeful that my tweaks to the answer both clarify what is actually happening and do not diminish from the simplicity of the larger point, which is that it would not be true to say that ^C and ^D terminate stdout and stdin respectively, as asked at the outset of this adventure.

– DopeGhoti
Feb 8 at 20:14





Digressions aside, I'm hopeful that my tweaks to the answer both clarify what is actually happening and do not diminish from the simplicity of the larger point, which is that it would not be true to say that ^C and ^D terminate stdout and stdin respectively, as asked at the outset of this adventure.

– DopeGhoti
Feb 8 at 20:14

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f498870%2fctrld-vs-ctrlc%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay