How to save terminal command and output history to pdf on exit?

When I exit a terminal session (terminal.app), I would like to automatically save the commands and output from the session to a PDF (or text file) as a reference. 
I can do this manually in Terminal by selecting Shell --> Print... --> PDF --> Save as PDF...
Unfortunately, I'm too forgetful to remember to do this each time before I exit. 
Is there an alias I could set or some other method to automatically save the contents of my session to a PDF when I exit?
Thank you in advance,
jjw

Frank,
Your response was helpful, but I realized after looking at my .bash_history file that only the commands entered are listed, not the output.  I would like my commands to be printed out, but also the result from the commands (in this simple example, the directory listing):
myuserid[~/galaxy-dist/tools]$ cd ncbi_blast_plus
-------------------------------------------------------------------------------- ----------------------------------------------------- 09:48:37
myuserid[~/galaxy-dist/tools/ncbi_blast_plus]$ ls
blastxml_to_tabular.py   hide_stderr.py           ncbi_blastp_wrapper.xml  ncbi_tblastn_wrapper.xml
blastxml_to_tabular.xml  ncbi_blastn_wrapper.xml  ncbi_blastx_wrapper.xml  ncbi_tblastx_wrapper.xml
-------------------------------------------------------------------------------- ----------------------------------------------------- 09:48:38
myuserid[~/galaxy-dist/tools/ncbi_blast_plus]$
I'm thinking that there is an automator script or an alias that I could use so that when I type, "exit", the commands and output for the session would be sent to a PDF and then the session would close.
I know it seems like an odd thing to want, but sometimes I'll forget the sequence of commands that gave me the correct output (plus, my command prompt has a timestamp on it, too).
Thanks, though, for the .bash_history information.
jjw

Similar Messages

  • How to save terminal command as application

    Does anybody know how to save this terminal command as an application? This is the command that I use to backup my computer, but it is annoying having to copy and paste it into terminal every time I want to use it. Here is the command:
    sudo rsync -auE --progress / /Volumes/Backup
    If I Paste this into terminal, it asks me for my password, then starts backing up. When I enter it into automator or applescript editor, there is an error. Thanks in advance!

    I tried saving a shell script command in an Applescript but when I run the script, it runs but then I get a spinning wheel, as if the script is in an endless loop. Can someone clarify what I need to do?
    My script:
    do shell script "/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder & disown"

  • How to run Terminal commands in Xcode?

    Anyone knows how to include Terminal commands ( like sudo) in Xcode?  for example in a line of my program I need to run this:
    sudo open/Library/Preferences/com.apple.sharing.firewall.plist
    I searched the library but found no class or routine for that.

    Well, I am not a professional programmer, but one of the things I continue to learn is how to wade through all of the Cocoa documentation (and it does get deep in spots).  Chances are though, no matter what you are trying to do, Apple or some third party has created a class to make it easier - you just have to find it.  My Xcode documentation bookmarks continue to grow, but you might start with some of Apple's documentation, such as
    Cocoa Fundamentals Guide
    Foundation Framework Reference
    Application Kit Framework Reference

  • How to set input delay and output delay when source Synchronous

    ClkIN is the board clock which is connected to the FPGA. Clkif is the generated clock from ClkIN. The Device's clk come from Clkif. So, how to set input delay and output delay in this scene(within my understand, this is Source Synchronous)?
    The example in many document, the input delay and output delay setting all refer to board clock(within my understand, this is System Synchronous). In that scene, the input delay max = TDelay_max + Tco_max; input delay min = Tdelay_min + Tco_min; the output delay max = Tdelay_max + Tsu; output delay min = Tdelay_min - Th.
    So, I want to know how to set input/output delay in the Source Synchronous.
    In system synchronous, I set input/output delay such as:
    create_clock -period 20.000 -name ClkIN -waveform {0.000 10.000} [get_ports ClkIN]
    create_generated_clock -name Clkif -source [get_pins cfg_if/clk_tmp_reg/C] -divide_by 2 [get_pins cfg_if/clk_tmp_reg/Q]
    create_clock -period 40.000 -name VIRTUAL_clkif //make virtual clock
    set_input_delay -clock [get_clocks VIRTUAL_clkif] -min 0.530 [get_ports DIN]
    set_input_delay -clock [get_clocks VIRTUAL_clkif] -max 7.700 [get_ports DIN]
    set_output_delay -clock [get_clocks VIRTUAL_clkif] -min -0.030 [get_ports DOUT]
    set_output_delay -clock [get_clocks VIRTUAL_clkif] -max 1.800 [get_ports DOUT]
    *******************************************************************************************

    So, first. Architecturally, the clock that you forward to your external device should not come directly from the clock tree, but should be output via an ODDR with its D1 input tied to logic 1 and the D2 tied to logic 0. This guarantees minimal skew between the output data and the forwarded clock.
    ODDR #(
    .DDR_CLK_EDGE("OPPOSITE_EDGE"), // "OPPOSITE_EDGE" or "SAME_EDGE"
    .INIT(1'b0), // Initial value of Q: 1'b0 or 1'b1
    .SRTYPE("SYNC") // Set/Reset type: "SYNC" or "ASYNC"
    ) ODDR_inst (
    .Q (Clkif_ff), // 1-bit DDR output
    .C (ClkIN_BUFG), // 1-bit clock input
    .CE (1'b1), // 1-bit clock enable input
    .D1 (1'b1), // 1-bit data input (positive edge)
    .D2 (1'b0), // 1-bit data input (negative edge)
    .R (rst), // 1-bit reset
    .S (1'b0) // 1-bit set
    OBUF OBUF_inst (.I (Clkif_ff), .O (Clkif_out));
    This generates an output clock that is the same frequency as your input clock. This is consistent with your drawing, but inconsistent with your constraints - is the forwarded clock a 50MHz clock or a 25MHz clock?
    I will assume your ClkIN goes to a BUFG and generates ClkIN_BUFG.  Your first constraint generates a 50MHz clock on the ClkIN port which will propagate through the BUFG to (among other places) this ODDR.
    create_clock -period 20.000 -name ClkIN -waveform {0.000 10.000} [get_ports ClkIN]
    Assuming your forwarded clock is supposed to be 50MHz, then your 2nd command is close to correct
    create_generated_clock -name Clkif -source [get_pins cfg_if/ODDR_inst/C] -combinational  [get_pins cfg_if/ODDR_inst/Q]
    With this done, you have successfully described the forwarded clock from your design. This is the clock that goes to your device, and hence should be the clock which is used to specify your input and output constraints.
    set_input_delay -clock [get_clocks Clkif] -min 0.530 [get_ports DIN]
    set_input_delay -clock [get_clocks Clkif] -max 7.700 [get_ports DIN]
    set_output_delay -clock [get_clocks Clkif] -min -0.030 [get_ports DOUT]
    set_output_delay -clock [get_clocks Clkif] -max 1.800 [get_ports DOUT]
    If you want to get fancier, you could try adding a set_clock_latency to the forwarded clock to account for the board propagation of the clock
    set_clock_latency -source TDtrace2 [get_clocks Clkif]
    (But I haven't experimented with clock latency on a generated clock and I don't know for a fact that it works).
    Avrum

  • How to change the input and output schema in BPEL process

    hi',
    Please tell me how to change the input and output schema in BPEL process after the process is made.
    thanks
    Yatan

    If your intention is just changing the content you are passing to bpel/returning from bpel
    Here is another way
    just update your default created xsd files with new elements, update wsdl elements in message definition and chnage bpel code to reflect new elements in activities
    Regards,
    Praveen

  • How to save my emails and adressbook files from an old ibook?

    How to save my emails and adressbook files from an old ibook (bought around 2002) ?
    The screen from the old ibook doesn´t work anymore (logicboard problem I guess).
    I saved everything else with starting it in target modus. That worked fine.
    I want to delete the files after that as well, because I wanna give away the old ibook and don´t want anyone to read my emails!
    Little helpers I have:
    A running MacBook
    External Screen (and cables to connect)
    Fire Wire Cable

    Don't know how helpful this will be but I often copy mail from one computer to another, I drag the mail from the mail window to the other computers drop box, then from the other computer double click it and mail asks me what I want to do with it, of course without a screen you'd need to use back to my mac.
    If you don't have back to my mac running, you could set up a second user account on the newer mac, import everything via target mode as suggested by c above, and then drag the mail to the first user account drop box.

  • How to save a game  and then load

    My final project of BSCS (Bachelor of Science in Computer Science) is a Multiplayer online Board game...Distributed Ludo...
    This project is in its final steps and I�m facing some difficulties.
    I do not know how to save the game and load it again. Can anybody guide me to the process?

    Saving a game is just persisting the data required for the game.
    Loading a game means reading the saved data and setting the attributes of the game (and player and ...) to start exactly the point where it was saved.
    So the steps to save are
    1. Identify the data necessary for retaining the same state when needed.
    2. Decide the data file format and structure.
    3. Get the snapshot of necessary attributes
    4. Save the data using APIs
    Steps to load are
    1. Read the data using APIs.
    2. Set the game attributes.
    3. Update the model and view accordingly.
    Hope this helps.

  • How to view the input and output layouts created in the planning folder?

    Hi all,
    How to view the input and output layouts created in the planning folder in the bw 3.5?
    Thanks
    Pooja

    Hi,
    You can refer to this link. How to create planning folder and executing the planning folder.
    http://help.sap.com/saphelp_nw04/Helpdata/EN/5d/7c4b52691011d4b2f00050dadfb23f/frameset.htm
    Hope this helps

  • Firefox don't close when "browsing and Download History" is deleted on exit

    Firefox doesn't close properly in about 50 % of cases. When closing FF, the window closes but the process firefox.exe isn't terminated. When trying to open FF again you got the error message "Firefox is already running, but not responding. To open a new window, you must first close the existing Firefox process, or restart your system." After terminating the process firefox.exe in the windows task manager, FF can be started again.
    Error only occurs when under "Options/Privacy/Use custom settings for history" at "Clear History when Firefox closes" the option "Browsing and Download History" is selected.
    All other options selected or not don't cause the issue.
    I switched this option it several times. When "Browsing and Download History" at "Clear History when Firefox closes" isn't selected, the error doesn't appear.
    Reproducible regardless if "Remember my browsing history" and "Remember download history" are selected or not.
    Reproducible:
    - after new installation of Firefox (Firefox 29.0.1 german, Windows7 64-bit)
    - with different profiles, even with all addons disabled or running in safe mode
    - with new profile with no addons or dictionaries installed
    - with windows firewall turned off and deactivated antivirus program
    - with hardware accellaration on and off
    I know the issue has already reported at bugzilla.mozilla.org and described at
    https://support.mozilla.org/en-US/questions/997918
    https://support.mozilla.org/de/questions/997670
    I want to describe the problem more precisely:
    It only occurs when "Browsing and Download History" is delete on exit. The other option at "Clear History when Firefox closes" don't cause this issue.
    Is there any other solution then to turn "Browsing and Download History" off?

    From what I have been reading from other posts on this forum, the issue may
    be caused by the clear history settings.
    Press the '''<Alt>''' or '''<F10>''' key to bring up the tool bar.
    Then '''Tools > Options > Privacy'''.
    The button next to '''History''', select '''Use Custom Settings'''.
    At the bottom of the page, turn on '''Clear History When Firefox Closes.'''
    At the far right, press the '''Settings''' button. Turn on ONLY '''Cache''' and
    '''Form And Search History''' leaving the others off.
    This is not a cure but will make it easier if Firefox locks up.
    '''https://support.mozilla.org/questions/997866?esab=a&s=&r=1&as=s''' {web link}

  • All my PDF forms are automatically transformed in Word forms,how can I change that and only choose the PDF I want to transform

    All my PDF forms are automatically transformed in word forms,how can I change that and only decide which PDF to be transformed in word

    Hi Ulfsch,
    Thank you for posting on the Adobe Forums, kindly try the step mentioned below.
    1) Right click on any of the PDF file and choose the option open with
    2) Select choose default program
    3) Select Adobe Reader/Acrobat from the list
    5) Check the box "always open this type of file with selected program" (not the exact same wording)
    6) Click OK
    If you are on Mac, CTRL+Click on the file.
    Go to Get info
    Go to Open with
    Change it to Adobe Reader/Acrobat and click change all.
    Thanks,
    Vikrantt Singh

  • How to put echo command and other command in same line in Terminal

    Hello everyone. I use GeekTool (v3.0.1) and was wondering if I could put an "echo" command and another command in a shell script such that the output would be 1 line only instead of 2 lines for the 2 commands. How do I do that?

    This is why I think iTunes, in its present form, is completely unsuited for cataloging eBooks. However you can do what you want to do with the existing tags. Since a picture is worth a thousand words, here's a screen cap for you to illustrate how:
    And the various other sorting options:
    Give all that a try and see how it works for you.

  • Help, i made a terminal command and i don't know how to undo it.

    i found my long lost folder of terminal commands.. and i forgot what this one did, so i clicked it (i made the commands into a "unix executable file").. and all my files on my desktop are now hidden.. the only way to find them is to type in the file name into finder.
    the command i typed in was
    while (true) do
    chflags hidden ~/Desktop/*
    done
    and now everything on my desktop is gone, and i dont know how to undo it, I undid once about 3 months ago when i wrote it, but i forgot what i did. I tried counterering the command with others but it isn't doing anything. thank you
    edit: i know this command cant destroy my system because it wasn't a sudo, but still, i had all my class work on my laptop and now it's all invisible

    Hi, try this...
    while (true) do
    chflags nohidden ~/Desktop/*
    done

  • How to save the variant and select it for displaying output

    For       ALV variant use the FM_REUSE_ALV_VARIANT_F4 and REUSE_ALV_VARIANT_DEFAULT_GET to allow the user to save the variant and select it for displaying output.If   any of the data (Z fields in VBAP) is blank,the cell in the column must be highlighted in red.

    Hi,
       Refer thsi code
    DATA : wa_variant  TYPE disvariant,       "Work area for variant
           wa_variant1 TYPE disvariant,       "Work area for variant
    *&      Form  sub_get_default_variant                                  *
    This form will initialize the variant                               *
    FORM sub_get_default_variant .
    *--Clear
      CLEAR wa_variant.
    *--Pass the report name
      v_repid = sy-repid.                     "Report ID
      wa_variant-report = v_repid.
    *--Call the function module to get the default variant
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save        = c_save
        CHANGING
          cs_variant    = wa_variant1
        EXCEPTIONS
          wrong_input   = 1
          not_found     = 2
          program_error = 3
          OTHERS        = 4.
    *--Check Subrc
      IF sy-subrc = 0.
        p_varnt = wa_variant-variant.
      ENDIF.
    ENDFORM.                                  "sub_get_default_variant
    Regards,
    Prashant

  • How to undo terminal commands

    ...sigh... being new to MAC I shouldn't have just assumed I could putz around and make changes like I used to with PC.
    So, I use Gradebook (I'm a teacher) and unfortunately, it's reliant on Java.
    So the other day I made the mistake of updating Java and it sent my world into a tailspin.  Gradebook suddenly stopped working.  It would just bounce in my dock but never open.
    Then I found out it was having issue with the new Java.  So I found instructions  to reverse the Java update  and go back to Java 6 here which required me to go into terminal and make changes:  http://support.apple.com/kb/HT5559?viewlocale=en_US
    I did that.  Now everyone claims that Gradebook fixed their issue with the new Java.  But I'm still having that bouncing then nothing problem.  So someone suggested I upgrade to Mavericks.  So I did... and when I re-tried Gradebook it told me I needed to download Java 6 for it to work, so I got excited thinking my problems were solved.  But nope... bouncing in the dock then nothing.
    Now I'm thinking those changes I made in Terminal are what the problem is.  So I googled how to remove those entries and I went into .bash and deleted them (kept a copy of what I was deleting though, just in case)  Didn't work.  So now I've read that I have to UNDO my changes and not delete them.  But I have no idea how to do that.
    This was my entire history in that .bash file:
    /Applications/Android\ File\ Transfer.app/Contents/MacOS/Android\ File\ Transfer ; exit;
    'lookupd -flushcache''lookupd -flushcache'
    'lookupd -flushcache'
    'lookupd -flushcache
    'lookupd -flushcache'
    /Applications/Gradebook.app/Contents/MacOS/JavaApplicationStub ; exit;
    sudo mkdir -p /Library/Internet\ Plug-Ins/disabled
    sudo mkdir -p /Library/Internet\ Plug-Ins/disabled
    sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled
    sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI .plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws
    sudo mkdir -p /Library/Internet\ Plug-Ins/disabled
    sudo mkdir -p /Library/Internet\ Plug-Ins/disabled
    sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled
    sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI .plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws
    sudo ln -s /System/Library/Java/Support/CoreDeploy.bundle/Contents/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    sudo ln -s /System/Library/Java/Support/CoreDeploy.bundle/Contents/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    sudo ln -s /System/Library/Java/Support/CoreDeploy.bundle/Contents/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    sudo update_prebinding -root / -force
    sudo update_prebinding -root/-force
    exit
    sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws
    man sudo
    sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws
    The red are the ones I put in.  That blue one references Gradebook but I don't recall entering that.
    Help me please???   I'd really, really appreciate it! 

    There are instructions at the bottom of the page you linked to that tell you how to undo it.
    Editing the .bash_history file only removes commands from the recorded history, it doesn't undo them. Although doing that isn't going to cause any problems, it does reveal a tendency to fiddle with "arcane knowledge" without fully understanding it. That's very, very bad, as doing the wrong thing in the Terminal could easily cause irreversible damage to the system that can only be fixed by reinstalling. It could even lead to data loss.

  • Save terminal commands?

    I use the terminal often for my java programing class and I was wondering if there is a way to save a certain command? I usually have a long annoying file path its a pain to type it to change the directory every time I load the terminal. Its not a big deal, but it would be nice if I could somehow save the command in a way to quickly get it back??
    Thanks in advance for your input

    There are several things you can do to make this work easier.
    File paths can be easily brought into terminal. Drag the file/folder that you want the path to onto the Terminal window. The path is entered automatically.
    If you have an entire command you have to retype, you can use the up arrow key to find it in your command history and then edit as needed and hit return.
    There are lots of other ways to do things in Terminal, but those are the ones I use most often. Another good idea would be to learn the various commands available in the shell you are using in Terminal. I use the bash shell (it says so at the top of my Terminal window) so a good reference for me can be found at http://www.gnu.org/software/bash/manual/bashref.html. I found this through Google. Presumably the other shells have similar references.
    Good luck. Hope this helps.
    PM G5, PB G4 17", iMac G5 20", iPod video 30GB, iPod Nano 1st Gen, iPod Shuffle 2nd Gen   Mac OS X (10.4.9)  

Maybe you are looking for

  • Find in Open/Save Dialog boxes

    The find in open/save dialog boxes seems to return unexpected results. Say I have two folders one called "Down under" and the other called "Down under 2". If I ask it to find "down" it only returns the file "Down under 2" and other files whose conten

  • IPhone linked to Apple ID

    Hi i bought used iPhone 5 from Dubai, and this phone was linked to apple ID & Password. i couldn't opene it, and when i contact the old owner, he said, he don't know the mail ID & Password. there is any possibility to do it? Mobile IMEI : 01 355200 4

  • Email attachment won't open correctly

    I get a weekly updated excell attachment in an email and the new attachment doesnt open only a previous file does.  how do i force it to refresh and open the new file?

  • Client Export Log too big

    Hi all, in the client export log I found many of these string for different tables: 4 ETW000 AGR_HIER.X_POS: NUMC value changed from '     ' to '00000' and the log size is about 2,5 GB. What I have done to solve the problem?? Thanks in advanced M.

  • Music cds not playing on external player

    Up until recently, I've burned music cds (cd-r) and have played them on my cd player/radio. Now when I burn cds they won't play away from my computer. I was, however,  able to play one on my dvd player that is with the television. The cd player/radio