Search term highlighting using "less"


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Search term highlighting using "less"
# 1  
Old 10-11-2010
Search term highlighting using "less"

I'm using less to find terms in a 6 gb text file in OS X in the terminal. When I first search for the patter, it finds it, scrolls the document to the correct location, and highlights it. But when I search again, the document scrolls to a new further location (I'm assuming it's found the pattern again), but the term is nowhere to be seen. Sometimes if I scroll up or down using the arrow keys, it will be close to where I am, but usually not.

Anyone come across this before?
# 2  
Old 10-11-2010
Is your OS 32 bit or 64 bit ?

Is your version of "less" command 32 or 64 bit ?
you can check it with the file command :
Code:
file /usr/bin/less
/usr/bin/less:  ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped

2^32 = 4294967296
so above 4Gb if your OS and or the less command is 32 bit try to handle bigfiles you may encounter problems...
# 3  
Old 10-12-2010
Using 64 bit OS

Hi,
I'm running Snow Leopard, which is 64 bit.
For the less version:

/usr/bin/less: Mach-O universal binary with 2 architectures
/usr/bin/less (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/less (for architecture i386): Mach-O executable i386

So..I'm not sure which version is running when I simply using the less command. Would the "less" command know to run in 64 bit mode if my OS is 64bit? Is there a way to force it?

I'll test by chopping the file in 2 and see if that affects my issue. Will let you know if that works out.

Thanks again.

---------- Post updated at 11:08 PM ---------- Previous update was at 02:44 PM ----------

Thanks ctsgnb! The large size seemed to be the issue. Now that the file is split into a gig each, less searching is working as expected!

Gareth
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. Shell Programming and Scripting

grep with "[" and "]" and "dot" within the search string

Hello. Following recommendations for one of my threads, this is working perfectly : #!/bin/bash CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" ) Now I need a grep success for some thing like : #!/bin/bash CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies

5. Shell Programming and Scripting

awk based script to print the "mode(statistics term)" for each column in a data file

Hi All, Thanks all for the continued support so far. Today, I need to find the most occurring string/number(also called mode in statistics terminology) for each column in a data file (.csv type). For one column of data(1.txt) like below Sample 1 2 2 3 4 1 1 1 2 I can find the mode... (6 Replies)
Discussion started by: ks_reddy
6 Replies

6. What is on Your Mind?

Origin of the term "hotfix"

This is not a technical question per se, but one I'm hoping one of the "old guard" might be able to answer all the same. I'm looking for the etymology of the word "hotfix" which is surprisingly murky in its origin, even with the help of Google. A quick look at Wikipedia, for example, cites World of... (1 Reply)
Discussion started by: Sharptalon
1 Replies

7. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

8. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

9. Shell Programming and Scripting

"highlighting the text in ur output"

Hi, Can anyone tell me..how to highlight a particular part of ur output text in shell programming..say,if all the o/p is against black bground,i need some text to be against white bground.. eg..You can see some text highlighted in man pages .Right?? But how ll you do that. Thanx (6 Replies)
Discussion started by: sakthi.abdullah
6 Replies
Login or Register to Ask a Question