Is there a way to append my_computer.sh with the command on line 330 by only referencing the line number? or with the fewest keystrokes possible?

  326  pip install -U pip
  327  man pip
  328  cat >> ~/my_computer.sh 
  329  pip -V
  330  sudo pip install virtualenv
  331  ls
  332  vi .gitignore 
  333  ll
  334  virtualenv ENV
  335  ll
  336  vi .gitignore 
  337  source bin/activate
  338  cd ENV/
  339  source bin/activate
  340  history 

It depends on your shell and the supported features. With bash, e.g., you can type:

!330 my_computer.sh 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.