4

Output of history command looks like this:

1975  mkdir adrnln/work_dump
1976  ls
1977  code
  1. What do the numbers on the left side mean?
  2. Is it true that commands entered for example on Monday will be displayed higher than those one entered on Tuesday?
  3. If above is true, why I can see some commands like ssh entered yesterday displayed lower than commands I entered today.
1

1 Answer 1

4
  1. History can only store amount. When it reaches 1000 entries, it can't store more. So if you have 1500 commands, it will display the most recent 1000 (500 to 1500).

    You can also use the command !N (where N is the number) to run that command again. This is an output of my recent history:

    336  cp monitors.tim monitors.xml
    337  cd .config/
    338  cp monitors.tim monitors.xml
    339  xrandr
    340  sudo nvidia-settings
    341  cd .config/
    342  cp monitors.xml monitors.tim
    343  gedit monitors.xml 
    344  cd .config/
    345  gedit monitors.xml
    

    To rerun the 337th command, I just do !337. My new history:

    336  cp monitors.tim monitors.xml
    337  cd .config/
    338  cp monitors.tim monitors.xml
    339  xrandr
    340  sudo nvidia-settings
    341  cd .config/
    342  cp monitors.xml monitors.tim
    343  gedit monitors.xml 
    344  cd .config/
    345  gedit monitors.xml
    346  cd .config/
    
  2. It should work that way.

  3. History isn't designed to be perfectly in order - just remember everything. But if you would have two terminal windows open, exit the newer and then still stay in the older, the older one will then have the "history" of the newer but "before" the "history" of the current terminal.

1
  • Now it's worthy of an upvote! ;-) Still no clue on how to get your dual cards working though... :-(
    – Fabby
    Feb 19, 2015 at 11:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .