Friday, May 3, 2024
15
rated 0 times [  15] [ 0]  / answers: 1 / hits: 7161  / 3 Years ago, wed, july 7, 2021, 5:15:01

Within a terminal, when you press up in your keyboard, you get to see the past commands you have given to it before in order. I was wondering if there was a way to see only the commands in the past starting with -for instance, "ls -l". That way, if the list of commands is:




  1. ls -l -a

  2. cmake

  3. cd ~/Desktop

  4. cmake



A way to just write "ls" and tab or whatever combination of key-strokes needed to pop up the past command giving in to the terminal starting with "ls"



Thanks,


More From » command-line

 Answers
7

It won't show things only starting with ls, but you can do Ctrl-R ls to do a backwards search through history. Repeat Ctrl-R to find the next match.


[#40134] Wednesday, July 7, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bearous

Total Points: 226
Total Questions: 116
Total Answers: 136

Location: Guernsey
Member since Sun, Jan 10, 2021
3 Years ago
;