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
0
votes
0 answers

How less command shows output on stdout

I tried less command to view files in a zip file and to my surprise when I was done with the output, all my previous screen data was still present (which is not the case if i use more command for viewing a file content). how does less command able…
ArigatoManga
  • 594
  • 5
  • 23
0
votes
1 answer

how to go to the first matched row when using less

i am using less to do a log analysis, after i search for some string, there are a lot of match, and then i use n or N to go through the matched lines, but sometimes i want to go the the first matched line or the last matched line, how to go there…
tonyibm
  • 581
  • 2
  • 8
  • 24
0
votes
1 answer

mouse select copy from "vim" and "less" show different results

Case1: Open file1 in vi. Select a few lines(select copy is enabled). Paste in a different place. Case 2: run the command less file1. From the console, select some lines. Paste in a different place. In case2, I see that there are new lines introduced…
NKL
  • 13
  • 1
  • 4
0
votes
1 answer

Is it possible to pipe Xamarin output into less on Mac?

I'm running C# scripts from Xamarin on my MacbookPro and it opens Console Apps in the Terminal. My output is huge and I'm wondering if I can pipe the output from Xamarin into less so I can use less as a pager. Or, is there maybe a way to execute a…
JacobIRR
  • 8,545
  • 8
  • 39
  • 68
0
votes
1 answer

Linux: How to finish/interrupt the `less` command in "&" mode

Using Linux I want to know how to go back to normal file view with less whenever I used the & format in the less to search for only the lines with the pattern I am looking for. I know that I can typeq or ^z BUT these terminate the less.…
Daniel
  • 1,202
  • 2
  • 16
  • 25
0
votes
1 answer

Python Fabric prompts: weird behaviour with 'less' and raw_input

I have a fabric task that looks like this: @task def test(): with settings(prompts={'This is a test.': 'q', 'question?':'answer'}): run("python test.py") my test.py script looks like this: import subprocess, os subprocess.call(['less',…
0
votes
1 answer

For zless to read empty gz file

I have tried to use zless to read (.gz) files. zless $1.txt.gz However, when (.gz) file is empty, it shows a message "$1.txt.gz" may be a binary file. See it anyway? How to force zless to read an empty gz file without typing Y for many…
user3631848
  • 433
  • 1
  • 6
  • 14
0
votes
0 answers

/usr/bin/less from zsh 5.0.2

I wonder if this is only my case that when I use less 458 (POSIX regular expressions), ~/.zshenv is read. Because I use pyenv and python is in a directory of pyenv (PATH is set in ~/.zshrc), less does not work. The error message is 'no python is…
kensuke1984
  • 949
  • 1
  • 11
  • 21
0
votes
1 answer

shell: how to pagination file with code highlight?

I was checking that you can highlight code with pygmentize like: pygmentize -g mycodefile but for large files, I would like the ability to paginate the files like with less or more, but when I try: pygmentize -g mycodefile | less The output is not…
eLRuLL
  • 18,488
  • 9
  • 73
  • 99
0
votes
1 answer

How does launching `less` differ from launching `cat` in ZSH with regards to the usage of alternate screen and background suspension

On my OS, by default, ZSH has the -tostop (or is the tty?). This allows backgrounded processes to output to the shell when they have output. Hence: > stty -tostop > echo 'random' >/tmp/random > cat /tmp/random & [1] 7588 random [1] + 7588 done …
CMCDragonkai
  • 6,222
  • 12
  • 56
  • 98
0
votes
1 answer

Read hex data into less

I want to give a big data file to less -s -M +Gg such that read current given data in less -s -M +Gg. While-loop example (see ntc2's answer) Less command explained here. Replacing the yes by a binary file which is converted to binary ascii and…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
0
votes
1 answer

Subprocess very slow when calling external egrep and less

I'm trying to build a python script that will allow me dynamic build up on egrep -v attributes and pipe the output into less (or more). The reason why I want to use external egrep+less is because files that I am processing are very large text files…
0
votes
1 answer

"less" consumes lots of RAM for a piped output on gzipped file, why?

Excuse me for useless cat and echo upfront, but while running less on a ~2GB .gz file I'm seeing ~25GB of RAM getting consumed (despite the output being piped into awk and consumed there): [user@mybox:~]$ cat <(echo…
Vlad
  • 1,157
  • 8
  • 15
0
votes
1 answer

Using R to browse R output

When I display an object in R (in the standard command line interface), and the object is very long, R cuts it with the message [ reached getOption("max.print") -- omitted 538 rows ] but still manages to clutter my terminal. For me, the desired…
January
  • 16,320
  • 6
  • 52
  • 74
0
votes
1 answer

Restrict the output using the perl debugger

I'm using the perl debugger to analyze a large hash. However, when I display it (with x) it fills up the display and I can't see the start of the hash. Is there a way to pipe the output through something similar to less?
user623990
1 2 3
9
10