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

Adding additional newline between each line

I am analyzing log files from my server(particular few lines from there). But those lines are having around 1000 to 2000 characters in length. Here is an example how the lines are coming out with grep and less with following command. tail -n 1000…
Sabuj Hassan
  • 38,281
  • 14
  • 75
  • 85
3
votes
1 answer

Sending Perl formatted output to less

I have defined a format like this: # header format format STDOUT_TOP = pid ppid start_addr uid gid state vsz rss name -------------------------------------------------------------------------- . # data format format STDOUT =…
Hunter McMillen
  • 59,865
  • 24
  • 119
  • 170
3
votes
1 answer

How to make less output persistent on the terminal, after quitting less?

On my old system (Linux Mint 18.3), every time I used the less command and quitted (q), the last viewed page of less remained on the terminal (bash) view On my new system (Min 19.3), when I quit 'less', everything fades, as if less was never opened…
Luis de Arquer
  • 377
  • 2
  • 8
3
votes
4 answers

Using grep or other command to return the line number of a multiline pattern

I was using the less command to browse a very huge text log file (15 GB) and was trying to search for a multiline pattern but after some investigation, less command can only search single line patterns. Is there a way to use grep or other commands…
AlphonseVA
  • 85
  • 1
  • 6
3
votes
1 answer

Git for Windows Bash shell 'less' command displays garbage while displaying formatted text from Git log call

I've installed Git for Windows and am generally pleased with the feature set in the Bash shell it provides. I'm having trouble with an alias that works fine everywhere else I've tried it. The alias: alias gl='git log --graph…
3
votes
1 answer

less-like pager for (swi) prolog

The typical workflow in unix is to use a pipeline of filters ending up with a pager such as less. E.g. (omitting arguments) grep | sed | awk | less Now, one of the typical workflows in the swi-prolog's command line is asking it to give the set of…
Alexander Gorshenev
  • 2,769
  • 18
  • 33
3
votes
2 answers

bash loop with GNU less that refreshes every 2 minutes

I have a linux machine with a data folder and a script that produces a report xlsx spreadsheet file on the ever changing content of the folder where it is being run. I use a xlsx2tsv script to convert it to tsv text which takes less than one second.…
719016
  • 9,922
  • 20
  • 85
  • 158
3
votes
0 answers

Why less command in tmux show output not on beginning?

Usually less command show output from beginning of the page (terminal emulator visible part). But in tmux case it show output in the same place as echo command - not on the top - on the free space. Is it possible to fix it?
Alex Ushakov
  • 2,139
  • 2
  • 11
  • 8
3
votes
1 answer

Make regular text file paged in terminal with less or something like that

I'm looking for the way to be able to edit text file with any text editor and read it split into pages in terminal with tool like less. So is there a way to put an special symbol or directive to tell less continue with following text on next page?
reddot
  • 764
  • 7
  • 15
3
votes
1 answer

Less command odd behaviour

I am trying to create a small tutorial-like script to refresh my bash skills. I have defined a variable DISPLAY_TEXT that has some text and a set of escape characters and colors like so: DISPLAY_TEXT=${WHITE}\n\t \t ==== $HEADER…
Dimitris Fasarakis Hilliard
  • 150,925
  • 31
  • 268
  • 253
3
votes
2 answers

How to find "/*" in LESS?

When I do git diff HEAD^! (to diff changes in the HEAD commit), output is piped to LESS. I need to search the contents of the diff for /* (start of C-style comment). I haven't been able to get this working. I hit the forward-slash key on my keyboard…
void.pointer
  • 24,859
  • 31
  • 132
  • 243
3
votes
2 answers

Alternate program for 'less' linux command/Making 'less' Secure

I want to write an interactive program like 'less' command for Linux. Reason I can't use less in my setup because you can execute shell commands within less prompt '!cmd' which can be a major security risk for any production box. My preferred…
chandank
  • 953
  • 11
  • 24
3
votes
2 answers

lesskey config does not get used by less pager when used with git on OSX

This works fine in Linux so I'm wondering if this is a problem with the version of less that the Mac is running. I have the same ~/.lesskey file set up, lesskey runs successfully in both places, the resulting ~/.less are identical:…
Steven Lu
  • 41,389
  • 58
  • 210
  • 364
3
votes
4 answers

Is it possible to output the contents of more than one stream into separate columns in the terminal?

For work, I occasionally need to monitor the output logs of services I create. These logs are short lived, and contain a lot of information that I don't necessarily need. Up until this point I've been watching them using: grep * | less where…
AdamSpurgin
  • 951
  • 2
  • 8
  • 28
2
votes
1 answer

How to remove double quotes(") and new lines in between ," and ", in a unix file

I am getting a comma delimited file with double quotes to string and date fields. we are getting " and new line feeds in string columns like below. "1234","asdf","with"doublequotes","new line feed","withmultiple""doublequotes" want output…
vishnu
  • 21
  • 1
1 2
3
9 10