Skip to main content

How to run commands from history bash

In most of the cases we use history command to find forgotten commands

eg:-
$ history | grep brew
output:
  251  brew update
  252  brew outdated
  253  brew search plist
  297  brew services
  463  brew info python
  464  brew list
Say you want to run the last command that is listed. Then you should just run:
$ !464
It will run just fine like you normally type and run
$ brew list


Comments

Popular posts from this blog

session_start(): Failed to initialize storage module: user (path: )

Error: session_start(): Failed to initialize storage module: user (path: ) Solution: When this error is given for the Codeigniter project you are running, that is specifically for not having a path recognised to store session data. Set config data as follows [file: your-project-folder/application/config/config.php] : $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = APPPATH.'cache/'; $config['sess_match_ip'] = TRUE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = FALSE;