Questions tagged [search]

search is used for questions relating to searching through the contents of files. For searching for filenames using the locate command use the tag locate.

Searching is the practise of looking for a matching strings, with or without the use of regular expressions, in a file or in multiple files.

Searching may involve indexing of the text to search, in particular if there is a lot of data and the searches are frequent and/or have to be fast.

Searching for a match in filenames is often done using locate which has its own tag .

573 questions
8
votes
2 answers

How does searching a file (locate) or autocompletion work?

I am a Windows user and coming from Windows with all the indexing and eternal wait times when searching for files, I find it surprising how fast does locate work or the autocompletion (that I know) work in linux. Is there any indexing being done in…
oli206
  • 759
1
vote
1 answer

Which viewer can search within a line?

I have a file (a minified Javascript file) that is essentially one long line. When I run a search in this file with mc (by pressing F7 in the builtin viewer) or with less (by typing a slash) apparently it takes me to the start of the line, even…
AndreKR
  • 1,100
1
vote
1 answer

Can't locate shell script

I created a shell script that logs me in to a server. The script was in a directory that was added to $PATH I think I might have deleted the script when not paying attention (not on purpose). I cannot find the script anymore. I tried several…
Vincent
  • 2,898
0
votes
1 answer

Command to highlight the occurrence of a method in a file?

How would I do the above? Would it be different for each text editor? Could it be done in the terminal? Thanks
user49888
  • 365
0
votes
2 answers

script to print word at specific location at specific line into a new file

below is the file from which the data should be copied from a specific line and specific location CP I ({010010010010010010010010010010}000 000) 234764-CTS_fsdfs_a_inv_33ghf/ZN --- I ({111100011111100000000000011100}111 111) …
vikas
  • 1
0
votes
2 answers

Recursively search for files that duplicate the same first 8 letters

I have folders with many files that all start with a date - 20200403 for example. I want to find which folders have multiple files with that same date i.e. the first 8 letters are the same. Only in each specific folder do the dates matter. It…
AKDub
  • 11
0
votes
1 answer

How do I extract specific URLs from an HTML file

I have an HTML file, without any formatting. I want to extract URLs of the form https://sitename.com/*/ending and only those URLs. What is the best way to go about doing this? This question is NOT a duplicate. The other question is asking about…