less is a terminal pager program on Unix, Windows, and Unix-like systems used to view (but not change) the contents of a text file one screen at a time.

learn more… | top users | synonyms

-1
votes
1answer
21 views

Which CSS pre processor is better and most used: SASS or LESS?

Before someone may asks, I searched for questions about this but didn't find anything close to that subject. Additionally, if my question is in the wrong place, please let me know and point the ...
5
votes
5answers
7k views

How do you run `less` and have it run a search pattern automatically?

I'm trying to run less in Linux, and I want it to search for something immediately after launch. It's basically like doing this: $ less Then press '/', type a search pattern like "^commit \w+$", ...
0
votes
1answer
26 views

Display Ruler Information in less (cursor position)

Sometimes, if I know I'm not going to do any edits in a window, I use less instead of vi. However, vi displays percentage and cursor position in the bottom right corner. Is there a way to mimic this ...
235
votes
4answers
58k views

How to turn off word-wrap in less

Short version: How can I make the less utility in Linux not wrap lines? Long version: Often I need to view huge CSV files using less with hundreds of columns. I frequently only care about the first ...
1
vote
3answers
847 views

Scroll “less” output using scroll wheel on Mac OS X

How can I enable the scrolling of "less" output (rather than the terminal window itself) using the scroll wheel on OSX?
0
votes
1answer
27 views

Scrolling down while selecting text in PuTTY

Is there anyway we can copy large amount of text to Windows clipboard from file opened through less command? While it's easy to select text that is appearing on the screen, but how to continue ...
2
votes
3answers
375 views

How to use my vim configuration in less?

Quite some programs have commands that output with less(e.g. git blame filename). I would like to use my vim configuration(e.g. <C-j> instead of using Pg Down to go down a page) whenever less is ...
1
vote
1answer
61 views

How can I switch line-wrapping on and off from within less

I know I can run less -S and avoid long line wrapping. But can I switch wrapping on and off from within less?
1
vote
2answers
1k views

cygwin > xterm > bash > less : MouseWheel scrolling not working

I am trying to get mousewheel scrolling to work in less, within an xterm in cygwin with XMing x-server and fvwm window manager ! I hope I make sense.. I have tried rxvt, urxvt, urxvt-X, aterm, mrxvt ...
0
votes
2answers
31 views

Watching logs with less +F freezes after a while

less +F is a great command for watching logs, but it has very annoying issue. After a while it stops updating log file and requires restart. Is there any way to make it follow file forever?
59
votes
6answers
13k views

How can I save the current contents of less to a file?

If I've piped the results of a command to less and then decided that I want to save the contents to a file, is this possible? I've tried setting a mark a at the end of the buffer, and then returning ...
1
vote
0answers
22 views

Multi-page output :: text select with tmux over ssh

I have a local terminal within tmux. Now I connect to a remote server via SSH and run some command piped to less. With tmux I can easily select part or the entire screen, however I can not select text ...
3
votes
3answers
131 views

Can less wrap lines like fmt does?

Like most people I use less as my terminal pager. Occasionally I view files consisting of very long lines of plain or marked-up text. By default less folds these lines at the terminal window edge. ...
2
votes
2answers
1k views

unix less - problem with Enter key on numeric keypad

When I use the unix command 'less' I am constantly frustrated that using the Enter key on the numeric keypad doesn't work but instead types 'ESCOM'. Is there a way to fix that?
1
vote
1answer
98 views

How do I set $LESS invocation options in a lesskey file?

I'm trying to use less's lesskey-file support, as described in the manpage: KEY BINDINGS You may define your own less commands by using the program lesskey (1) to create a lesskey file. This ...
1
vote
1answer
123 views

Keep color in less after make and pipe

I would like to keep color in less command after using "make 2>&1" to compile some program. There are similar topics with "grep" and "ls" commands but solutions do not work with this command. For ...
0
votes
1answer
22 views

Dump to terminal or file content of “less” pager utility

It is usual to use less utility as pager (with -r option). But less uses special terminal buffers, so it preserve previous output to terminal and when I leave less I see previous content. That is ...
0
votes
1answer
68 views

Make less use alternate screen, but only if entire file won't fit on one screen

I'd like less to quit immediately if the entire file can be displayed within one screen. For this, I'd use the -F option: -F or --quit-if-one-screen Causes less to automatically exit if the ...
2
votes
1answer
23 views

Various environments and weird less behaviour

I am playing with I/O redirection and have problem with less behaving differently in two environments. Both environments are Solaris-based and are of the same version. I am executing program in two ...
0
votes
0answers
111 views

searching a text file in linux using less

I am searching a very large ( 8+ Gb ) flat text file using less. It appears that less will search the entire file before it moves to the location of the first find. Is that accurate? Is there any ...
0
votes
2answers
51 views

What's the behaviour of `cat | less`?

I tried to run the following command: cat | less I know both commands require something from the standard input. When I run it that's what I expected: all my inputs goes to cat and I will not be ...
2
votes
0answers
43 views

How to get fish-style formatting with less

Let's say I run a command like ls in fish and get lots of output, how do I scroll through it and still keep the fish formatting or something like it? ls | less doesn't keep the formatting. I know ...
20
votes
3answers
26k views

Less or More in Windows?

Is there a command in the Windows DOS prompt that is equivalent to the UNIX less or more? Basically, the problem is that when I type hg log, the output has too many lines to fit on the screen and I ...
0
votes
1answer
1k views

Associate .less files with notepad ++

I just love notepad++ however I'm working with .less files and when I open a .less file it's just a normal text not a language (css) no code highlighting is there a plugin or something to make ...
0
votes
0answers
47 views

How to wrap search when using less +F

I found the less +F is pretty useful for me to quickly switch to search mode to search the file being tailed. Is there any way I could wrap my search to the top of the file? I also tried to use ...
1
vote
1answer
45 views

less with -F option and pattern matching

From a script, I want to invoke less on a file and have it print the output to the console, rather than a new screen. If the file is short enough to fit on one screen, I want to disable scrolling. If ...
2
votes
1answer
206 views

Pipe to less but keep the highlighting

Is it possible to pipe some output (e.g. dmesg) to a command like less (or an equivalent command) and keep the text highlighting used by the original command printing? example: on the left dmesg | ...
52
votes
1answer
3k views

How does less display PDFs?

I have tried several programs: pdftotext, pdf2txt.py, ... All of them can extract text from PDFs, but the one which is doing the better job is good ol' less: the text from the PDF has a proper layout. ...
1
vote
1answer
120 views

combining tail -f with less +F does not work

I am using ubuntu bash. I am trying to combine tail -f and less +F like below and nothing is coming out. tail -f long_running_log | less +F long_running_log is a log file constantly being written ...
3
votes
3answers
745 views

Viewing zip archive contents using 'less' on OS X

I couldn't help but notice that the 'less' program on all of the recent distributions of Linux that I've used (Ubuntu and Gentoo in this case) allow me to view the contents of ZIP and TAR archives, ...
5
votes
3answers
460 views

Let less work like cat, if only one screen full of text

On my Debian machine here, less always opens the alternate screen to show stuff. This is annoying, if there are only 2 or 3 lines to be displayed. I'd like less to: work as pager, if there is more ...
17
votes
1answer
4k views

How do i get the git pager to clean up screen output after exit?

The pager less doesn't clear the screen as it should do when i use git. I use less all the time and it usually doesn't leave output in the terminal after quit but when less gets executed via git it ...
1
vote
8answers
342 views

How can I get file information in 'less' like with 'man'?

When I view a file in Linux with the 'less' command, I often only get a ":" prompt in the bottom left corner. There's no clue about how long the file will be, or at which location I am currently. When ...
18
votes
4answers
1k views

Linux command line log viewer which allows auto tail AND searching?

I use tail -f in my Linux shell, to view log files, as I like how it auto-updates with the incoming text: I like to see the new stuff come scrolling in. However, I also like the search functionality ...
88
votes
12answers
31k views

How to syntax highlight via Less

is there a way to syntax highlight a file I see in Less? actually I'm using this command to open an xml file (and sometimes a series of them) less htmleditors/htmleditors_config.xml or less ...
1
vote
0answers
70 views

Can vim be used to view a growing file?

I often use vim's view for viewing files. Is there a way to use it for a growing file so that I can see the progress as it's happening? Something similar to tail -f or less +F I have two use ...
13
votes
3answers
804 views

How to do a multiline search in less?

In less, can you search using / for a pattern that contains a carriage return and newline? I know your pattern can end with a line using $ (from How do I include newlines in a search in less?), but I ...
188
votes
10answers
84k views

Get colors in 'less'' command

when I read a file in Linux with the command 'less' or 'more', how can I get the content in colors?
51
votes
4answers
19k views

less is more? Is more less? I'm so confused

When I first heard their names, I got really confused when I tried to guess what these tools might do, I thought I'd misheard something. What's the difference between more and less, i.e. why ...
0
votes
0answers
84 views

Why does read's timeout break my console?

I have a script that is causing an issue, I've boiled it down to this; #/bin/bash read -t 1 -p 'Wanna continue?' less +F readTimeout.sh echo 'Wont get printed' The original script operated by ...
0
votes
2answers
82 views

`less` starts `ed`

I can't make less use my favorite editor. To my horror, it starts ed which I've never used and really am not going to. > echo $EDITOR emacsclient > less somefile Pressing v starts ...
8
votes
2answers
1k views

copy and paste tabs between terminal windows in X11

When I copy and paste text using the X11 mouse selection between two terminal windows, tabs are often, but not always, converted to spaces. This appears to depend on the involved terminal ...
1
vote
0answers
131 views

Neither less or less -X clear screen on exit. (Trust me, I googled…)

Neither less or less -X clear screen on exit. At the same time, vim does.... Env iTerm2, protocol mosh, server Centos + tmux + zsh iTerm2: report term as xterm-256color tmux: set -g ...
6
votes
2answers
580 views

on quit, 'less' does NOT clear its contents when run in a 'screen' session [duplicate]

Possible Duplicate: Using screen, commands like less and man don't clear the screen afterwards When I quit 'less' in a normal bash, it clears the previous contents displayed by 'less' ...
3
votes
1answer
1k views

How do I make less open binary files without confirmation?

I have several log files that contain a few bytes which are not displayable characters (due to binary signatures on the requests). Every time I open them with less I get asked: $ less ...
0
votes
1answer
68 views

less maximum buffer size?

I was messing around with my system and found a novel way to use up memory, but it seems that the less command only holds a limited amount of data before stopping/killing the command. To test, run ...
3
votes
1answer
2k views

Less - Select to clipboard

In Less (Linux terminal), I can select lines with the mouse and then use Ctrl+Shift+C to copy to the clipboard. This only works within the displayed part of the terminal. How can I select more text? ...
0
votes
2answers
158 views

How do I view the content of a very large file at position in Linux?

I've got a file containing JSON data that is about 90MB of size and has one line. I need to go to position 99376229. Unfortunately vim and less both crash when I try moving to that column. How can I ...
4
votes
4answers
3k views

LESS syntax highlighting in Geany

I'm using LESS CSS (PHP version). I'm also using Geany in Linux. Is there a LESS syntax file for Geany out there, or how I can go about editing the CSS one to suit LESS?
2
votes
1answer
401 views

Line-wrapping `less` in OS X (specifically for use with 'git diff')

Using less +-S does not work (although it does ask Chop long lines (press RETURN)), and entering -S once inside less also does not work. Is there a solution? I am usig OS X Mavericks (10.9.3). ...