I don't know how to best describe this, but I am looking for a way to capture everything that's happening on one terminal, onto a file.  For example, I have this on my terminal screen:  yes@yes:/dev/pts$ echo "asdfasdf" asdfasdf yes@yes:/dev/pts$ sadsad sadsad: command not found yes@yes:/dev/pts$ tail /etc/passwd lxd:x:105:65534::/var/lib/lxd/:/bin/false uuidd:x:106:110::/run/uuidd:/usr/sbin/nologin dnsmasq:x:107:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin landscape:x:108:112::/var/lib/landscape:/usr/sbin/nologin sshd:x:109:65534::/run/sshd:/usr/sbin/nologin pollinate:x:110:1::/var/cache/pollinate:/bin/false yes:x:1000:1000:,,,:/home/yes:/bin/bash rtkit:x:111:115:RealtimeKit,,,:/proc:/usr/sbin/nologin usbmux:x:112:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin pulse:x:113:116:PulseAudio daemon,,,:/var/run/pulse:/usr/sbin/nologin yes@yes:/dev/pts$ testing terminal yohoho testing: command not found yes@yes:/dev/pts$    And I want this, exactly as it is (with all the information here, including the commands I run and the output of the terminal), to be exported into a file.  What I tried was something pretty naive, which obviously failed, was to run this from another terminal:  cat /dev/pts/0 &gt; ~/testfile   The reason I want to know how to do this is because I often have to work with files that are very large on remote machines with no ftp available, so being able to "cat" the files on the terminal, and have the output of the terminal automatically be exported on a file on my machine would be really useful.
121596
Is there some way of saving all the terminal output to a file with a command?   I'm not talking about redirection command &gt; file.txt Not the history history &gt; file.txt, I need the full terminal text Not with hotkeys !   Something like terminal_text &gt; file.txt
111307
Does an elegant way exist to save the output of a command to a file after the command has been run, while the terminal window is open i.e. once the command has been executed in the terminal?  The output is still present in terminal. Now I could copy &amp; paste all the lines and save it to a file.  But perhaps does a method exist to somehow write the output buffer of a terminal window to a file or even better the output of an already executed command?
62110
I want to write the output of only sudo command to some file i.e. the line which I get on terminal after writing sudo i.e.   [sudo] password for user:   If I use sudo ls &gt; file or sudo ls 2&gt; file then I get the stdout and stderr respectively of the whole command. Also I can't use sudo &gt; file or sudo 2&gt; file, then I will get error that I should use some options or command after sudo. So, is it possible to achieve?
58754
I often run commands in parallel that take a long time to finish and sometimes I lose track of what is running where since they output basically the same sort of information on screen.   Do you know of any way to find out what command is running in what terminal?
20404
At the risk of posting a duplicate question: How can I run a local script (as the current user) when I log out? I read (and tried) among others:   (Marton's version), which did perfectly nothing, used on a simple script creating a file, absolute paths to the script (being executable) and the file. , which must be outdated; it made me remove the file from command line to be able to use my system again. I also looked into , without succes.  I believe I must be doing something wrong here, but cannot find out what is my blind spot. Context Looking for an elegant solution (workaround) to , presumably the result of a bug, I made a script that, depending on the argument, either takes a snapshot of the current desktop icon arrangement, or arranges the icons, according to the last snapshot. The script works fine, but is really no candidate to run as a background script. The script therefore should run on logout to get the arrangement, obviously run by the current user.
97176
I have been looking for an answer to this and not finding anything which makes me think it's not possible but ...  Is it possible to save the current Gnome Terminal scrollback buffer to a file?  I know that I can do something like command &gt; output.txt to redirect all output to a file, or command | tee output.txt to split the output to the terminal as well as to a file. What I am trying to do is capture this after the fact. I'd like to save the current terminal tab's scrollback contents to a file.
1459
I would like to open a terminal, split it to lets say 9 parts (3x3) and execute some bash script. But for each terminal part different script.   Can this be done using perl, python or even bash?  How can I switch between those little terminals without using keyboard shortcuts?  Oh, by the way, I'm using terminator. And if there is some other terminal emulator that enables such a functionality, which is it?
107877
Here in the screen shot, there is a window and terminal open.    I am running on Ubuntu 10.04(kernel 2.6) LTS 64bit LiveCD session, and trying to run testDisk to recover my another formatted partition.  But, whenever I run the   sudo testdisk_static   command, it says, command not found!  As you can see in the picture, this file(testdisk_static) exists. if i double click it nothing happens. Its not running from terminal either.  Why this file doesn't run? What to do in this situation?
45801
I know there is ctrl+c, but sometimes that doesn't work. In Ubuntu desktop I can just close the terminal window and open a new one when this happens, but how would this be solved using the CLI in Ubuntu server (without restarting the box)?
28628
For example,   Say I want to list the contents of a folder and directly paste them into a chat window for a friend to see.    I realize I could do ls &gt; filename.txt to create a file (filename.txt) with those contents; I'd then have to open or print the file and manually select and copy the text block (which can be annoying/tedious.)  I clearly could also select and copy the output of ls directly from within the terminal window.  It would be much faster/easier to simply pipe standard output to the clipboard.  What terminal command allows me to do this?
42822
How can I make my file so that I can double click on it, and it runs. It is a .sh script, but I also have files that say:  executable (application/x-executable)  in the description of what they are.  I can't run any of these from terminal, or by double clicking.  If possible, I would like a way using either the GUI or a Terminal, but not a combination of the two.  Here is a screenshot of what I see when I right click then go on properties. The file first:    And the shell script here:    NB: I accept that this is a duplicate (I was looking for it, and couldn't find it, so asked + answered it, hoping that I would find it) however, I don't think the question about .desktop files is a duplicate.
64641
I want to see the output of a command in the terminal as if there was no redirection.  Also, stderr needs to be redirected to err.log and stdout needs to be redirected to stdout.log.  It would be nice to also have the exact copy of what is shown in terminal, i.e. errors printed as and when it occurs, in a separate file: stdouterr.log.
76908
I'm trying to do some debugging in Android and I am running a live logcat in the Terminal, but the problem is that there is too much information generated so that when I am finished and try to copy all the information received by choosing "Select All" and then "Copy" a lot of the early output which is produced isn't copied. I was aware of history, but that just provides a list of commands that have previously been entered, not the output.  Can I see a history of all the output that the terminal gives, or perhaps can I have the terminal save as a text file all the output that it is producing?
46255
I have a command that I run in a folder that outputs MD5 hashes and filenames on the terminal:  ls |sort -nr | xargs md5sum   I need this output in a text file that I can download and compare to another folder on another customer's machine. How can I modify the command such that its output is stored in a file in say /tmp? I'm using Redhat 5.
104679
I use Tilda (drop-down terminal) on Ubuntu as my "command central" - pretty much the way others might use GNOME Do, Quicksilver or Launchy.  However, I'm struggling with how to completely detach a process (e.g. Firefox) from the terminal it's been launched from - i.e. prevent that such a (non-)child process   is terminated when closing the originating terminal  "pollutes" the originating terminal via STDOUT/STDERR   For example, in order to start Vim in a "proper" terminal window, I have tried a simple script like the following:  exec gnome-terminal -e "vim $@" &amp;&gt; /dev/null &amp;   However, that still causes pollution (also, passing a file name doesn't seem to work).
69416
I'm learning how to create shell scripts on UNIX for a college class. The textbook says I should just be able to type the filename in my terminal and it should run, but so far I haven't been able to get that to work. But it works fine when I type in ./myscript. Currently, I am typing the scripts out on my Mac terminal, but I had FreeBSD loaded onto a virtual box and it was doing the same thing to me.  I think maybe I need to change my environment path? I remember I had to do that when I started writing python files.
29383
I have a running log, it outputs a lot to the terminal. Unfortunately, when I try to scroll up and view older output, it appears there is a limit. And I am unable to scroll past a certain point. On the Mac, the terminal allows you to scroll up to the start of the session. Is there a way to do this in ubuntu terminal?