Find the number of non-duplicate names recursively.
Hi, here comes another newbie question:
How to find the number of non-duplicate names recursively?
For example, my files are stored in the folders like:
Quote:
1
1.txt
2
1.txt
2.txt
3.txt
If I do
This will gives out a result "4". One .txt file named "1.txt" in folder "1",
and three other .txt files named "1.txt", "2.txt" and "3.txt" in folder "2".
However, some times, I would like to show the number of non-duplicate file names:
say:
1.txt
2.txt
3.txt
in total, there are "3", I would like a command to give out a result "3", rather than "4".
I'm searching for particular scripts that contain pattern "BASIS" so I used the following command:
find . -type f -print | xargs grep "BASIS"
or
find . -type f -exec grep "BASIS" {} \;
However, I found out that the find command in the UNIX box that I'm working on doesn't find files... (6 Replies)
I'm currently working on a script that extracts files from a .zip, runs an sha1sum against them and then uses awk to pre-format them into zomething more readable thusly:
Z 69 89e013b0d8aa2f9a79fcec4f2d71c6a469222c07 File1
Z 69 6c3aea28ce22b495e68e022a1578204a9de908ed File2
Z 69... (5 Replies)
Display the number of files in a directory and recursively in each subdirectory
To look something like below, for example
/var 35
/var/tmp 56
/var/adm 46Any ideas how can we do this?
Got a sun cluser global mount point which takes ages to mount everytime, need to understand... (5 Replies)
Display the number of files in a directory and recursively in each subdirectory
To look something like below, for example
/var 35
/var/tmp 56
/var/adm 46
Any ideas how can we do this? :wall: (1 Reply)
Hi,
In a file, I have to mark duplicate records as 'D' and the latest record alone as 'C'.
In the below file, I have to identify if duplicate records are there or not based on Man_ID, Man_DT, Ship_ID and I have to mark the record with latest Ship_DT as "C" and other as "D" (I have to create... (7 Replies)
Hello everyone !
Please have a minute and see if you know how to script this
I have a file like this:
"create table ....
...
create index n112 on ...
...
create table ...
....
create index n113 on...
...
create table ...
create index n112 on ...! duplicate
... (1 Reply)
I have a file that looks like this
2 4 10 500 tim9
5 8 14 700 tim9
3 5 15 432 john1
1 4 12 999 ellen2
So basically what i want to do is fine duplicate names on column 5 and rename it with an extention (i.e. tim9_1 and tim9_2).
so the output file will look like this
2 4 10 500 tim9_1... (1 Reply)
Hi,
' recgrep find . | xargs grep ' is used to scan the contents recursively. I have a different requirement. I need to scan just the names and check for a pattern and display with fullpath. Is that already available? Closest that I am trying is 'ls -R | grep pattern' Here I would get multiple... (1 Reply)
I am trying to write a housekeeping bash script. Part of it involves searching all of my attached storage media for photographs and moving them into a single directory. The problem occurs when files have duplicate names, obviously a file called 001.jpg will get overwritten with another file... (6 Replies)