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
1
vote
1 answer

less '+&pattern' in cygwin

I am trying to use less (in cygwin) with an initial command of &pattern: printf 'A\nB\n' | less '+&B' Give me the text "&/B" at the topleft of my screen, and I have to press ENTER to do the actual filtering. I was expecting it to do the filtering…
1
vote
2 answers

Terminal width IOCTL when piped to less

I have this program which uses ioctl(file_descriptor_of_stdout, TIOCGWINSZ, &w); to get the terminal width (used in printing arrays). This works fine if I run my program directly on a terminal; however, I often pipe output through less, for paging…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
1 answer

Boolean operators while searching in Less?

I'm reading file using Less. I need to search for some text, but I would like to exclude some other text. Is it possible to build expressions like /someText OR another text or its not supported ?
jmt
  • 719
  • 1
  • 9
  • 28
1
vote
1 answer

scrolling shortcuts in Cygwin terminal less output

What keyboard shortcuts can I use to scroll up and down in an output that has been piped to less in the Cygwin terminal application? I like being able to scroll in less using 'Shift'+'PgUp/PgDn', but when working with a large piped output today, I…
1
vote
2 answers

Ant exec command argument dealing with multiple files

I am using ant exec command to implement the less utility to view the source code of a bunch of .java files. (I know that there are other ways to do this like using concat) So the call ant view works if I specify only one file:
PTN
  • 1,658
  • 5
  • 24
  • 54
1
vote
2 answers

Why is it that we can redirect the input of 'less' command, but we can't run less without any arguments?

as far as i learned in programming, when i want to add the input redirection to my program, i write my program as when it executed, it waits for the user's input (with std::cin or something similar). but i got confused by less command. We all know…
Shnd
  • 1,846
  • 19
  • 35
1
vote
1 answer

How to exit automatically at end of file on vim?

I tried vim/less.sh as pager with syntax highlighting, but there is a little issue: when displaying small file, vim uses 'full screen' and waits for a command from user. Can I let vim to act like a less --quit-at-eof? In other words, is there a way…
Victor Istomin
  • 1,107
  • 8
  • 14
1
vote
1 answer

Python Fabric: executing interactive program such as less on remote?

When I execute something like: run('less ') Within fabric, it prepends the lines with Out: and interacting with it doesn't work as expected. If I run it with: run('cat ', pty=False) The output isn't prepended with anything and…
stgtscc
  • 970
  • 1
  • 7
  • 19
1
vote
2 answers

How can I display out-of-range ascii characters?

I'm connected to a Linux machine using PuTTY. On the Linux machine, I'm running a python script that takes a list of characters and prints each character, together with its index, in order. Some of the characters in my list fall outside the range of…
BitPusher16
  • 235
  • 2
  • 12
1
vote
1 answer

use zsh's built in pager instead of less

Suppose I've got a giant command echo "start string `complexcommand -with -many args | cut -d ' ' -moreargs | sed 's/you/get/g' | grep -v "the idea" | xargs echo` ending string" | program | less -S It produces output of several hundred lines of…
Steven Lu
  • 41,389
  • 58
  • 210
  • 364
1
vote
3 answers

PHP run linux "less" command via exec - binary file warning

I have to convert some PDF files to TXT. I end up with "less" command, because for example pdftotext has some problems with tables in PDF. The problem is that when I ran the command from exec function (or shell_exec/system), less just showing me…
David Kudera
  • 806
  • 2
  • 8
  • 14
1
vote
3 answers

Search in Man page for words at the beginning of line

For me, it happens a lot when I want to search for an specific option in man page. I know that options are at the beginning of lines, but don't know how to limit the search. I've tried /^REG-PATT, but it didn't work for me. What is the shortest…
Rsh
  • 7,214
  • 5
  • 36
  • 45
1
vote
1 answer

R unix terminal pager

I'm using R on OS X 10.6 and I prefer the unix console to the R.app for my work. If I issue a help command eg ?print the help content opens through a pager (i tried most and less), which however then hides out the content if I exit it bringing me…
nikola
  • 5,286
  • 3
  • 22
  • 19
1
vote
2 answers

Word Unexpected (expecting ")") with Makefile

I'm making a makefile and I'm working on a target with no dependencies that checks to see if a file named README exists in the current directory and if it does, read it using less or else exit quitely: give no errors whatsoever--the command to run…
Wuzseen
  • 687
  • 3
  • 14
  • 20
0
votes
1 answer

Bash piping issue

I need to execute the following grep query as an argument for konsole (the kde terminal) grep -R -i -n -A 2 -B 2 --color=always -R "searchtext" * | less -R works for the current terminal. konsole --workdir `pwd` -e grep -R -i -n -A 2 -B 2…
Joel G Mathew
  • 7,561
  • 15
  • 54
  • 86