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 at where the line display shifts to new line. So, if the terminal width is
Tag: less-unix
For zless to read empty gz file
I have tried to use zless to read (.gz) files. However, when (.gz) file is empty, it shows a message How to force zless to read an empty gz file without typing Y for many times. or Is that possible to return something like Answer zless is just a wrapper around less. You need to look at man less: -f
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. The script takes about 1 minute to produce the spreadsheet file
“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): I expected above to complete without any need for RAM, but to my surprise here is how it looked like ~2.5h later (by the time it
Python shell script open less with +F option
I have the following Python script, all seems to work how I want it to, except for the following: less opens with the option -F, this will follow the file like Tail would. to inspect (move through) the file the user has to ctrl + c to send an interrrupt. when sending the ctrl +c (interrupt) this gets send to
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 language is C, however, if anyone can suggest any other similar program that will be great too,
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. Output: But its hard for me to separate them as those are screen full of texts(also not pleasant for
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 information, that selected PDF is binary file and result file is just TXT with PDF data
xterm keep page from less in terminal after exit
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? Answer less