Questions tagged [less]

less is a terminal pager program used to view (but not change) the contents of a text file one screen at a time. Questions regarding the use of less in Ubuntu should go by this tag

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

Opening a file with "less" causes notify-send to send a message

In my development environment, we have some helper scripts that wrap certain commands (like maven or docker), and then use notify-send to send a notification if the commands fail. After running a ...
user avatar
2 votes
1 answer
64 views

Arrow keys and | less

I'm new to Ubuntu and I was playing around in the terminal. Not sure what I stumbled into with two things: I'm in /bin and when I type the command dir | less it displays the content in two ...
user avatar
0 votes
0 answers
22 views

Console File Viewer which shows byte position numbers

I have a large data-file with record length 800 bytes. It is to big to open it in gui-texteditors, but less and grep is working fine. But I need to see fast which number is in the records on position ...
user avatar
  • 209
5 votes
1 answer
79 views

Why does "less" accept an empty filename, and show some environment variables?

I accidentally ran less with an empty filename, which I expected to fail, but to my surprise, it printed some environment variables: $ less -XE "" export LESSOPEN="| /usr/bin/lesspipe %...
user avatar
  • 13.4k
0 votes
0 answers
43 views

Why can't I search with slash in the terminal?

After opening any man page and pressing / there is no reaction from man. Although if I open files with vim everything works fine and I can search through them. $ uname -v #47~20.04.2-Ubuntu SMP Mon ...
user avatar
2 votes
1 answer
931 views

Black window with "less", "nano", or "screen" - WSL - Ubuntu 20.04.3 LTS

I'm using Windows Subsystem Linux with Ubuntu 20.04.3 LTS on my laptop (OS: Windows 10 Enterprise LTSC). It worked flawlessly until a few days ago when I suddenly could not use less, nano, screen etc. ...
user avatar
  • 123
0 votes
0 answers
80 views

How may i get less to do case insensitive filename completion?

How may i make filename completion in less case insensitive? My INPUTRC environment variable specified file contains set completion-ignore-case on and this works as desired in bash, but not in less. ...
user avatar
1 vote
1 answer
35 views

less not displaying coloured output in konsole

I know that the -r or -R switch on the less command is used to show coloured output, but it only seems to work with the --color=always flag on the command that is generating the output, but not all ...
user avatar
2 votes
1 answer
144 views

How to “cat” or “less” a libreoffice impress .odp file?

Is there any way to cat or less a .odp file just like we have for .odt files as mentioned here
user avatar
0 votes
0 answers
78 views

Trouble Using the less command

When I use the less command in order to view a textfile in a directory, it keeps on returning that the file is a directory. Also tried using the cat command and also get the same result every time. ...
user avatar
0 votes
0 answers
130 views

Unable to view text files on putty using the less command

After invoking the less command in putty,it keeps on returning that the text file is a directory without showing the text in the directory. Actual command: less file_name ls -l gives -rw-r--r-- l
user avatar
1 vote
1 answer
226 views

How do I automatically exit a bash script that ends with a less

How can I send a keystroke like 'q' to a script that ends with a call to less? test.sh ls -l | less If I call test.sh it hangs and waits for the user type 'q'. How can I do something like this: echo '...
user avatar
  • 111
0 votes
0 answers
20 views

xfce4-terminal less sign to start less

In zsh on macOS if I want to see a text file I can use: < file.txt. Is the same thing possible in xfce4-terminal?
user avatar
  • 1
0 votes
1 answer
190 views

Two different terminal line commands - the same result

What is the difference between less file-name and cat file-name | less For example: less .bashrc and cat .bashrc | less output the same result.
user avatar
  • 1,725
38 votes
3 answers
13k views

What is the difference between "more" and "less" commands?

What is the difference between the two commands below? more file-name less file-name
user avatar
  • 1,725
14 votes
3 answers
9k views

After viewing logs with journalctl, how do I exit the screen that says "lines 1-2/2 (END)"?

When you use the command journalctl -p err -b for example, you get an answer that ends with "END". What command do I use to end this and get the opportunity to enter the next command without having to ...
user avatar
  • 201
2 votes
2 answers
320 views

Different behavior of unset vs. empty LESS environment variable?

I wanted to change the default behavior of the less command, so I added the following to ~/.profile: LESS="$LESS -x4" export LESS However, the mere presence of a set LESS environment variable seems ...
user avatar
  • 717
8 votes
1 answer
2k views

Which package contains /usr/bin/less for Ubuntu 19.04?

As in the title. Neither dpkg -S /usr/bin/less nor apt-file search /usr/bin/less produces anything useful. Does it mean that there's a bug or that less really doesn't come from any package? (In case ...
user avatar
0 votes
1 answer
53 views

less x.deb - what's wrong with it?

I've tried to strace a program and send the strace's output to a file x.deb. After opening x.deb I've seen this: x.deb: *** Contents: x.deb (END) I thought it is a bug in strace, because if I used ...
user avatar
  • 3
0 votes
1 answer
85 views

Stop following and allow scrolling

less +F can be used to "tail" follow an input stream. I can't find a way to disable this mode and resume manual scrolling. From man:less... F Scroll forward, and keep trying to read when the ...
user avatar
3 votes
1 answer
1k views

less calls nano instead of vi

In the default configuration of Ubuntu 18 LTS server, pressing the V key in less calls the nano editor instead of vi while none of the environment variables $LESSEDIT, $VISUAL or $EDITOR are set. I ...
user avatar
  • 383
1 vote
1 answer
936 views

Count Lines Viewed from command 'less'

I run command less ls /usr/bin | less got many lines of directories. 2to3- 2to3-2.7 AssetCacheLocatorUtil AssetCacheManagerUtil AssetCacheTetheratorUtil BuildStrings CpMac ... How to enumerate ...
user avatar
  • 2,491
2 votes
1 answer
183 views

less goto line requires me to type ':' twice

Here is the behaviour im seeing: http://www.giphy.com/gifs/MWuSbME041h8cmDqer A short description is that when i type man bash | less, i need to type ::100 instead of :100 in order to move to ...
user avatar
4 votes
1 answer
596 views

No output from some paginated commands (man, git log)

Something has gone wrong with both the man and git log commands on my Ubuntu system over the holidays. Neither produce any output, and I have no clues as to what the issue is, bar that they both ...
user avatar
  • 143
8 votes
1 answer
504 views

How does "less" switch to the text, then back to the prompt?

When I run less on some file, the prompt goes away, and I get the contents of the file on screen. Then when I press q, it goes back to the prompt. I think less does this by saving the current terminal ...
user avatar
  • 13.4k
9 votes
3 answers
3k views

EDITOR environment variable changes after reboot

While running the less command, pressing v opens the file inside the editor. I have set the EDITOR environment variable to vi by running the command export EDITOR=vi. It works perfectly fine as ...
user avatar
  • 1,039
1 vote
1 answer
529 views

less command option % is not working - no such file or directory

I successfully opened a file with less command. Then I typed ! for shell command. In the shell I typed du -h %. % is supposed to be the file name to the shell. However it is not working. Shell replies ...
user avatar
  • 1,039
13 votes
5 answers
6k views

View files without lines with certain string

Searching for a program like tail or less which let me view my logs without lines that contain a certain string. For example view my syslog without UFW ([UFW BLOCK]) entry lines.
user avatar
  • 133
1 vote
0 answers
72 views

How do I combine the 'less' and 'head' comands?

I am attempting to preview a PDF in the terminal on Ubuntu 17.04. I can view the PDF clearly using the 'less' command, but it shows the entire file. If I use the 'head' command, I get the first 10 ...
user avatar
15 votes
3 answers
6k views

How can I stop following output in less, without affecting the command generating the output?

I am running a server and the log of this server gets logged in terminal, not in any file. I would like to use less to view this log. node server.js | less When I just want to see the log, I use ...
user avatar
9 votes
1 answer
1k views

man pages - How to always show total lines and percentage in the bottom status / prompt line

I want to always see the total lines and % part ( line 1/773 0% ) in the bottom status / prompt for man pages immediately upon viewing one. When I open any man page I see this in the bottom line: ...
user avatar
  • 8,250
0 votes
0 answers
25 views

less -z4 command's display

I am trying to use the less -z4 /var/log/syslog command to display 4 lines by 4 of the syslog file .However, it displays multiple lines. I am wondering what happens? and if we can use other option ...
user avatar
3 votes
1 answer
433 views

colors of bold section in man pages

After upgrade to 16.04 I hit the issue with colors of some sections in man pages e.g. color of bold is black and when I read man pages in terminal with black background there is no possibility to see ...
user avatar
2 votes
2 answers
236 views

Gnome terminal, `less` opens file at the cursor position, not at the top of terminal

If I try to open a file with less, its content starts from the cursor position, not from top of the screen. . This happens only in gnome-terminal, for example in Terminator everything is ok. How ...
user avatar
6 votes
2 answers
1k views

View text in terminal with specific patterns highlighted

I want to view text (could be a file or a piped command output) in the terminal, but I would like to highlight a specific pattern in the text with colors, similarly to how grep highlights the pattern ...
user avatar
  • 100k
6 votes
1 answer
2k views

How can I build a scrollable, colored syslog viewer with less, ccze, grep?

I'd like to view logfiles with colored output, scrollable and searchable. How do I do that? I tried less /var/log/syslog | ccze | grep error, but it is not scrollable.
user avatar
  • 383
15 votes
1 answer
7k views

Why do vim and less have such similar keybindings?

Do they share code, or is that just a tradition? Are there any other programs with similar keybindings?
user avatar
2 votes
0 answers
46 views

line width too long

I am using laravel and running php artisan route:list and when i press enter the output is a grid of columns representing the name of the route, the uri, the action, and other columns. But the text ...
user avatar
3 votes
4 answers
3k views

Is there a way to read characters backwards from the end of a file in the terminal?

For instance, less allows you to read line by line, starting from the beginning. Is there a similar utility or line that could be run in the terminal that could display a file backward character by ...
user avatar
10 votes
3 answers
24k views

How do i install less css compiler?

I just installed less css compiler using npm. Now thelesscfile directory is /usr/local/bin/lessc . i'm not clear what i need to change in lessc file and how to understand that compiler has been ...
user avatar
27 votes
2 answers
15k views

What is the default PAGER used by man pages?

What is the default PAGER used by man pages. I,e what is the program runs the man pages? It look some like more or less. I'm sure it's not more since more doesn't support reverse backward.
user avatar
  • 78.4k
4 votes
2 answers
260 views

How do I keep the screen contents after quitting less or more?

After exiting from less or more, the screen contents are returned to what they were before. This happens with pagers like less/more, and some other commands. Sometimes it is necessary to keep the ...
user avatar
1 vote
2 answers
453 views

how to use mysql with less and -F

I want to use less as a pager for mysql client. I want to add -F to force quit for short outputs. But I can't combine both correctly. root@jupiter:/# mysql -p -u root -h localhost --pager=less -F ...
user avatar
19 votes
1 answer
1k views

How can I redirect what is shown on Terminal to a file, when using the 'less' command?

How do I redirect the Terminal content (the content that currently I'm looking not the entire file, when using the less command) into a outfile until I press the Q to exit from less?
user avatar
  • 33.5k
1 vote
1 answer
665 views

more or less pager - how to quit [duplicate]

Idiotic question of the day On Ubuntu 12.04 server console, I've run an apt-get update followed by an apt-get upgrade Everything was going swimmingly; when it got to MySQL, it warned me it was about ...
user avatar
0 votes
2 answers
62 views

default behavior of less on .iso files

I use ubuntu 14.04 and have the following problem. Searching this website doesn't turn up anything and neither does google. I work with some data files that have a suffix .iso. These are simple ...
user avatar
  • 3
1 vote
2 answers
457 views

How to get the long 'less' prompt with sudo?

I have added the following to my user's .bashrc file to get a longer prompt in less: export LESS="-M" This is added to the root user's .bashrc file as well, so when I sudo bash to get a root shell, ...
user avatar
  • 622
1 vote
1 answer
863 views

sublime text 2 and less2css issue

On ubuntu 14.04 I have installed Sublime Text 2 and a plugin named less2css. When I try to save, for example MAIN.less, file is saved, but isn't compiled into MAIN.css. Sublime alerted me that usr/bin/...
user avatar
36 votes
2 answers
35k views

How do I make `less` output colors?

When I run a program (for example grep or ls) without a pager, its output is colored. However when I run it piping its output to less, no colors are shown. For example, this command outputs colored ...
user avatar
0 votes
1 answer
121 views

less.vim not working on my Ubuntu 12.04 lts

I found many sites saying that vim can be used as a pager like less with syntax highlighting. So to make it work I added this line to my .bash_aliases file: alias vless='vim -u /usr/share/vim/vim73/...
user avatar