0

To list dir in my GIT BASH Terminal I use the following command ls -al | less (to show one page at a time).

However upon exiting from the listing using ZZ or Q, the display on the terminal is getting refreshed and I am losing all the content just listed, and I am going back to the command line.

What would be nice is to use CTL-C key combination out of the ls listing at the point where I want it, and to keep that content displayed on the terminal so I can copy the file name or whatever. Any suggestions how to solve this problem? My .bashrc file is pretty minimal and I don't have much going on there. Reproduced here.

alias 'll=ls -al|less' 
PS1="\$PWD:\d\n\$"

Thanks for any pointers.

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
mangoman18
  • 11
  • 3
  • See [my answer here](https://stackoverflow.com/a/54332364/1256452) and also https://stackoverflow.com/q/54451190/1256452, and note that you can set a different pager for each Git sub-command, if you like. – torek Feb 24 '19 at 20:59
  • Thank you very much. That worked very well and your explanation of Alternate screen was very illuminating as well. Appreciate it. – mangoman18 Feb 24 '19 at 22:02
  • Note that an ideal title doesn't just describe the general class of thing you're asking about -- rather, it *asks your specific question* precisely enough that someone else can have a good idea of whether they're having the same problem (and thus whether your question's answers will be helpful to them) just by looking at that title. – Charles Duffy Feb 25 '19 at 02:45
  • (That said, as this is a question about using UNIX tools more than about writing code, [unix.se] is generally more appropriate). – Charles Duffy Feb 25 '19 at 02:47

0 Answers0