{"id":27,"date":"2017-06-29T19:46:49","date_gmt":"2017-06-29T19:46:49","guid":{"rendered":"https:\/\/content.ronella.xyz\/apps\/wordpress\/?p=27"},"modified":"2017-07-03T20:48:41","modified_gmt":"2017-07-03T08:48:41","slug":"windows-command-output-to-clipboard","status":"publish","type":"post","link":"https:\/\/www.ronella.xyz\/?p=27","title":{"rendered":"Windows Command Output to Clipboard"},"content":{"rendered":"<p style=\"margin: 0in; font-family: Calibri; font-size: 11.0pt;\">Sometimes it is useful to get the output of a command and paste it to a text editor. For this we can use <span style=\"font-weight: bold;\">piping<\/span> and the <span style=\"font-weight: bold;\">clip<\/span> <span style=\"font-style: italic;\">(i.e. sends the output to Windows clipboard)<\/span> command.<\/p>\n<p style=\"margin: 0in; font-family: Calibri; font-size: 11.0pt;\">Example:<\/p>\n<p style=\"margin: 0in; font-family: Calibri; font-size: 11.0pt;\">If we go to any directory and run the <span style=\"font-weight: bold;\">tree<\/span> command but it returns a very long output that exceeds the screen. We can redirect the output to Windows clipboard temporarily then paste it to a text editor.<\/p>\n<ol style=\"margin-left: .375in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in; font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;\" type=\"1\">\n<li style=\"margin-top: 0; margin-bottom: 0; vertical-align: middle;\" value=\"1\"><span style=\"font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;\">Open a command terminal.<\/span><\/li>\n<\/ol>\n<ol style=\"margin-left: .375in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in; font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;\" type=\"1\">\n<li style=\"margin-top: 0; margin-bottom: 0; vertical-align: middle;\" value=\"2\"><span style=\"font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;\">Try to run the following tree command.<\/span><\/li>\n<\/ol>\n<p style=\"margin: 0in; margin-left: .375in; font-family: Calibri; font-size: 11.0pt;\">%USERPROFILE%&gt;<span style=\"font-weight: bold;\">tree<\/span><\/p>\n<p style=\"margin: 0in; margin-left: .375in; font-family: Calibri; font-size: 11.0pt;\">Where %USERPROFILE% is normally resolves to our local home directory.<\/p>\n<p style=\"margin: 0in; margin-left: .75in; font-family: Calibri; font-size: 11.0pt;\">The output might not fit to command terminal screen.<\/p>\n<ol style=\"margin-left: .375in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in; font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;\" type=\"1\">\n<li style=\"margin-top: 0; margin-bottom: 0; vertical-align: middle;\" value=\"3\"><span style=\"font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;\">Try redirecting it to a Windows clipboard with the following command:<\/span><\/li>\n<\/ol>\n<p style=\"margin: 0in; margin-left: .375in; font-family: Calibri; font-size: 11.0pt;\">%USERPROFILE%&gt;<span style=\"font-weight: bold;\">tree | clip<\/span><\/p>\n<p style=\"margin: 0in; margin-left: .75in; font-family: Calibri; font-size: 11.0pt;\">You will see no output because it is directed to a Windows clipboard.<\/p>\n<ol style=\"margin-left: .375in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in; font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;\" type=\"1\">\n<li style=\"margin-top: 0; margin-bottom: 0; vertical-align: middle;\" value=\"4\"><span style=\"font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;\">Open a text editor of our choice <\/span><span style=\"font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: italic;\">(or anything where we wanted to paste the output)<\/span><span style=\"font-family: Calibri; font-size: 11.0pt; font-weight: normal; font-style: normal;\">.<\/span><\/li>\n<\/ol>\n<p style=\"margin: 0in; margin-left: .75in; font-family: Calibri; font-size: 11.0pt;\">Check if you can confirm the last entries from step 2 exists to our pasted output.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes it is useful to get the output of a command and paste it to a text editor. For this we can use piping and the clip (i.e. sends the output to Windows clipboard) command. Example: If we go to any directory and run the tree command but it returns a very long output that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[11],"_links":{"self":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/27"}],"collection":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=27"}],"version-history":[{"count":2,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":29,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/27\/revisions\/29"}],"wp:attachment":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}