Programming :: Finding Location Of Duplicate Directories

Jan 8, 2011

This simple task is proving harder then imagined. I have a multi-level directory that I'm trying to clean of duplicates, but I can't get 'find' to print what I need to see. To give an illustrative example, here is a dir:

Code:
stuart@stuart:~/testdir$ ls *
dir1:
level2:
dir1

So the output of find as i'd like it to work would show the two locations of dir1, which would be ./dir1 and ./level2/dir1. But no:

Code:
stuart@stuart:~/testdir$ ls -d */ | head -1 | find . "`cat`" -type d
.
./level2
./level2/dir1
./dir1
dir1/

View 2 Replies


ADVERTISEMENT

Programming :: Finding A Shell Script To Delete Files Which Location Should Be Read From A Log File?

Jul 16, 2011

I have 2 external hdd in wich I have all my files.... yesterday, I have copied all the files from hdd2 to hdd1 and I want to eliminate duplicates so I used FSLint to find them, now, I have a txt file that looks like this:

Code: /media/My Book/!!!MIS DOCUMENTOS/Documentos/2 sep2003-jun2009 USB/!TESIS/TESIS/TESIS CVT LABVIEW Y CODEWARRIOR/LabVIEW85RuntimeEngineFull.exe /media/My Book/HDD_Toshiba/Borrable/Pen_Drive_4GB/Tesis/Super CD de la tesis/LabView/LabVIEW85RuntimeEngineFull.exe multiplied by millions of entries...

now I want to make a shell script to delete all the files/entries (read from the log file) that begin with:

Code:

/media/My Book/HDD_Toshiba/**** Since HDD_Toshiba is the folder in hdd1 (MyBook) that contains all the files from hdd2

View 1 Replies View Related

General :: Finding And Removing Duplicate Consecutive Words

May 2, 2011

I want to find and remove duplicate consecutive words from a text file. I've tried working with array but is very difficult..then i've tried using sed...somebody hint me with this sed :
sed ':f;N;$!bf; s/(.*)
1/1
/g; s/(.*)1/1/g'.
It works fine but if i have 3 consecutive identical words it only remove first one and the last two remain intact.

View 14 Replies View Related

General :: GUI Application For Finding / Deleting Duplicate Data Files

Jan 10, 2011

I copied a back up of my windows 'my documents' fold and all of its' sub folders into my linux (Mint Debian) Documents directory. I found that many of my files can be found in more that one directory so, what I want to do is to find all the dups and deal with them. Is there a good linux application to resolve this 'duplicates' problem. (I don't want to touch the linux system files.)

View 2 Replies View Related

General :: Move Some Of The Files From Multiple Directories To One Location?

Jun 17, 2010

I'd like to move a selection of files from all the sub-directories within an overall directory to a single destination. I don't want any of the directory structure, just the files themselves. This is what I tried so far:

mv /dir1/*/igs*.sp3.Z /dir2

There are other .sp3.Z files in the * directories within /dir1 but I just need the ones that start with igs..

View 4 Replies View Related

General :: Copy A Set Of Sub Folders From Their Multiple Parent Directories To A New Location

Nov 5, 2010

I am attempting to copy a set of sub folders from their multiple parent directories to a new location.

For example, I have three folders to copy:

I would like them to be copied to:

In actuality there are many folders besides folder1, folder2, folder3, and no numerical order exists. So, the folder named 'photos' would be copied to its parent folder's name in a new location. I would need this to occur for all folders in the '/home/user' directory.

View 6 Replies View Related

General :: Saving A Content Of Files(contain Location To A Directories) Into Variable?

Nov 22, 2010

#the file temp contain a path to a directory int the first line
a= `head -1 temp`
bash: /home/ram/linuxTraining/scripting/testDir/test1Dir/test2Dir: is a directory

View 4 Replies View Related

General :: Finding Location Of A Program With PID Known?

Feb 23, 2011

I've used ps -p to find a certain program. but how can i find the location of this program? as in the path to this program.

View 3 Replies View Related

Debian :: Finding Location Where Can Download 5.0.0 Or Any 5 Prior To 5.0.8?

Feb 1, 2011

location where I can download Debian 5.0.0 or any Debian 5 prior to 5.0.8? I've checked some of the archive sites but they seem to only go up to Debian 4.

View 2 Replies View Related

Ubuntu :: Finding The PostgreSQL Installed Location?

Mar 24, 2011

I'm using ubuntu 10.04 and PostgreSQL 8.4.7. I need to find out where PostgreSQL is located so I can run commands. I successfully installed PostgreSQL without changing any of the defaults. Matthew & Stones' Beginning Databases with PosgreSQL From Novice to Professional, as well as the PostgreSQL documentation, indicates the standard location is /usr/local/pgsql/bin/ but it's not there; it's somewhere else (ps -el | grep post confirms it IS running and psql is able to do du to display the list of users and l to display the list of databases).

But when I tried to create a new user by running /usr/local/pgsql/bin/createuser the command was not found. I tried to locate the installation by running pg_config --bindir but it said pg_config was not installed. I downloaded pg_config and its dependencies and tried to install them with the package installer, but it wouldn't go because something is wrong with the libkrb5-3 and libkrb5support0 packages - they won't install and the package installer just zips through without reporting missing dependencies or anything. The MD5, SHA1, and SHA256 checksums all match, but they just won't install. I then tried the libk5crypto3 package just to make sure something wasn't wrong on my end - it installed fine. So I searched the PostgreSQL FAQ and found out how to get the version without pg_config by doing a SELECT version(); query. here appears to be no corresponding SELECT bindir(); query. A plain ordinary file search for pgsql, postgresql, etc.

View 3 Replies View Related

General :: Finding The Location Of Downloaded Packages?

Oct 7, 2010

Where are downloaded packages saved when i download using yum?

View 2 Replies View Related

Ubuntu :: Finding The Squid3 Swap File Location?

Jul 14, 2010

I got squid3 installed on ubuntu server 10.4. I believe it is up and running as I can browse the internet on my other computers.I followed one of the tutorials on the net and looked at others for guide as well. Everyone of them did not mentioned that we have to create the swap files. Are we suppose too? I couldn't find the location of the swap file anywhere on the server.

View 1 Replies View Related

Slackware :: Finding The Location Of Default Console Keymap?

Mar 20, 2010

I avoid capslock like the plague and use "ctrl:nocaps" when in X, and would like to have the same behaviour in the console. Back when I was using Debian I got it set up the way I want, but now I can't seem to locate the default keymap. I tried editing

Code:

/usr/share/kbd/keymaps/i386/qwerty/defkeymap.map.gz

and it works when I use loadkeys manually, but not on boot.

View 3 Replies View Related

General :: Command VM Install - Finding Exact Location Of File

Oct 30, 2009

I am using linux machine and execute a command vm-install to perform some operation. How would I find the exact location of this file.

View 1 Replies View Related

Programming :: Remove Duplicate Entries On A Row?

Nov 1, 2010

we have a variable LIBS:

LIBS='-lpq -lmysqlclient -lssl -lpthread -lresolv -lssl -lpthread -lresolv'

I'd want to get:

LIBS='-lpq -lmysqlclient -lssl -lpthread -lresolv'

Bear in mind that LIBS can be variable, I mean I need to drop any duplicate and only retain the last one of each different entry. And we must keep the order as is, I must not sort out them.

So, if LIBS is:

LIBS='-lpq -lmysqlclient -lpthread -lresolv -lpthread -lresolv'

I need: LIBS='-lpq -lmysqlclient -lpthread -lresolv'

View 3 Replies View Related

Programming :: Duplicate Value In Select - Mysql Query ?

Dec 2, 2010

Trying to export a Mysql query to a .csv file the query draws from multiple tables, e.g. sales, purchase and currency

Code:

What i'm trying to do is to export both the sales and purchase to a single line where both the currency for the sales and the purchase is specified.

Basically like this:

Code:

Problem here is that i'm stating currency.value twice in the same select and don't know how to define which currency.value applies to sales and which to purchase.

View 7 Replies View Related

Programming :: Getting Duplicate Entries In Mysql Database?

Apr 13, 2011

I'm getting duplicate entries in mysql database when submitting a new item from a form. I initially loaded the database via IMPORT function in phpMyAdmin. This is my input form:

<center>
<br />
<FONT SIZE="5" ><b>Add Item Template</b></FONT>
<br />

[code].....

However, I do need to return the input form in order to keep entering new items into the database.

View 8 Replies View Related

Programming :: Remove Duplicate Entries From First Column?

May 12, 2010

I have a huge (over 10 gb) file with a list of IP's each followed by a corresponding number like this:

Code:

12.32.34.23 10
143.32.34.543 11
232.32.45.65 12
54.23.5.232 13
143.32.34.43 14
and so on..

I'm trying to sort this file numerically and weed out any duplicate IP addresses. How do I do this on bash? I have come up with this but obviously it does'nt work.

Code:

$sort -n myfile.txt | cut -f1 | uniq -u

View 2 Replies View Related

Programming :: Script To Remove Duplicate Jpg Files

May 25, 2010

Thanks y'all for the great script and explanation. This helped a lot in my own project. I thought I'd share the efforts.The project is this: I've got lots of duplicate JPGs from all the family members who've named the same photo with different names. Since md5sum generates a "fingerprint" based on the file contents, not the name, I want to use the md5sum of each jpg to uniquely name each photo and also remove exact duplicates.

It has the following flaws:
0) it doesn't handle certain non-alphanumerics
1) it keeps both photo-shopped and unaltered photos (different md5s)
2) it (currently) doesn't preserve descriptive filenames.

(For me, removal of duplicates is more important than keeping the filenames. I may change that to concatenate the md5 and the filename.)Please note that the commented "rename" command should be used to strip non-aphanumerics from the file names, and the script should be launched with the commented "find" command.

View 1 Replies View Related

Programming :: Splitting Text File Into Each Duplicate

Dec 10, 2010

I have a text file that is filled with references to duplicate files. I'm trying to create a text file for each duplicate file found that contains the paths to the duplicates. I would also like the text file names to be based on the size and file name.

Some thing like:
231.5 KB - P&S.doc.txt
138.5 KB - LIMITED#C71.doc.txt

Code:
NamePathSizeLast ChangeLast AccessFile TypeOwnerAttributes
P&S.doc(3 Files)
P&S.docZ:Leg\_Pri_LegPurP&SBUYBarry V231.5 KB11/2/2001 4:07 PM11/22/2010 2:38 AM.doc (Microsoft Office Word 97 - 2003 Document)Lou_AC
P&S.docZ:Leg\_Pri_LegP&SBUYBarry V231.5 KB11/2/2001 4:07 PM11/22/2010 2:38 AM.doc (Microsoft Office Word 97 - 2003 Document)DMsC
P&S.docZ:Leg\_Pri_LegPropsPurP&SBUYBarry V231.5 KB11/2/2001 4:07 PM11/22/2010 2:38 AM.doc (Microsoft Office Word 97 - 2003 Document)DMsC
LIMITED#C71.doc(2 Files)
LIMITED#C71.docZ:Leg\_Pri_LegPurCV138.5 KB12/15/2003 1:04 PM11/22/2010 2:38 AM.doc (Microsoft Office Word 97 - 2003 Document)Lou_AC
LIMITED#C71.docZ:Leg\_Pri_LegPropsPurCV138.5 KB12/15/2003 1:04 PM11/22/2010 2:38 AM.doc (Microsoft Office Word 97 - 2003 Document)DMsC
ps revised.8.30.05.clean.doc(3 Files)
ps revised.8.30.05.clean.docZ:Leg\_Pri_LegPropsPurP&SSellVPSummit54.5 KB8/31/2005 11:46 AM11/22/2010 2:38 AM.doc (Microsoft Office Word 97 - 2003 Document)DMsC
ps revised.8.30.05.clean.docZ:Leg\_Pri_LegP&SSellVPSummit54.5 KB8/31/2005 11:46 AM11/22/2010 2:38 AM.doc (Microsoft Office Word 97 - 2003 Document)DMsC
ps revised.8.30.05.clean.docZ:Leg\_Pri_LegPurP&SSellVPSummit54.5 KB8/31/2005 11:46 AM11/22/2010 2:38 AM.doc (Microsoft Office Word 97 - 2003 Document)Lou_AC
Copy of 08 Lee All July Billing.xls(2 Files)
Copy of 08 Lee All July Billing.xlsZ:IS\_Sh_ISDevDocDocl 26 upgradeAS6 backup codeAPImport131.5 KB7/30/2010 12:11 PM11/22/2010 2:38 AM.xls (Microsoft Office Excel 97-2003 Worksheet)AdministratorsC
Copy of 08 Lee All July Billing.xlsZ:APKellie131.5 KB7/30/2010 10:03 AM11/22/2010 2:38 AM.xls (Microsoft Office Excel 97-2003 Worksheet)KellieC

View 5 Replies View Related

Programming :: Remove Duplicate Lines From Shell Script

Apr 8, 2010

I have a file with semi duplicate lines, like:
abc 12 32
agsi 82
sha 26
abc 1
iaij
agsi 3

Now I want to edit my file and make it:
abc 12 32
agsi 82
sha 26
iaij
i.e. remove second occurrence of line when 1st column is abc or agsi.

View 13 Replies View Related

Programming :: Get The Directories Of A Directory?

Apr 4, 2011

I need to walk in folder recursively in C. To change the directory, I can use chdir, but how I can get the directories of a directory?

View 3 Replies View Related

Programming :: Location Of - Gnu - C++ Standard Library

Jul 21, 2010

Where is the location of the header files for the c++ standard library?

I assume that they were installed by gnu g++, please correct me if i'm wrong.

I'm running ubuntu 10.04 with g++ 4.4.

I looked in /usr/lib/gcc/i486-linux-gnu/4.4/include, but this directory contains only the following:

Code:

Which doesnt seem to include the really basic things like iostream, for example.

Where can I take a look at the header files for these standard c++ libraries?

View 2 Replies View Related

Programming :: Byte At Memory Location 45 With Immediate Value 03

Jul 10, 2011

As 2.17
I want to code this:
and byte[45],03

In words, AND the byte at memory location 45 with immediate value 03. As reports "Ambiguous operand size for and". How could I code the instruction such that as understands my intention?

john: .byte 45
and byte[john],03
gives the same error.

View 8 Replies View Related

Programming :: Check If Any Directories Exist, Except A Certain One?

Aug 5, 2010

I need to find if, in a folder any directories exist, except a certain one named "mes croquis".What I am trying to say, is that the re already is a directory named "my croquis", which I have to ignore. IF any other directory appears, I have to archive them.I got everything so far, except the starting condition.In other terms , I am lookign for something like this:

IF anyDir EXIST AND name != "mes croquis"
do something
else

[code]....

View 2 Replies View Related

Programming :: Searching File In Directories?

Feb 23, 2011

I am trying to search particular directory which has files with extensions like .html,.mp3,.xml etc I have a list of such files

What I am doing in my script is

for file_name in `find /home/ -name index.html -o -name song.mp3 -o -name help.xml`;
do
if [ $file!='' ]
then

[Code].....

View 4 Replies View Related

Programming :: Determine Files And Directories?

Mar 9, 2010

i made a program to list all the files in a directory,is there a way to determine what are directories and what are files ?

View 5 Replies View Related

Programming :: How To Find Directories That Do Not Have A Certain File

May 28, 2010

I'm having problems figuring out the process to find directories that DO NOT contain a certain file. I have a mp3 collection that all the album art is name "folder.jpg". Not all the albums have images. I need a way to find the albums/directories that do not contain "folder.jpg". I can find the ones that do contain "folder.jpg" with

Code:
find . -iname 'folder.jpg' -print0 | xargs -0 ls >> album_art

but that is as far as my bash-fu can take me. I'm not really sure what my next step is.

My directory structure is like such: a-z/artist/album/folder.jpg

View 5 Replies View Related

Programming :: Makefile - Handles Directories ?

Dec 8, 2009

I'm trying to figure out how Make handles directories.

How can I modify this makefile so it will put all of the .o files in a separate build directory?

Code:

But make ignores this and still puts main.o in the base directory. And if I refer to the build directory in the dependencies for bandit, make complains about "no rule ..."

I want to keep main.cpp in the base directory, all other sources in the src directory, and all object files in the build directory.

View 14 Replies View Related

Programming :: Mod_rewrite Remove Sub-directories From URL?

Apr 25, 2011

I have tried this a million ways, got it to work once but it didn't work sitewide for some reason. I have a url: [URL] and I want it to be found by going to: [URL] I am using this

Code:

RewriteCond %{REQUEST_URI} ^/agents/tp/
RewriteRule ^([^/]+)/?$ agents/tp/$1/index.php [L]

and have also tried something as basic as

Code:

RewriteCond %{REQUEST_URI} ^/agents/tp/
RewriteRule ^(.*)$ agents/tp/$1/index.php [L]

I keep getting "The requested URL /JoeAgent/ was not found on this server." why it's not working?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved