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
59
questions
0
votes
0
answers
17
views
navigate or jump between laravel error logs with less command?
I use less command to navigate laravel error log files, I usually do it like this:
less laravel.log
and then
Shift + Alt + G
to navigate using up and down keys, the thing is this is not very handy ...
0
votes
0
answers
46
views
How can I save my reading postion in the "less" terminal app?
just trying to learn what I can and cannot do with this application if this is not possible are there any terminal reading apps that will allow such a thing? or maybe a script that can help?
1
vote
1
answer
135
views
How to set Vi key bindings for man pages
How can I set J/K keys to go up and down in manpages?
In less the keys work, but for some reason, manpages have configured J to be used for go to line. So when I accidentally press J, I am always ...
0
votes
0
answers
218
views
Which compression types are supported by zless?
I just learned about the amazing zless command which allows me to write zless file.txt.gz instead of the more verbose gunzip -c file.txt.gz | less - in fact less is often configured to do this ...
0
votes
2
answers
145
views
How can I ask the system which kind of regex less is using?
In every Unix like OS for the utility less, I cannot figure out which kind of regular expressions is to be used .in reality. The manual says only "as recognized by the regular expression library ...
0
votes
0
answers
65
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 ...
2
votes
1
answer
493
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 ...
0
votes
0
answers
39
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 ...
6
votes
1
answer
232
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 %...
0
votes
0
answers
91
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 ...
2
votes
1
answer
2k
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. ...
1
vote
1
answer
127
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 ...
3
votes
1
answer
351
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
0
votes
0
answers
243
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.
...
1
vote
0
answers
197
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
1
vote
1
answer
673
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 '...
0
votes
0
answers
28
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?
0
votes
1
answer
242
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.
48
votes
3
answers
29k
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
14
votes
3
answers
15k
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 ...
3
votes
2
answers
441
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 ...
8
votes
1
answer
3k
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 ...
0
votes
1
answer
83
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 ...
0
votes
1
answer
144
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 ...
3
votes
1
answer
2k
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 ...
1
vote
1
answer
1k
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 ...
2
votes
1
answer
428
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 ...
4
votes
1
answer
738
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 ...
9
votes
1
answer
821
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 ...
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 ...
1
vote
1
answer
747
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 ...
14
votes
5
answers
9k
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.
1
vote
0
answers
75
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 ...
17
votes
3
answers
7k
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 ...
11
votes
1
answer
2k
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:
...
0
votes
0
answers
28
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 ...
3
votes
1
answer
543
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 ...
2
votes
2
answers
314
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 ...
8
votes
3
answers
2k
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 ...
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.
18
votes
1
answer
9k
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?
2
votes
0
answers
47
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 ...
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 ...
10
votes
3
answers
27k
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 ...
28
votes
2
answers
19k
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.
4
votes
2
answers
569
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 ...
1
vote
2
answers
463
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
...
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?
1
vote
1
answer
809
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 ...
0
votes
2
answers
71
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 ...