Search Results

Search: Posts Made By: OmarKN
1,306
Posted By OmarKN
Listing files with their parent dir?
Hi and good day,

This string lets me find the html files:

ls -R /Volumes/LC3/Sites/chu | grep "html"

But how to list the files with their parent dir 'attached' to them:

For example:...
1,680
Posted By OmarKN
mv ${filename} ${filename%.rtf} So the found...
mv ${filename} ${filename%.rtf}

So the found files are moved (changed), but what does % do?

/
with best regards,
Omar KN
Stockholm, Sweden
1,680
Posted By OmarKN
Well, yes I would need first to find all...
Well, yes I would need first to find all ".rtf.rtf" files,
[then pipe the result - XX No]

then replace those found, with a simple .rtf extension.

So with
find . -type f -iname "*.rtf.rtf"
...
1,680
Posted By OmarKN
Replacing duplicated extensions, like .rtf.rtf
Hi and good day,

[i have Mac OS 10.9.5 and bash]

In Terminal I tried mv *.rtf.rtf *.rtf to get rid of double rtf extensions ( which came about from some other process),
but this doesn't work....
4,811
Posted By OmarKN
Sorry but: find . -type f -name “*modern*"...
Sorry but:
find . -type f -name “*modern*" -regex '.*\.[jp][pn]g'
didn't work here, I only got a new line with > this.

But having the folders in a row works fine!

find _img5/ _img6/ -type f...
4,811
Posted By OmarKN
Thank you R. Singh, I'll save this for later...
Thank you R. Singh,

I'll save this for later digestion, ...

with best regards,
Omar K N
Stockholm, Sweden

---------- Post updated at 08:31 PM ---------- Previous update was at 08:28 PM...
4,811
Posted By OmarKN
This works fine! How to restrict the search...
This works fine!

How to restrict the search to only jpg and png - files?

Alternatively,

How to restrict the search to only certain folders? (such as _img1/ _img2/ )?

with best regards,...
4,811
Posted By OmarKN
How to find string of file name of images?
Hi & good day,

How to use find correctly ?

I have several folders, _img1, _img2 etc.

Then I want to use the find command to find part of an image name, such as:

the string ”modern”
...
1,955
Posted By OmarKN
That was it, thank you!!! /okn
That was it, thank you!!!

/okn
1,955
Posted By OmarKN
In .bash_profile I have the following: ...
In .bash_profile

I have the following:

#My PATH:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/okn/bin

which is exactly what I get at login, when it says:


-bash:...
1,955
Posted By OmarKN
Yes - I do have a bin under HOME (don't remember...
Yes - I do have a bin under HOME (don't remember how it got there).

It has a shell script ("showlines.sh")

#!/bin/bash
grep -ci word * | while read line; do
if [ ${line#*:} -gt 0 ]; then
...
1,955
Posted By OmarKN
Something in my PATH too much.
Hi & good day,

When starting the terminal (bash) I get the following:

-bash: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/okn/bin: No such file or directory
Should I just take away the...
1,814
Posted By OmarKN
How to add to the search path - bin?
Hi,
Now I have: /Users/okn/bin for my private shell scripts.

How do I add /Users/okn/bin to my PATH?

The PATH is right now:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

The .bash_profile...
3,129
Posted By OmarKN
even better! Thx gandolf989, /
even better!
Thx gandolf989,

/
3,129
Posted By OmarKN
Hi, Thank you xbin & Corona! I put the code...
Hi, Thank you xbin & Corona!

I put the code into a shell which is in the same folder as my textfiles. I execute it and it works! (With . showlines.sh)

However I'm not sure about the placement...
3,129
Posted By OmarKN
Alright, ... I see have to put this in a shell...
Alright, ... I see have to put this in a shell script first,-

/okn
3,129
Posted By OmarKN
Thank you Yoda, Yes grep -l shows a list of...
Thank you Yoda,

Yes grep -l shows a list of files-with-matches,
but it doesn't tell how many matches in each file.

So there has to be set in a count of some sort, maybe by piping from

grep...
3,129
Posted By OmarKN
Grep for list of files with only found hits
Hi,

With grep -ci word * I get a list of files either they have a hit, or the have not (0).

I wanted to pipe to a new list of files, which only shows the files where the string was found, and...
2,686
Posted By OmarKN
Interesting! And - to shorten - if are all...
Interesting!

And - to shorten - if are all html files (none htm ) then:

find chu -type f \( -name '*.html' \) ! -exec grep -q 'exec cgi' {} \; -print

ok, I just added:

> no_cgi2.txt ...
2,686
Posted By OmarKN
Hi Don , Thank you, I installed this script...
Hi Don ,

Thank you, I installed this script as described, and made it executable.

And it worked!

My first script, and I let it write out a little file adding:


| cat > no_cgi.txt
...
2,686
Posted By OmarKN
Yes, this is for Mac OSX, bash, and a single line...
Yes, this is for Mac OSX, bash, and a single line between other HTML-tags, mostly somewhere else in each file.
They are all html files.

/ okn
2,686
Posted By OmarKN
How to know which pages don't have...?
Hi & good day UNIX / Linux folks,

Some of my > 700 pages don't have this counter:

<!--#exec cgi="/cgi-bin/counter"-->

How would one use find (?!) to know which pages _don't have_ this...
1,349
Posted By OmarKN
Well I'm on Mac OS X, I have an old "Unix...
Well I'm on Mac OS X,

I have an old "Unix for Mac OS X Panther" from 2004 which is 8 years old, and although not much may have changed, it might be useful with some other approach to writing a...
1,349
Posted By OmarKN
Online UNIX intermediate level documentation
Hi,

Can maybe some of the UNIX-guys recommend an online UNIX intermediate level documentation with examples (not too dry :-).

More the post-beginner level, for someone who has to play around...
9,036
Posted By OmarKN
Thank you guys! and thank you Balajesuri! ...
Thank you guys! and thank you Balajesuri!

Actually the funny thing is that:
find /absolute path/ -type f -name *_i*

is quite sufficient and results in:...
Showing results 1 to 25 of 29

 
All times are GMT -4. The time now is 10:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy