🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 122 (from laksa120)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ℹ️ Skipped - page is already crawled

đź“„
INDEXABLE
âś…
CRAWLED
19 days ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0.7 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://superuser.com/questions/357248/how-to-copy-the-terminal-output
Last Crawled2026-03-21 17:31:06 (19 days ago)
First Indexed2017-03-16 00:59:48 (9 years ago)
HTTP Status Code200
Meta Titlelinux - How to copy the terminal output? - Super User
Meta Descriptionnull
Meta Canonicalnull
Boilerpipe Text
Save console output into a file: tee command tee command - read from standard input and write to standard output and files. It automatically creates file and save, all the output of cmd ps -ax into a file named as processes_info in the same folder from where the cmd has run. user@admin:~$ ps -ax | tee processes_info script command script command - make typescript of terminal session. user@admin:~$ script my_console_output.txt This creates a file named as my_console_output.txt and will open a subshell and records all information through this session. After this, script get started and whatever the console output, it will get stored in the file my_console_output.txt ; unless and until the script ends when the forked shell exits. (e.g., when the user types exit or when CTRL D is typed.) user@admin:~$ script -c "ps ax" processes_info.txt it starts the script; creates the file processes_info.txt ; stores the console output into the file; end (close) the script. Other example: script -c 'echo "Hello, World!"' hello.txt
Markdown
# ![site logo](https://stackoverflow.com/Content/Img/SE-logo75.png) By clicking “Sign up”, you agree to our [terms of service](https://superuser.com/legal/terms-of-service/public) and acknowledge you have read our [privacy policy](https://superuser.com/legal/privacy-policy). # OR Already have an account? [Log in](https://superuser.com/users/login) [Skip to main content](https://superuser.com/questions/357248/how-to-copy-the-terminal-output#content) #### Stack Exchange Network Stack Exchange network consists of 183 Q\&A communities including [Stack Overflow](https://stackoverflow.com/), the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. [Visit Stack Exchange](https://stackexchange.com/) 1. - [Tour Start here for a quick overview of the site](https://superuser.com/tour) - [Help Center Detailed answers to any questions you might have](https://superuser.com/help) - [Meta Discuss the workings and policies of this site](https://meta.superuser.com/) - [About Us Learn more about Stack Overflow the company, and our products](https://stackoverflow.co/) 2. ### [current community](https://superuser.com/) - [Super User](https://superuser.com/) [help](https://superuser.com/help) [chat](https://chat.stackexchange.com/?tab=site&host=superuser.com) - [Meta Super User](https://meta.superuser.com/) ### your communities [Sign up](https://superuser.com/users/signup?ssrc=site_switcher&returnurl=https%3A%2F%2Fsuperuser.com%2Fquestions%2F357248%2Fhow-to-copy-the-terminal-output) or [log in](https://superuser.com/users/login?ssrc=site_switcher&returnurl=https%3A%2F%2Fsuperuser.com%2Fquestions%2F357248%2Fhow-to-copy-the-terminal-output) to customize your list. ### [more stack exchange communities](https://stackexchange.com/sites) [company blog](https://stackoverflow.blog/) 3. [Log in](https://superuser.com/users/login?ssrc=head&returnurl=https%3A%2F%2Fsuperuser.com%2Fquestions%2F357248%2Fhow-to-copy-the-terminal-output) 4. [Sign up](https://superuser.com/users/signup?ssrc=head&returnurl=https%3A%2F%2Fsuperuser.com%2Fquestions%2F357248%2Fhow-to-copy-the-terminal-output) [![Super User](https://superuser.com/Content/Sites/superuser/Img/logo.svg?v=4bc8a703ebac)](https://superuser.com/) 1. 1. [Home](https://superuser.com/) 2. [Questions](https://superuser.com/questions) 3. [Unanswered](https://superuser.com/unanswered) 4. [AI Assist](https://stackoverflow.com/ai-assist) 5. [Tags](https://superuser.com/tags) 6. [Chat](https://chat.stackexchange.com/) 7. [Users](https://superuser.com/users) 8. [Companies](https://stackoverflow.com/jobs/companies?so_medium=superuser&so_source=SiteNav) 2. Stack Internal Stack Overflow for Teams is now called **Stack Internal**. Bring the best of human thought and AI automation together at your work. [Try for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=superuser-community&utm_campaign=side-bar&utm_content=explore-teams) [Learn more](https://stackoverflow.co/internal/?utm_medium=referral&utm_source=superuser-community&utm_campaign=side-bar&utm_content=explore-teams) 3. [Stack Internal]() 4. Bring the best of human thought and AI automation together at your work. [Learn more](https://stackoverflow.co/internal/?utm_medium=referral&utm_source=superuser-community&utm_campaign=side-bar&utm_content=explore-teams-compact) **Stack Internal** Knowledge at work Bring the best of human thought and AI automation together at your work. [Explore Stack Internal](https://stackoverflow.co/internal/?utm_medium=referral&utm_source=superuser-community&utm_campaign=side-bar&utm_content=explore-teams-compact-popover) # [How to copy the terminal output?](https://superuser.com/questions/357248/how-to-copy-the-terminal-output) [Ask Question](https://superuser.com/questions/ask) Asked 14 years, 4 months ago Modified [4 years, 9 months ago](https://superuser.com/questions/357248/how-to-copy-the-terminal-output?lastactivity "2021-06-08 07:38:49Z") Viewed 117k times This question shows research effort; it is useful and clear 11 Save this question. Show activity on this post. I executed commands in the terminal and there are outputs shown in the terminal. I want to select all the screen shown. How to achieve that ? - [linux](https://superuser.com/questions/tagged/linux "show questions tagged 'linux'") - [ubuntu](https://superuser.com/questions/tagged/ubuntu "show questions tagged 'ubuntu'") [Share](https://superuser.com/q/357248 "Short permalink to this question") Share a link to this question Copy link [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/ "The current license for this post: CC BY-SA 3.0") [Improve this question](https://superuser.com/posts/357248/edit) Follow Follow this question to receive notifications asked Nov 14, 2011 at 11:57 [![Andy Frédéric ANDRIANIAINA's user avatar](https://www.gravatar.com/avatar/10a00e59b29a1e1f26e757a1a8cd4f3b?s=64&d=identicon&r=PG)](https://superuser.com/users/105308/andy-fr%C3%A9d%C3%A9ric-andrianiaina) [Andy Frédéric ANDRIANIAINA](https://superuser.com/users/105308/andy-fr%C3%A9d%C3%A9ric-andrianiaina) 35122 gold badges55 silver badges1313 bronze badges 1 - 2 Is selecting it with the mouse and copying (`Ctrl-Shift-C`) not an option? slhck – [slhck](https://superuser.com/users/48078/slhck "236,899 reputation") 2011-11-14 12:05:11 +00:00 [Commented Nov 14, 2011 at 12:05](https://superuser.com/questions/357248/how-to-copy-the-terminal-output#comment394384_357248) [Add a comment](https://superuser.com/questions/357248/how-to-copy-the-terminal-output "Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.") \| ## 5 Answers 5 Sorted by: [Reset to default](https://superuser.com/questions/357248/how-to-copy-the-terminal-output?answertab=scoredesc#tab-top) This answer is useful 11 Save this answer. Show activity on this post. There are 2 options, 1. Either you can copy-paste the selected text using `Ctrl + Shift + C` and `Ctrl + Shift + V` in which you have freedom what things to copy OR 2. Redirect the text to a file using redirection > program1 \>outputfile.txt 2\>errorfile.txt here, all the stdout will go to outputfile.txt while all the stderr will go to errorfile.txt. P.S. from the comments below, 1. Select the text to be pasted, and use mouse middle button (scroll wheel button) to paste it at desired place. [Share](https://superuser.com/a/357249 "Short permalink to this answer") Share a link to this answer Copy link [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/ "The current license for this post: CC BY-SA 3.0") [Improve this answer](https://superuser.com/posts/357249/edit) Follow Follow this answer to receive notifications [edited Jun 12, 2020 at 13:48](https://superuser.com/posts/357249/revisions "show all edits to this post") [![Community's user avatar](https://www.gravatar.com/avatar/a007be5a61f6aa8f3e85ae2fc18dd66e?s=64&d=identicon&r=PG)](https://superuser.com/users/-1/community) [Community](https://superuser.com/users/-1/community)Bot 1 answered Nov 14, 2011 at 12:10 [![Vineet Menon's user avatar](https://www.gravatar.com/avatar/457e9a7a84f24959f0e7649870929473?s=64&d=identicon&r=PG)](https://superuser.com/users/99319/vineet-menon) [Vineet Menon](https://superuser.com/users/99319/vineet-menon) 74611 gold badge66 silver badges1616 bronze badges 3 - 2 There's also the buffer. In most terminal emulators I've used, if you copy over some text, you can paste it elsewhere with a click of the scroll wheel. Rob – [Rob](https://superuser.com/users/97687/rob "2,422 reputation") 2011-11-14 15:30:48 +00:00 [Commented Nov 14, 2011 at 15:30](https://superuser.com/questions/357248/how-to-copy-the-terminal-output#comment394480_357249) - @Rob: not only in terminals, anywhere. This trick is little known, even by some old time Linux users. m0skit0 – [m0skit0](https://superuser.com/users/94498/m0skit0 "1,337 reputation") 2011-11-14 17:35:42 +00:00 [Commented Nov 14, 2011 at 17:35](https://superuser.com/questions/357248/how-to-copy-the-terminal-output#comment394545_357249) - I could've sworn it wasn't working properly in my browser, don't have my netbook with me to check. Rob – [Rob](https://superuser.com/users/97687/rob "2,422 reputation") 2011-11-14 17:45:24 +00:00 [Commented Nov 14, 2011 at 17:45](https://superuser.com/questions/357248/how-to-copy-the-terminal-output#comment394547_357249) [Add a comment](https://superuser.com/questions/357248/how-to-copy-the-terminal-output "Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.") \| This answer is useful 6 Save this answer. Show activity on this post. ## Save console output into a file: 1. **`tee`** command **tee** command - read from standard input and write to standard output and files. It automatically creates file and save, all the output of cmd `ps -ax` into a file named as `processes_info` in the same folder from where the cmd has run. ``` user@admin:~$ ps -ax | tee processes_info ``` 1. **`script`** command **script** command - make typescript of terminal session. ``` user@admin:~$ script my_console_output.txt ``` This creates a file named as `my_console_output.txt` and will open a subshell and records all information through this session. After this, script get started and whatever the console output, it will get stored in the file `my_console_output.txt`; unless and until the script ends when the forked shell exits. (e.g., when the user types `exit` or when `CTRL``D` is typed.) ``` user@admin:~$ script -c "ps ax" processes_info.txt ``` - it starts the script; - creates the file `processes_info.txt`; - stores the console output into the file; - end (close) the script. Other example: ``` script -c 'echo "Hello, World!"' hello.txt ``` [Share](https://superuser.com/a/1020637 "Short permalink to this answer") Share a link to this answer Copy link [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/ "The current license for this post: CC BY-SA 3.0") [Improve this answer](https://superuser.com/posts/1020637/edit) Follow Follow this answer to receive notifications [edited Jun 12, 2020 at 13:48](https://superuser.com/posts/1020637/revisions "show all edits to this post") [![Community's user avatar](https://www.gravatar.com/avatar/a007be5a61f6aa8f3e85ae2fc18dd66e?s=64&d=identicon&r=PG)](https://superuser.com/users/-1/community) [Community](https://superuser.com/users/-1/community)Bot 1 answered Jan 1, 2016 at 22:14 [![akD's user avatar](https://www.gravatar.com/avatar/d5bede6e9de38170f7e8ee547253da89?s=64&d=identicon&r=PG)](https://superuser.com/users/539926/akd) [akD](https://superuser.com/users/539926/akd) 16111 silver badge33 bronze badges [Add a comment](https://superuser.com/questions/357248/how-to-copy-the-terminal-output "Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.") \| This answer is useful 3 Save this answer. Show activity on this post. First define a shortcut for marking all. (<https://askubuntu.com/a/1291548/676490>) 1. Go to Menu-\>Preferences-\>Shortcuts 2. From **Edit** selection choose "Select All" 3. Then to assign press Ctrl+Shift+A [CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/): Biddut Mitra *** - `Ctrl+Shift+A` - `Ctrl+Shift+C` - go whereever you want to paste it - `Ctrl+v` [Share](https://superuser.com/a/1644892 "Short permalink to this answer") Share a link to this answer Copy link [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/ "The current license for this post: CC BY-SA 4.0") [Improve this answer](https://superuser.com/posts/1644892/edit) Follow Follow this answer to receive notifications answered Apr 27, 2021 at 9:31 [![JoKalliauer's user avatar](https://www.gravatar.com/avatar/5b96a31e4a4e7187f599467e7eee70ae?s=64&d=identicon&r=PG)](https://superuser.com/users/631374/jokalliauer) [JoKalliauer](https://superuser.com/users/631374/jokalliauer) 28433 silver badges88 bronze badges [Add a comment](https://superuser.com/questions/357248/how-to-copy-the-terminal-output "Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.") \| This answer is useful 1 Save this answer. Show activity on this post. As opposed to the solutions suggested above, you may get into a situation where the output was *already* printed and you weren't smart enough to know beforehand that you'd like to record it somehow. In that case, you can at least save to a file the text that can be seen at the moment in your TTY using the backlog via `/dev/vcs#`. For example if you were using `/dev/tty1`, this terminal's backlog is available in `/dev/vcs1` so for example: ``` # cat /dev/vcs1 > tty1.log ``` Credits are reserved for The Arch Wiki: <https://wiki.archlinux.org/index.php/Copying_text_from_a_terminal#Accessing_Linux_terminal_backlog> [Share](https://superuser.com/a/1465476 "Short permalink to this answer") Share a link to this answer Copy link [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/ "The current license for this post: CC BY-SA 4.0") [Improve this answer](https://superuser.com/posts/1465476/edit) Follow Follow this answer to receive notifications answered Jul 29, 2019 at 22:27 [![Doron Behar's user avatar](https://www.gravatar.com/avatar/3947dd6fee8e0d9e415f623ef2defa02?s=64&d=identicon&r=PG&f=y&so-version=2)](https://superuser.com/users/430539/doron-behar) [Doron Behar](https://superuser.com/users/430539/doron-behar) 28133 silver badges99 bronze badges [Add a comment](https://superuser.com/questions/357248/how-to-copy-the-terminal-output "Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.") \| This answer is useful 0 Save this answer. Show activity on this post. # For windows users > I know this is off-topic to the question, but having all info under the same question helps rather than creating a dupe ## Scenario - You didn't think through and let a command display it's output rather than save it to a file - My speciic solution is for cmd.exe on windows, might work for poweshell as well (not tested) ## 1\. Small amount of text ### Option 1: use your mouse 1. click and drag mouse across the text you want to copy [![See example screenshot here](https://i.sstatic.net/GHRVD.png)](https://i.sstatic.net/GHRVD.png) 2. click enter (return key) Now the text is in your clipboard ### Option 2: use the "mark" menu 1. right click on the title bar and navigate down and select mark. See screenshot below [![select mark menu item](https://i.sstatic.net/QdrVM.png)](https://i.sstatic.net/QdrVM.png) 2. click and drag mouse across the text you want to copy [![See example screenshot here](https://i.sstatic.net/GHRVD.png)](https://i.sstatic.net/GHRVD.png) 3. click enter (return key) Now the text is in your clipboard ## 2\. Large amount of text - Say, you have a lot of terminal output you want to copy - This is limited to your terminal buffer size, so you should have selected a large terminal buffer in either defaults or in the properties of cmd window (see above screenshot for that menu item), else that text is just lost (not sure if windows stores cmd output somewhere). - This is the main "trick" I wanted to note here. Cause even though I consider myself a power user, I didn't know this. Here are the steps 1. right click the titlebar and nagivate and click select all [![Click select all menu item](https://i.sstatic.net/8DBI0.png)](https://i.sstatic.net/8DBI0.png) 2. click enter (return key) Now **all the text** is in your clipboard [Share](https://superuser.com/a/1571311 "Short permalink to this answer") Share a link to this answer Copy link [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/ "The current license for this post: CC BY-SA 4.0") [Improve this answer](https://superuser.com/posts/1571311/edit) Follow Follow this answer to receive notifications answered Jul 24, 2020 at 14:27 [![Dheeraj Bhaskar's user avatar](https://i.sstatic.net/f6N2A.jpg?s=64)](https://superuser.com/users/181696/dheeraj-bhaskar) [Dheeraj Bhaskar](https://superuser.com/users/181696/dheeraj-bhaskar) 41344 silver badges1010 bronze badges [Add a comment](https://superuser.com/questions/357248/how-to-copy-the-terminal-output "Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.") \| ## You must [log in](https://superuser.com/users/login?ssrc=question_page&returnurl=https%3A%2F%2Fsuperuser.com%2Fquestions%2F357248) to answer this question. Start asking to get answers Find the answer to your question by asking. [Ask question](https://superuser.com/questions/ask) Explore related questions - [linux](https://superuser.com/questions/tagged/linux "show questions tagged 'linux'") - [ubuntu](https://superuser.com/questions/tagged/ubuntu "show questions tagged 'ubuntu'") See similar questions with these tags. - The Overflow Blog - [After all the hype, was 2025 really the year of AI agents?](https://stackoverflow.blog/2026/03/20/was-2025-really-the-year-of-ai-agents/?cb=1) - [AI is becoming a second brain at the expense of your first one](https://stackoverflow.blog/2026/03/19/ai-is-becoming-a-second-brain-at-the-expense-of-your-first-one/?cb=1) #### Related [3](https://superuser.com/questions/79678/how-to-copy-all-output-on-xfce-terminal-of-gnome-terminal?rq=1 "Question score (upvotes - downvotes)") [How to copy all output on xfce-terminal of gnome-terminal?](https://superuser.com/questions/79678/how-to-copy-all-output-on-xfce-terminal-of-gnome-terminal?rq=1) [15](https://superuser.com/questions/195223/search-terminal-output?rq=1 "Question score (upvotes - downvotes)") [Search Terminal Output](https://superuser.com/questions/195223/search-terminal-output?rq=1) [57](https://superuser.com/questions/304223/how-to-search-terminal-output?rq=1 "Question score (upvotes - downvotes)") [How to search terminal output](https://superuser.com/questions/304223/how-to-search-terminal-output?rq=1) [1](https://superuser.com/questions/399987/terminal-refresh-lags-ubuntu-11-10?rq=1 "Question score (upvotes - downvotes)") [terminal refresh lags ubuntu 11.10](https://superuser.com/questions/399987/terminal-refresh-lags-ubuntu-11-10?rq=1) [0](https://superuser.com/questions/700516/change-terminal-output-location?rq=1 "Question score (upvotes - downvotes)") [Change terminal output location?](https://superuser.com/questions/700516/change-terminal-output-location?rq=1) [17](https://superuser.com/questions/1111283/how-do-i-see-all-previous-output-from-a-completed-terminal-command?rq=1 "Question score (upvotes - downvotes)") [How do I see all previous output from a completed terminal command?](https://superuser.com/questions/1111283/how-do-i-see-all-previous-output-from-a-completed-terminal-command?rq=1) [1](https://superuser.com/questions/1320128/using-tee-to-selectively-log-ubuntu-terminal-output?rq=1 "Question score (upvotes - downvotes)") [Using "tee" to selectively log Ubuntu terminal output?](https://superuser.com/questions/1320128/using-tee-to-selectively-log-ubuntu-terminal-output?rq=1) [0](https://superuser.com/questions/1743258/how-do-i-copy-the-tree-command-output-from-linux-terminal-without-losing-the-r?rq=1 "Question score (upvotes - downvotes)") [How do I copy the "tree" command output from Linux Terminal without losing the red/blue/white colours of the folder/file tree?](https://superuser.com/questions/1743258/how-do-i-copy-the-tree-command-output-from-linux-terminal-without-losing-the-r?rq=1) #### [Hot Network Questions](https://stackexchange.com/questions?tab=hot) - [How do physicalists explain rational oughts?](https://philosophy.stackexchange.com/questions/137158/how-do-physicalists-explain-rational-oughts) - [Complex dice rolling system for a d6, struggling to get an accurate probability calculator](https://rpg.stackexchange.com/questions/218984/complex-dice-rolling-system-for-a-d6-struggling-to-get-an-accurate-probability) - [Need help with ECDSA implementation mathematics](https://crypto.stackexchange.com/questions/119456/need-help-with-ecdsa-implementation-mathematics) - [How do proponents of annihilationism interpret “weeping and gnashing of teeth”?](https://christianity.stackexchange.com/questions/113408/how-do-proponents-of-annihilationism-interpret-weeping-and-gnashing-of-teeth) - [Can we use "consider somebody/something AS something"?](https://ell.stackexchange.com/questions/374343/can-we-use-consider-somebody-something-as-something) - [Is evidence objective or subjective?](https://philosophy.stackexchange.com/questions/137143/is-evidence-objective-or-subjective) - [How to find dihedral angle in a regular right pyramid with polygonal base?](https://math.stackexchange.com/questions/5129514/how-to-find-dihedral-angle-in-a-regular-right-pyramid-with-polygonal-base) - [In the millennia of fighting between Shadows and Vorlons was it ever the Vorlons who “lost”?](https://scifi.stackexchange.com/questions/303754/in-the-millennia-of-fighting-between-shadows-and-vorlons-was-it-ever-the-vorlons) - [Gravitational Waves to sound](https://physics.stackexchange.com/questions/870359/gravitational-waves-to-sound) - [Why doesn't Earth's atmosphere glow?](https://physics.stackexchange.com/questions/870292/why-doesnt-earths-atmosphere-glow) - [Why do many hotels tuck sheets and duvets so tightly, and is there a standard way to adjust them without remaking the bed?](https://travel.stackexchange.com/questions/203475/why-do-many-hotels-tuck-sheets-and-duvets-so-tightly-and-is-there-a-standard-wa) - [What's the difference between the Remastered and Complete Edition of Horizon Zero Dawn?](https://gaming.stackexchange.com/questions/418218/whats-the-difference-between-the-remastered-and-complete-edition-of-horizon-zer) - [How to parse sentences containing the archaic adverb "the" (þy)?](https://english.stackexchange.com/questions/639258/how-to-parse-sentences-containing-the-archaic-adverb-the-%C3%BEy) - [пробить на (meaning in context)](https://russian.stackexchange.com/questions/29760/%D0%BF%D1%80%D0%BE%D0%B1%D0%B8%D1%82%D1%8C-%D0%BD%D0%B0-meaning-in-context) - [In graphical linear algebra, show half of two equals one](https://math.stackexchange.com/questions/5129317/in-graphical-linear-algebra-show-half-of-two-equals-one) - [Negative commands being in the imperfective](https://russian.stackexchange.com/questions/29745/negative-commands-being-in-the-imperfective) - [Have armed forces ever transfused their wounded soldiers with blood forcibly collected from enemy fighters or occupied civilian populations?](https://history.stackexchange.com/questions/79937/have-armed-forces-ever-transfused-their-wounded-soldiers-with-blood-forcibly-col) - [Does a string for fastening a dress need to go through holes to be called a lace or not need to go through holes?](https://ell.stackexchange.com/questions/374319/does-a-string-for-fastening-a-dress-need-to-go-through-holes-to-be-called-a-lace) - [How did the fourth kingdom (Rome) destroy the others if they had already disappeared before Rome came to power?](https://hermeneutics.stackexchange.com/questions/115413/how-did-the-fourth-kingdom-rome-destroy-the-others-if-they-had-already-disappe) - [How do I get the actual height available for text on a page with a chapter title? (\\textheight includes the title height)](https://tex.stackexchange.com/questions/761083/how-do-i-get-the-actual-height-available-for-text-on-a-page-with-a-chapter-title) - [Does a True Polymorphed Simulacrum turn to snow when its Polymorphed form drops to 0 hit points?](https://rpg.stackexchange.com/questions/218975/does-a-true-polymorphed-simulacrum-turn-to-snow-when-its-polymorphed-form-drops) - [Why was the "numbers of mission phones" drawn as a diagram?](https://literature.stackexchange.com/questions/31791/why-was-the-numbers-of-mission-phones-drawn-as-a-diagram) - [What is the temperature of light?](https://physics.stackexchange.com/questions/870313/what-is-the-temperature-of-light) - [How to get the entire sequence of updated options within a function?](https://mathematica.stackexchange.com/questions/319055/how-to-get-the-entire-sequence-of-updated-options-within-a-function) [Question feed](https://superuser.com/feeds/question/357248 "Feed of this question and its answers") # Subscribe to RSS Question feed To subscribe to this RSS feed, copy and paste this URL into your RSS reader. ![](https://superuser.com/posts/357248/ivc/4fe5?prg=fe9026b3-19a6-4e57-82b9-a47013fd60a1) # Why are you flagging this comment? It contains harassment, bigotry or abuse. This comment attacks a person or group. Learn more in our [Abusive behavior policy](https://superuser.com/conduct/abusive-behavior). It's unfriendly or unkind. This comment is rude or condescending. Learn more in our [Code of Conduct](https://superuser.com/conduct/abusive-behavior). Not needed. This comment is not relevant to the post. ``` ``` Enter at least 6 characters Something else. A problem not listed above. Try to be as specific as possible. ``` ``` Enter at least 6 characters Flag comment Cancel You have 0 flags left today # ![Illustration of upvote icon after it is clicked](https://superuser.com/Content/Img/modal/img-upvote.png?v=fce73bd9724d) # Hang on, you can't upvote just yet. You'll need to complete a few actions and gain 15 reputation points before being able to upvote. **Upvoting** indicates when questions and answers are useful. [What's reputation and how do I get it?](https://stackoverflow.com/help/whats-reputation) Instead, you can save this post to reference later. Save this post for later Not now ##### [Super User](https://superuser.com/) - [Tour](https://superuser.com/tour) - [Help](https://superuser.com/help) - [Chat](https://chat.stackexchange.com/?tab=site&host=superuser.com) - [Contact](https://superuser.com/contact) - [Feedback](https://meta.superuser.com/) ##### [Company](https://stackoverflow.co/) - [Stack Overflow](https://stackoverflow.com/) - [Stack Internal](https://stackoverflow.co/internal/) - [Stack Data Licensing](https://stackoverflow.co/data-licensing/) - [Stack Ads](https://stackoverflow.co/advertising/) - [About](https://stackoverflow.co/) - [Press](https://stackoverflow.co/company/press/) - [Legal](https://stackoverflow.com/legal) - [Privacy Policy](https://stackoverflow.com/legal/privacy-policy) - [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public) - Cookie Settings - [Cookie Policy](https://policies.stackoverflow.co/stack-overflow/cookie-policy) ##### [Stack Exchange Network](https://stackexchange.com/) - [Technology](https://stackexchange.com/sites#technology) - [Culture & recreation](https://stackexchange.com/sites#culturerecreation) - [Life & arts](https://stackexchange.com/sites#lifearts) - [Science](https://stackexchange.com/sites#science) - [Professional](https://stackexchange.com/sites#professional) - [Business](https://stackexchange.com/sites#business) - [API](https://api.stackexchange.com/) - [Data](https://data.stackexchange.com/) - [Blog](https://stackoverflow.blog/?blb=1) - [Facebook](https://www.facebook.com/officialstackoverflow/) - [Twitter](https://twitter.com/stackoverflow) - [LinkedIn](https://linkedin.com/company/stack-overflow) - [Instagram](https://www.instagram.com/thestackoverflow) Site design / logo © 2026 Stack Exchange Inc; user contributions licensed under [CC BY-SA](https://stackoverflow.com/help/licensing) . rev 2026.3.20.41360
Readable Markdown
## Save console output into a file: 1. **`tee`** command **tee** command - read from standard input and write to standard output and files. It automatically creates file and save, all the output of cmd `ps -ax` into a file named as `processes_info` in the same folder from where the cmd has run. ``` user@admin:~$ ps -ax | tee processes_info ``` 1. **`script`** command **script** command - make typescript of terminal session. ``` user@admin:~$ script my_console_output.txt ``` This creates a file named as `my_console_output.txt` and will open a subshell and records all information through this session. After this, script get started and whatever the console output, it will get stored in the file `my_console_output.txt`; unless and until the script ends when the forked shell exits. (e.g., when the user types `exit` or when `CTRL``D` is typed.) ``` user@admin:~$ script -c "ps ax" processes_info.txt ``` - it starts the script; - creates the file `processes_info.txt`; - stores the console output into the file; - end (close) the script. Other example: ``` script -c 'echo "Hello, World!"' hello.txt ```
Shard122 (laksa)
Root Hash3131140398176769522
Unparsed URLcom,superuser!/questions/357248/how-to-copy-the-terminal-output s443