I m kind of stuck ...i need to find files with a specific criteria but i can not make it work ....
These are the ones :
1.How do you Find files under /root that contain the whole words (i.e., not part of another word) 'foo', 'bar', 'baz', 'cat', 'cut', 'cot.' using a single command ?
I tried :find /root -name 'foo.*' -name 'baz.*'-name 'cat.*'-name 'cut.*'-name 'cot.*'
but seems that is not right
2.Find files under /var that contain the character list 'xxx' or 'xxxx' or 'xxxxx'. Using \{\} and adding two lines of context before AND after each keyword found. ..
my answer: find /var -name 'xxx' ,'xxxx, 'xxxxx'
At this point i am lost ....
Any help will be very much appreciated
4 3161
I m kind of stuck ...i need to find files with a specific criteria but i can not make it work ....
These are the ones :
1.How do you Find files under /root that contain the whole words (i.e., not part of another word) 'foo', 'bar', 'baz', 'cat', 'cut', 'cot.' using a single command ?
I tried :find /root -name 'foo.*' -name 'baz.*'-name 'cat.*'-name 'cut.*'-name 'cot.*'
but seems that is not right
2.Find files under /var that contain the character list 'xxx' or 'xxxx' or 'xxxxx'. Using \{\} and adding two lines of context before AND after each keyword found. ..
my answer: find /var -name 'xxx' ,'xxxx, 'xxxxx'
At this point i am lost ....
Any help will be very much appreciated
For number 1, do you mean that have filenames containing those words, or the files themselves containing those words?
The tools you want in the latter case are grep and sed, not find.
Actually, I think both questions are looking for answers involving sed. A little more on sed. Required reading for sed (i.e. Regular Expressions).
No , i s not grep because we are looking for file names no strings within a file .
I know FIND must be used but i dont remember the correct parameters ..
No , i s not grep because we are looking for file names no strings within a file .
I know FIND must be used but i dont remember the correct parameters ..
In the future, you can use the command line utility man to find syntax for linux commands: Here is a web version of the man page.
find /root -name 'foo' -print is the command to find files
Sign in to post your reply or Sign up for a free account.
Similar topics
by: hokiegal99 |
last post by:
The below code does what I need it to do, but I thought that using
something like ext = os.path.splitext(fname) and then searching ext
for '.mp3' would be a much more accurate approach to solving...
|
by: Thieum22 |
last post by:
Hi,
I try to go through a directory and it's subdirectories to reah the
properties of each files. But I have a problem to set active the
directory where the files are, in order to display their...
|
by: Dean Arpajian |
last post by:
Looking to find info/ libs on creating (small) video files.
Basically what I'm looking for is a tutorial for constructing a short
video... (nothing nasty: output from a transmission line...
|
by: David T. Ashley |
last post by:
I'll be using gcc under Red Hat Enterprise Linux.
Where do I find information about the low-level calls to the operating
system from compiled 'C'?
For example, if I want to cause a process to...
|
by: krishnakant Mane |
last post by:
hello all,
I am stuck with a strange requirement.
I need a library that can help me display a pdf file as a report and
also want a way to print the same pdf file in a platform independent
way....
|
by: enquiring mind |
last post by:
-learning python with limited knowledge of linux.
-get error msg 21 "file or directory does not exist"
-running Suse linux 10.
-haven't had a problem before
- rebooted several times.
-python...
|
by: Kesavan |
last post by:
I install apache2 in /usr/local/apache2
and install php5 by ./configure --with-apxs2=/usr/local/apache2/bin/
apxs
PHP is successfully installed in my system.
But now my .php files inside...
|
by: Patricia Mindanao |
last post by:
I have a directory tree on my hard disc which represents all the web pages and linked stuff
on my mirrored web hoster server.
All web pages and files are statically linked. So dynamically...
|
by: michalkuls |
last post by:
Hi,
I have a problem with my linux apache+php installation. I don't know
much about linux and it appears a real nightmare for me every time I
need to change anything.
When I look at the file...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |