less-unix

bash loop with GNU less that refreshes every 2 minutes

妖精的绣舞 提交于 2020-01-15 03:58:07
问题 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. The script takes about 1 minute to produce the spreadsheet file and I want to have a terminal screen showing the results of the table in a GNU less buffer, where I can move around with the cursors, and search for content with /search , etc. of the

less-style markdown viewer for UNIX systems

戏子无情 提交于 2019-12-18 09:59:20
问题 I have a Markdown string in JavaScript, and I'd like to display it (with bolding, etc) in a less (or, I suppose, more )-style viewer for the command line. For example, with a string "hello\n" + "_____\n" + "*world*!" I would like to have output pop up with scrollable content that looks like hello world Is this possible, and if so how? 回答1: Pandoc can convert Markdown to groff man pages. This (thanks to nenopera's comment): pandoc -s -f markdown -t man foo.md | man -l - should do the trick.

xterm keep page from less in terminal after exit

二次信任 提交于 2019-12-10 15:10:36
问题 I often view files using less and want to remember what i have just seen in the file. However when I quit less by pressing the q key my xterm window removes the page of less showing the file and only shows my command prompt. How do I keep the less output on my terminal when I quit? 回答1: less -X Use the -X option from the less man page described below: -X or --no-init Disables sending the termcap initialization and deinitialization strings to the terminal. This is sometimes desirable if the

How do you do a case insensitive search using a pattern modifier using less?

萝らか妹 提交于 2019-12-03 01:36:15
问题 It seems like the only way to do this is to pass the -i parameter in when you initially run less. Does anyone know of some secret hack to make something like this work /something to search for/i 回答1: You can also type command -I while less is running. It toggles case sensitivity for searches. 回答2: You can also set the environment variable LESS I use LESS=-Ri , so that I can pump colorized output from grep into it, and maintain the ANSI colour sequences. Another little used feature of less

How do you do a case insensitive search using a pattern modifier using less?

最后都变了- 提交于 2019-12-02 13:53:57
It seems like the only way to do this is to pass the -i parameter in when you initially run less. Does anyone know of some secret hack to make something like this work /something to search for/i Juha Syrjälä You can also type command -I while less is running. It toggles case sensitivity for searches. You can also set the environment variable LESS I use LESS=-Ri , so that I can pump colorized output from grep into it, and maintain the ANSI colour sequences. Another little used feature of less that I found is starting it with +F as an argument (or hitting SHIFT + F while in less). This causes it

How to make Less indicate location in percentage

你说的曾经没有我的故事 提交于 2019-11-30 06:37:05
问题 I now aim to show the percentage sign also when you run, for example, the command man emacs If you run it, you get 'byte 3300' for instance. Alex's answer suggests me that we need to make a separate shell function by man "$1"| col -b > /tmp/manual less /tmp/manual where $1 refers to the first parameter. The new problem is at the thread. Thanks to Yuliy for the crux move! 回答1: Solution A less manual version of knitatoms' answer combined with Alex Marteilli's answer works quite well: pass the

less-style markdown viewer for UNIX systems

独自空忆成欢 提交于 2019-11-29 19:40:24
I have a Markdown string in JavaScript, and I'd like to display it (with bolding, etc) in a less (or, I suppose, more )-style viewer for the command line. For example, with a string "hello\n" + "_____\n" + "*world*!" I would like to have output pop up with scrollable content that looks like hello world Is this possible, and if so how? Pandoc can convert Markdown to groff man pages. This (thanks to nenopera's comment): pandoc -s -f markdown -t man foo.md | man -l - should do the trick. The -s option tells it to generate proper headers and footers. There may be other markdown-to-*roff converters

How to make Less indicate location in percentage

旧巷老猫 提交于 2019-11-28 20:41:10
I now aim to show the percentage sign also when you run, for example, the command man emacs If you run it, you get 'byte 3300' for instance. Alex's answer suggests me that we need to make a separate shell function by man "$1"| col -b > /tmp/manual less /tmp/manual where $1 refers to the first parameter. The new problem is at the thread . Thanks to Yuliy for the crux move! ntc2 Solution A less manual version of knitatoms' answer combined with Alex Marteilli's answer works quite well: pass the +Gg option to less via its pager option. For example, try man -P 'less -s -M +Gg' man This can be