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

0
votes
1answer
261 views

less with color and locale

Using cygwin I've a problem in less: I can't see colors (for example using grep --color) and I can't set the locale I'm using (LC_ALL=C). I type this command: echo òùàòùàòà | grep --color àò | sort ...
0
votes
1answer
78 views

Hard Drive space not available when switching from Linux install back to Windows

About 6 months ago, I installed Ubuntu on my desktop onto a 2TB harddrive. After a while, I decided I would rather switch back to Windows. So I took my Win7 installation disk, popped it in and started ...
0
votes
1answer
149 views

Enable wheel in mintty for cygwin comands: less and man

I'm using mintty and cygwin. How to can I enable the mouse wheel inside less and man?
0
votes
2answers
69 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 ...
1
vote
4answers
1k views

less emulate a TTY to preserve piped color output

When you pipe something through less, the program usually discards color codes because it's not outputting to a TTY. So you have to add --color=always to the options for it to work. ls -l ...
1
vote
1answer
145 views

vim -R /dev/random

I am on the verge of doing alias less='vim -R' for the convenience of being able to scroll with my multitouchpad. However, I like that less -f can view even files like /dev/random that are not ...
0
votes
3answers
1k views

“less” (linux) get/go-to X offset in file

I open a big file with this command: less +G /var/log/blah/file.log Now when I find the desired info I'd like to know its exact offset in this file, so later I can open that file again and return to ...
8
votes
1answer
1k views

How do i get the git pager to act normal?! Less leaves output on the screen when executed via git

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 ...
3
votes
6answers
873 views

Linux less behavior and stderr

I'm watching the output of my complicated command with less, problem is the stderr gets lost. stderr lines normally get listed inbetween stdout lines inside less. I would like them to be printed to ...
0
votes
2answers
204 views

How can I make Unix Less wrap long columns?

I need to view a large tab delimited file using less. There is a column with ~200 characters which I am not interested in seeing but that column pushes all other columns to right making the viewing ...
0
votes
0answers
92 views

mutt colorizing piped messages

Viewing messages in mutt are colorized, but piping them through the less pager removes colorization. How do I preserve message colorization? I've tried: | less -R but colorization is stripped ...
7
votes
1answer
656 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
1answer
375 views

Avoiding newlines when copying wrapped text in Terminal.app

I have text files with lines that of length greater than my terminal width. I generally use less to view these files and often want to copy something that wraps from one line to the next. I've found ...
3
votes
4answers
2k 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
2answers
148 views

Can I display a text file in multiple vertical panes?

I've got a text file with lots of 60 character long lines where I do a search with the "/" command to highlight the hits. I would like to visually inspect this long file with the highlighted text but ...
8
votes
1answer
2k views

How to make mouse wheel scroll the less pager using bash and gnome-terminal?

I have two computers with the latest Fedora. On the first, I'm using zsh and the mouse wheel can be used with the less pager within gnome-terminal to scroll the pager. On the second, I use bash and ...
38
votes
3answers
11k 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 ...
2
votes
1answer
541 views

'less' doesn't clear screen after quit

The default behavior for 'less' is to clear the screen after quitting. This behavior stopped when I started using: export TERM=xterm Now 'less' leaves the last page I viewed on the screen, and I ...
6
votes
3answers
1k views

How do you search for tabs in the linux command less?

How do you search for tabs in the linux command less? I've tried /\t but that only seems to search for the character t.
23
votes
4answers
4k 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 ...
0
votes
1answer
625 views

Best method for CoffeeScript / LESS autocompilation?

I've been using LESS and CoffeeScript substantially lately, and wondering what would be the best method of monitoring. Currently I use LESS.app, which works great, but I don't think there's a solution ...
106
votes
3answers
24k 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 ...
0
votes
1answer
200 views

Preventing the pager less from exiting when scrolling beyond the end of file

I like less and use it as my default pager in Linux. However, there are times that I am scrolling down through a large document quickly and less exits when I reach the end of the document before I ...
1
vote
1answer
34 views

Can I tell less to read in a whole stream?

Related to this question: How can I get file information in 'less' like with 'man'? Is there a way to ask less to suck in a whole stream to EOF (or at least to some size limit) so ...
4
votes
1answer
205 views

Less hotkeys not working, printing keycodes instead performing action

When I try something like php -i | less Less is not responding to hotkeys, but prints them like pressing "q" results in statusline :q PageDown :^[[6~ Pressing ENTER like "executes" the ...
5
votes
1answer
213 views

How to center search results in Less, instead of moving matched line to top of terminal

When searching for terms in less, I'd like to see lines above and below a search result. Can less be configured to do this? Simple less usage is: - Open file - Search by typing "/" - Move to new ...
3
votes
2answers
498 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, ...
4
votes
2answers
354 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' ...
8
votes
1answer
1k views

How do I include newlines in a search in less?

How can I search for newlines (or end of lines) as part of a search using less? For example, I'd like to search for length=9\n, but don't want to merely search for length==9 because that'd get ...
4
votes
2answers
5k views

LESS and CSS3 syntax highlighting

I found this post on SU, but it doesn't seem to address my needs exactly, so I'll ask a similar question. I normally use PSPad, and I'm also not too scared of Notepad++. They are both good editors, ...
4
votes
2answers
291 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 ...
6
votes
2answers
688 views

In Unix “less”, can I jump to the next line that does NOT contain X?

In the Unix less tool, is it possible to jump to the next line that does not contain a certain expression? I sometimes have to look through files that contain thousands of similar adjacent lines ...
0
votes
2answers
472 views

pipe a program into less

I'm taking the dive into setting up and learning git and at the same time learning bash. I'm trying to do something simple as view the help section of $ git config unfortunately, when I type that ...
2
votes
1answer
491 views

less tail mode + pipes?

Why doesn't less's tail/scroll mode work with pipes? For example, I'd like to make a build script pipe to less in order to make the output of the build script scrollable. So... make | less +F ...
7
votes
1answer
262 views

Getting LESS to return back to command line if a short file is displayed

Is there a command line option that will allow less to return to the command line if there are not sufficient lines in the file to warrant paging. Sure I have seen it in the past but can't find the ...
4
votes
4answers
1k views

Change less (pager) default options

I'm using Ubuntu 10.04. My default pager(set using update-alternatives, not $PAGER) is less. The problem is, when I use ri(Ruby documentation tool) with the '-f ansi' mode, less shows the escape ...
3
votes
4answers
4k 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+$", ...
1
vote
7answers
290 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 ...
1
vote
3answers
2k views

Use `less` pager on file with non-standard encoding

I often use the less pager to view logfiles. Usually I use less -F to follow the progress of the log à la tail. However, some logfiles use national characters in a non-standard encoding (Latin-1, ...
1
vote
1answer
247 views

less -Sr colourful.log How to view colourful log in less?

Both less -r (preserve terminal control sequences) and less -S (chop long lines) work well alone. But using them together breaks things. It chops too late and it wrecks the next line. Reducing ...
0
votes
1answer
586 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?
5
votes
1answer
2k views

Using screen, commands like less and man don't clear the screen afterwards

In contrast to this question I want the clearing of the screen re-enabled for less. It works fine in my xterm terminal under Cygwin/mintty or Gnome Terminal (both xterms). However, when inside a ...
19
votes
6answers
4k views

Mercurial. Colour output piped to less

Operating system: Mac OS 10.6.2 I'd like to be able to see colour output when piping certain commands through less. Two examples: I've got ls aliased to ls --color=auto, so I'd like to be able to ...
75
votes
10answers
33k 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?
0
votes
2answers
214 views

Getting less to stop highlighting non-ascii characters

I have some logs which I want to read in less. Unfortunately, scattered throughout the otherwise text file are some non-ascii characters that less displays as highlighted junk. This is really ...
4
votes
3answers
497 views

Incremental searching with the `less` utility

Does less have an incremental search? I'm on xubuntu.
3
votes
1answer
286 views

Tailing multiple files with less

I want to have the best of both worlds with tail and less. Following multiple files, like tail can, but also having the scrollable buffer of less. So, I tried: tail -f mylog1 mylog2 | less +F But ...
28
votes
1answer
17k views

Less: Quickly Jump to Line Number in Large File

I'm struggling to figure out a way to do this...I'm using less to view a large (~1GB) file. I want to jump to line "$n" in the file - preferably without having to wait for lines 1-($n-1) to scroll by ...
2
votes
4answers
593 views

Unix command to empty logfile from within “less”?

I prefer using "less" to reading logfiles. As opposed to "tail -f" I can both follow (Shift + F), stop (Ctrl + C), and navigate up and down u and d, etc. Now what I really would like is the ability ...
10
votes
2answers
3k views

Mouse wheel scrolling in less and vim using urxvt

I have started working with rxvt-unicode (aka urxvt) but found an issue with mouse-wheel scrolling, as compared to gnome-terminal and konsole. The mouse wheel works fine for going through the ...