Terminal Question - View Command Results?

Discussion in 'macOS' started by thewhitehart, Dec 7, 2006.

  1. thewhitehart macrumors 6502a

    thewhitehart

    Joined:
    Jul 9, 2005
    Location:
    The town without George Bailey
    #1
    I'm a unix newbie - all I really know how to do is navigate through directories, move and copy files, and other basic stuff.

    Is there a way for me to view the results of commands I've run in the past in terminal.app? Like a log or something?

    I used the command ls -a in my home directory, and I read a file called ".history_bash", but it only showed what commands I ran, not their output, if that's what you call it.

    My ultimate goal is to ask a question here about whether some command I issued screwed up or modified anything, but I don't want to run the command again and risk it. I forgot the results when I did it the first time because I was too stupid to print it out. :(
     
  2. dukebound85 macrumors P6

    dukebound85

    Joined:
    Jul 17, 2005
    Location:
    5045 feet above sea level
    #2
    typing history will give you a log of commands. i dunno if thats what you want. there is some way to change how many shows up but i forget
     
  3. gr8tfly macrumors 603

    gr8tfly

    Joined:
    Oct 29, 2006
    Location:
    ~119W 34N
    #3
    Do you mean in one session of Terminal? or from all sessions?

    You can change the scrollback buffer to unlimited. (edit: or a specific number of lines)

    For an indivual command you can send its output to a file, using " > filename.txt"

    example: ls -a > listing.txt
     
  4. thewhitehart thread starter macrumors 6502a

    thewhitehart

    Joined:
    Jul 9, 2005
    Location:
    The town without George Bailey
    #4
    I'm not on my mac right now, but just typing 'history' at the prompt will give me a list of past commands and their output?

    I will keep that write to file buffer option in mind next time I use the terminal.

    (a history of all sessions, or at leat the past four or five).
     
  5. gr8tfly macrumors 603

    gr8tfly

    Joined:
    Oct 29, 2006
    Location:
    ~119W 34N
    #5
    Just the recent commands, but not their output.
     
  6. thewhitehart thread starter macrumors 6502a

    thewhitehart

    Joined:
    Jul 9, 2005
    Location:
    The town without George Bailey
    #6
    Ah... so there's no way of getting the output of past commands shown without first specifying it to write the output to a file in the first place?

    The thing is, I had to reset a friend's password in Windows XP. To do this, I had to make a USB stick bootable, as he did not have a CD drive. The USB stick had to have a bootable version of linux on it, called "Recovery Is Possible" linux. It came on a .iso, which included a shell script to make the USB stick bootable.

    I didn't realize that the script was meant to be executed in linux. I used the command as it told me, something like "Computer: ~/Desktop me$ sh mkusb.sh linux.iso". It returned a message stating something like "ERROR: Cannot load modprobe loop without at least a kernel extension!" or something like that. Then it followed with the words "modprobe loop". What does that mean? It said it would automatically find the USB drive, but it couldn't. I even specified the path to /Volume/CRUZERDRIVE and it said "No USB Drive Found".
     

Share This Page