Terminal window scrollback is saved somewhere?

Dear Mac enthusiasts,
Every Terminal window has a history, which is evident because you can scroll all the way back. In the Terminal Preferences there is even an option where you can set the Scrollback to unlimited, or limit it to a number of lines.
My question is, is this history saved somewhere in a hidden system file or something like that? Or is it only saved in the Terminal process memory which means when you close the window, or worse, exit Terminal, this history is gone forever?
The practical thing I'd like to be able to do is to access the scrollback info from a Terminal window that has already been closed. I catted (unix command cat) a file, then deleted the file, then closed the window, but I'd like to recover the contents of that file in this way.  I know, stupid, but if there is a solution, I'd like to hear it!
Best regards,
Jan

S.Fanara wrote:
Dear VikingOSX,
I created an account and logged in just so say Thanks! The info you gave is golden! In Terminal I tiped open ~/.bash_history and the entire history of anything I've ever typed in Terminal was there. I edited removing mistakes and what I didn't need (as sometimes I need to scrollback and remember the command I used for specific operations) so that is a small "memorandum" id commands if you will.
Once again thanks so much for the useful info provided!
The history command is history.  For instance:
history
history | grep -i cat
You can also use the recall operator and related — all of this is part of how bash works.

Similar Messages

  • Where is the Terminal Window Groups settings saved?

    Where is the Terminal Window Groups settings saved?  Would love to copy my Window Groups and customization to another computer.

    It's stored in the standard Terminal preferences file, namely ~/Library/Preferences/com.apple.Terminal.plist

  • Keyboard shortcuts: adding service to open a Terminal window not being saved

    Hi
    Objective: A shortcut to open a terminal window with the path of the 'in-focus' Finder window (Mavericks).
    Solution (that doesn't work): Apple Menu/System Preferences/Keyboard
    Select: Shortcuts
    Select: Services
    Check box for: New Terminal At Folder
    Close System Preferences
    This approach seems to be advised on quite a few sites. When I do it, the service I add simply doesn't get saved. I go back into the System Preferences and look under the path above and see that the box for New Terminal Åt Folder is unchecked.
    Any help in being able to achieve my objective would be greatly appreciated :-)

    Those things are saved as part of the workspace. It sounds as if the current workspace file has become corrupt. Close ID, then go to your user profile and you'll find the workspaces folder under \Application Data\Adobe\InDesign\Version 6.0\<language>\Workspaces. Delete the "current" xml file for the workspace and restart ID. The workspace will be restored to the conditions set when it was saved, but hopefully will remember changes again when you close the program.

  • Are Windows Network Credentials Saved Somewhere?

    I'm trying to connect to a Windows server from a Mac OS X 10.4 machine, but I keep getting locked out on the Windows network side. I've logged into this (and several other Windows machines) many times in the past, but I suspect my old Windows network credentials are saved somewhere on this Mac.
    I have to have the IT guys here at work unlock me constantly, every time I try to connect to this one server. Since our Windows server credentials need to be changed every 90 days, I'm thinking the Mac OS has stored a previous set of credentials, and when I try to connect to this server again, it asks me for my User/PW and it doesn't match up with what I have stored.
    Make sense?
    How can I delete any previous Windows network credentials, if this is indeed the problem? I just deleted System Configuration preferences in Library/Preferences, but I'm still not able to connect to this server.
    I have nothing saved in System Preferences/Accounts/Login Items
    Any help?
    Thanks!

    Check these two Uitilities out, thogh PWs may get stored elsewhere too, ByHosts folder is a common one.
    Keychain Access
    Most Passwords are stored here.
    Directory Access
    CIS/SMB and AD settings.

  • Why do Terminal Window Groups Get 2 Columns Wider Every Launch?

    I set up 3 terminal windows of different sizes, place them where I want, and save as a "Window Group." Then I set this Window Group to be used when launching Terminal.
    Lion has introduced a bug whereby every time you launch the Terminal app, each window in the Window Group gets wider by 2 columns. It is 100% reproducible and incredibly annoying.
    For example, follow these repro steps:
    Launch Terminal. Your first window in the group is 140 columns wide, just as you saved it.
    Quit Terminal.
    Launch Terminal. Your first window in the group is 142 columns wide. The other windows are similarly wider by 2 columns.
    Quit Terminal.
    Launch Terminal. Your first window in the group is 144 columns wide. Again, the other windows are also wider by 2 columns.
    ... and so on...
    If you select "Window > Open Window Group" and choose the same group, it will open them at the intended sizes. However, this doesn't solve the problem.
    Is there a work around to prevent this?
    Thanks,
    Tim

    a fix from apple will probably take some time (apple is not fast about bugs they consider minor).  in the meantime, you can use something like the following as a workaround.  copy the following into a plain-text editor and save it as <whatever>.applescript (somewhere out of the way - it doesn't matter where you save it so long as there are no permissions issues).
    tell application "System Events"
              set terminalPlist to property list file "~/Library/Preferences/com.apple.Terminal.plist"
              tell terminalPlist
                        set defaultWindow to value of property list item "Default Window Settings"
                        tell property list item "Window Settings"
                                  tell property list item defaultWindow
                                            if value of property list item "columnCount" ≠ 80 then
                                                      set value of property list item "columnCount" to 80
                                            end if
                                  end tell
                        end tell
              end tell
    end tell
    You could also save this as a compiled script (.scpt) using script editor; doesn't really matter.
    Then, copy the following into a plain-text editor and save it as user.terminal.widthFixer.plist (the name doesn't really matter, so long as it ends in .plist), in the folder ~/Library/LaunchAgents.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Label</key>
              <string>user.terminal.widthFixer</string>
              <key>ProgramArguments</key>
              <array>
                        <string>osascript</string>
                        <string>/Users/<yourname>/path/to/script.scpt</string>
              </array>
              <key>WatchPaths</key>
              <array>
                        <string>/Users/<yourname>/Library/Preferences/com.apple.Terminal.plist</string>
              </array>
    </dict>
    </plist>
    <yourname> should be your short user name, obviously, and the path in the ProgramArguments array should point to the script.  Log out and log back in, and this script should (in the simplest case) automatically reset the window width.
    caveats:
    I can't test this (the external disk with my Lion installation died), so I can't guarantee it will work out of the box
    depending on whether the increment occurs at startup or shutdown, you may need to set columnCout to 78 instead of 80 to get the right final size
    make sure you use a plain-text editor (TextWrangler, TextEdit in plain text mode, or any programmer's editor).  using a formatted text editor will mess things up.
    if you have a complex setup you may need to reset Window Settings other than the default one. All this means is changing tell property list item defaultWindow to tell property list item "window settings name".  adjustments should not be difficult, but post back with details if you need specific instructions.

  • Can't Drag Text from Terminal Window to Mail

    I can drag and drop text from Mail to the Terminal window but not the other way around. I can drag text from Terminal to Word but not Mail. Is there a setting I have wrong somewhere?

    Do we know if this is in the plasn for 10.5? It just seems like one Apple app to another Apple app should be abel to drag and drop text. It does work from Mail to Terminal... I can always copy and paste the text but it just gnaws away at me I guess.

  • Multiple terminal windows on multiple views in Subtle WM?

    Apologies if this has already been answered somewhere, but I couldn't find it.
    I'm using the Subtle WM, and I really love it's use of gravities and tags to position windows. The only problem I've run into is when I have multiple copies of the same program/window open, and want them placed on different views.
    If I have urxvt tagged to go to a particular view, then all of my urxvt terminal windows will open on that view. But I often like to have terminals open on different views for different purposes, depending on what I'm doing in that view.
    I tried tagging urxvt on multiple views, but that didn't work. Is there a way to accomplish this in Subtle?

    I've never used subtle, but I suspect it identifies client windows (for putting them on selected tags) by their resource name/class.  You can easily set these when you start urxvt (e.g. with the -name flag) so you can have different resource names for different urxvt windows.

  • How to unlock a FW external hard drive (la cie) in terminal window

    HI,
    I have a FW external La cie drive that today decided to lock itself and even though i have tried to unlock and repair privileges and reboot and change ownership and permissions, still cant get in.
    There must be a way in terminal window to unlock the external drive to allow me to access as it has ALL my itunes and iphotos files on.
    HOwever i have a seperate 'copy' of my iphotos so second question is how can i place that folder somewhere to enable iphotos to actually open therefore seeing all my photos.
    If any one can help i would really appreciate it.
    thank you
    Kris

    Just a few easy steps.
    1. Right click (or Control-click) on the desktop icon of the drive you wish to unlock.
    2. Select Get Info.
    3. Unlock the locked icon at lower right of Info.
    4. Enter your system password.
    5. Open a Terminal window Applictions > Utilities > Terminal
    6. Enter the following:
    sudo chflags -R nouchg "/Volumes/[Drive Name]" , leave the quotation marks in.
    7. Press Return.
    8. Enter password in terminal and press return. If Successful, the terminal will not report a result, but the lock should be gone. If not successful, make sure you have the drive name spelled correctly (it needs to be EXACT, include leading or trailing spaces.
    9. Don't forget to go back to the Drive Info dialog in Step 1 and give yourself read and write permissions!

  • Terminal's scrollback during an ssh session

    Hi,
    Using Terminal I am connected to a windows machine from my mac via ssh.
    During this session Terminal's scrollback feature doesn't work. It always shows an output of 24/25 lines.
    How can I scrollback to see more output?
    Thanks.

    mahsan wrote:
    I am using the Terminal application in my MAC to connect to a windows PC via SSH.
    In the PC I am running FreeSSHd.
    Yes, I gathered that much. What program are you running in that terminal session? Is it some kind of DOS program that uses direct term I/O?

  • Question about connection to network with Terminal Window

    WinXP Pro, SP2, PCMCIA-Fritz-Card
    Hi,
    I'm trying to create a computer-to-computer connection via ISDN telephone line.
    I didn't install any specific dialing software, I'm using only setting of MS WinXP.
    The hardware is working fine, I tested it successful while dialing in to different internet provider.
    Now I need to connect to a company network and they have a specific logon policy, where I need to show the Terminal Window during login procedure.
    Therefore I activate on dial in connection property dialog, on page 'Security Properties' the option 'Show Terminal Window'.
    Problem during dial in: the window doesn't occur.
    Second problem: If I go next time to this option, the input value is not saved.
    Any ideas?
    Regards,
    Peter

    Please dont be mad on me but I dont see what is in your posting specific for Toshiba forum.
    You should talk with network administrator in your company and he should be able to help you. Other way, maybe on some network specific forum you will have more chance to find out what is the solution for your problem.
    If you have Toshiba notebook and all hardware you need for connection works well, I dont see reason for writing here.
    Anyway I wish you luck and hope your network administrator will be able to help you.

  • Terminal: Window group with commands

    Hi, how can I set up a Terminal window group that executes a different command for each window?
    What I'm trying to do is restore an array of Terminal instances each pointing to a different location when Terminal opens (so one window should execute "cd x," the next "cd x/src," etc.).
    With Tiger I could create a .term file and set an "ExecutionString" (that's how commands were labeled in the .term file format) property for each window, but with SL I'm only able to create one shell command in Preferences|Settings that is executed by all Terminal windows in the group.
    So basically, how can I get Terminal to remember a group of windows and their associated file system locations?
    I've spent a few hours searching and trying stuff without success. The window groups are stored in Terminal's .plist file so I opened it with Property List Editor and see the Window Groups stored in there but no properties resembling a command for each group.
    Thanks!

    neenach2002 is basically correct on this one; this post got me pointed in the correct direction. I've gone a little farther to suit my needs (and answer your question directly), so I figured I'd post my results:
    First, create a file called "~/window1.bashrc" and place the following in it:
    export MYHOME=/Volumes
    cd ${MYHOME}
    Next, go to Terminal -> Preferences -> Settings. Create a new profile called "MyProfile_Window1" based on one you like, then go to the Shell button, and type "bash --init-file ~/window1.bashrc" (without quotes) into the filed labeled "Run command." Be sure the check box next to it is checked.
    Repeat for as many windows as you want, changing your label to Window2, Window3, etc. Be sure you have created the associated ~/window2.bashrc, ~/window3.bashrc, etc also.
    You should now be able to open a new window or a new tab via Shell -> New Window -> MyProfile_Window1 or Shell -> New Tab -> MyProfile_Window1, and it should go directly to the directory you want.
    Once you have used the menu options above to launch all your windows, save THAT as your window group via Window -> Save windows as group, and under Terminal -> Preferences -> Startup, be sure your newly saved window group is set to launch.
    Hope it helps!
    - Kevin
    PS: If you would like to use this to attach to multiple servers, you can do the same thing by just launching a shell script that performs an SSH to the appropriate server. To take it one step further, consider using the unix "screen" utility to allow you to instantly reconnect to a dropped setup! I think I'll write a User Tip for this - it's a very handy setup!

  • Terminal Windows don't login locally

    I have a saved group of terminal windows that, when opened, not all windows actually login locally with a command prompt. Often any number of the terminal windows just hang, with no command prompt. Any ideas?

    how can i post a screen shot here?
    basically, in the morning, I boot up.
    I click on my terminal icon in my nav bar, and 4 windows open (hence saved group).
    Within those 4 terminal windows, not all windows show the command prompt. Sometimes, only 1 gives me a command prompt and the others are just blinking cursors. Sometimes, I get 2, 3, or all, but always different.

  • Closing Terminal window tabs shrinks Terminal window height

    Open a Terminal window, press Command-T to create a tab, and then Ctrl-D to close that new tab, the Terminal window height decreases by one row.
    This most certainly appears to be a bug. How do I report this to Apple?

    I am also experiencing this problem, however if you use the Basic setting the problem doesn't exist.
    I am using Novel and I have the problem. It's quite annoying.
    I noticed that if you set the fontsize to 12 then this problem exhibits, however if I change the size to 11pt or 10pt (10 is the default for Basic, 12 is default for Novel) then I don't have the bug.
    Message was edited by: TonyKL

  • If I have a program that runs in windows under the command prompt and on Mac in the Terminal window, can it be run in iOS

    I have a program that is ran using the command line in windows and the terminal window on Mac or LInux.  Is it possible to create an app for the iPad that could run this program.  This program does require admin rights.

    No.

  • Code to close terminal window?

    I am running code in an IDE and want to be able to have any existing terminal window close before the code is run.  This way I don't have to keep closing them manually every time I run the code again.  I'm coding in C.  Any ideas?
    Thanks

    What about setting the
    Terminal -> Preferences -> Settings -> Shell -> When the shell exits: Close the window
    Now just make sure that the last thing your script does is exit from the shell and your window will be closed.
    Then again, do you "Really" need a Terminal session to run your code?
    That is to say, running programs and scripts can be done without needing a terminal session.  The Terminal session is just a window to the command line, and you do not need to display anything via the Terminal display, then there is no reason to have it open to run your program.
    You can use Applescript ("do shell script" statement), or Automator ("run shell script" action), or you can use a 3rd party utility such as Platypus that will put your program or script in a double clickable app that does not need a Terminal session.
    Another option is to use a different Terminal emulator, such as iTerm which also has the ability to close the window when the shell exits.  It can even automatically quit iterm when the last window is closed.

Maybe you are looking for

  • How can i make a free account on a iPad

    How can I make a free account on iPad 2

  • Page setup fails export to PDF

    I have exported a pages document as PDF, but when I open it with an adobe reader it switches page size. I wrote it as A4, but the PDF opens as US letter size. I can change the page setup in the adobe and print as A4, but the PDF is for circulating to

  • Cursor using variable table name

    I'm new to Oracle, and am wondering if I can create a cursor that can take a variable name as the table it's selecting from. I am working on an application that is loading data to 1 of 3 tables. The table name is stored as a variable and the loads ar

  • Stored procedure Issue  in VC - Urgent

    Hi all, I am trying to insert a new record in a SQL Server database, using a stored procedure. I am inserting this new record from a popup iview, in which the data service is configured. But when I try to insert a new record, I am getting an error "N

  • Is it possible to rotate a vignette mask?

    I want to use a vignette mask, but rather than the straight left- right oval I would like to have the vignette at about a 45 degree angle. I have the effect otherwise worked out and I do not wish to rotate the image. I was able to get the correct ang