Questions tagged [less-unix]

It's a UNIX command to display a file.

Example: less file will display the file file.

See discussion in Meta for the history on why is used for this instead of , which is broadly used for CSS.

139 questions
9
votes
2 answers

To get colors to Less in Ubuntu's Zsh

How can you get similar highlightings to Zsh's Less than Bash's Less in Ubuntu? I switched from OS X to Ubuntu. My Less do not work as expected in Zsh. Manuals in my Less are green and black with or without the following code. # comment these out…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
8
votes
1 answer

Why can't I use "more" command in Git Bash?

"less" command works fine, though. I can use "less" to display part of the file on the screen. Supposedly, there is a "more" command, but when I type it in, it says "bash: more: command not found."
ocras_ren
  • 103
  • 3
  • 6
7
votes
4 answers

How to make git-log scroll up instead of down

Whenever I view a git log --all --graph --oneline --decorate output in my terminal emulator, the first commit is viewed at the top of the terminal screen. When I quit the git log output view with q, a few lines from the are not visible any more, as…
chtenb
  • 14,924
  • 14
  • 78
  • 116
7
votes
2 answers

pipe output from interactive command to less

I'd like to do something like openssl enc -d -aes256 -in somefile | less openssl requires a password from stdin. and this gets all messed up when less is involved. Is there a way to take the output from an interactive command (like openssl asking…
patrick h
  • 71
  • 3
6
votes
1 answer

How do console graphics work? (less, curses, vi...)

Can someone explain to me how less, vi and curses programs manage graphics output? Can they change individual characters on the screen or do they have to literary clear and redraw the screen whenever something changes? It would be really neat if…
futlib
  • 8,258
  • 13
  • 40
  • 55
6
votes
3 answers

How does "less" command get stdin input?

I'm just wondering about this problem: if I can use something like "ls -al | less", less should have the ability of waiting for input from stdin. What I expected to happen is after running "less" command, the program hang up and wait for input(as a…
babel92
  • 767
  • 1
  • 11
  • 21
5
votes
2 answers

How to execute "less" with paging from a Java console application?

I need to execute the less command, with paging, from my Java console application. However, the only method I found to execute external commands is Runtime.getRuntime().exec(), which requires me to write/read input/output via streams. So commands…
futlib
  • 8,258
  • 13
  • 40
  • 55
5
votes
2 answers

xterm keep page from less in terminal after exit

I often view files using less and want to remember what i have just seen in the file. However when I quit less by pressing the q key my xterm window removes the page of less showing the file and only shows my command prompt. How do I keep the less…
Paul
  • 6,572
  • 2
  • 39
  • 51
5
votes
1 answer

`git` and `less` integration in OS X terminal: prevent writing output of `less` to tty

In OS X terminal, when less is called on its own or by other programs like man, its output won't be written to the tty after we quit less. For instance, if we run less README, we would be temporarily directed to a screen with things like SO…
4ae1e1
  • 7,228
  • 8
  • 44
  • 77
4
votes
1 answer

Print with less(1) from C

I would like to print a big matrix of data which I have in a linked list. It doesn't fit into a terminal (80 lines), so it is inconvenient to print it with standard printing functions; and less is already invented, so I wouldn't want to be…
4
votes
4 answers

tail a log file from a specific line number

I know how to tail a text file with a specific number of lines, tail -n50 /this/is/my.log However, how do I make that line count a variable? Let's say I have a large log file which is appended to daily by some program, all lines in the log file…
Molenpad
  • 833
  • 2
  • 14
  • 34
4
votes
1 answer

controlling less with Popen

I'm trying to control less from a Python script on Mac OSX. Basically what I would like is to be able to forward control characters (up/down/left/right) but process other input within the Python program. I'm using Popen to start less, but less reads…
Nate Glenn
  • 6,455
  • 8
  • 52
  • 95
4
votes
3 answers

Don't automatically terminate git diff if changes are on one page

If I run git diff, and my changes are less than one page, the command will automatically exit. This is undesired because this is in a script and I immediately call git commit afterwards. This causes single page changelogs to be missed. My first…
Chris Smith
  • 2,928
  • 4
  • 27
  • 59
4
votes
3 answers

Execute "less" from command-line PHP w/ Scrolling

I want to execute less and similar programs from the command-line in PHP. I have tried the usual suspects (exec, shell_exec, passthru, etc), and while many of them can dump the file to the screen, the process is terminated before I can make use of…
Grayside
  • 4,144
  • 21
  • 25
4
votes
2 answers

psql displaying ansi colored text

My .psqlrc has following options \setenv LESS '-iMSx4 -FXR' \setenv PAGER 'less' \pset pager always and psql output which I want to be colored is { + …
mpapec
  • 50,217
  • 8
  • 67
  • 127
1
2
3
9 10