Move all files which have same names from subdirectories into one directory

I am trying to move all files in multiply nested directories into one directory. There are a few posts on this same topic which I followed. The command I used was this:

find ./train/ -type f -print0 | xargs -0 mv -t ./newTrain 

where train is the folder with the already existing files, and newTrain is the one I want to copy to. The command “somewhat” worked. The problem I have is that many of the files (and there are A LOT of them) have the exact same name. What seems to have happened is that the first file with a given name moved, then all subsequent files with the same name did not move. Here is a sample output from my command line:

mv: will not overwrite just-created './newTrain/000030.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0080/01-04-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-37331/501-T2WTSEAX-47262/000030.dcm' mv: will not overwrite just-created './newTrain/000031.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0080/01-04-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-37331/501-T2WTSEAX-47262/000031.dcm' mv: will not overwrite just-created './newTrain/000000.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000000.dcm' mv: will not overwrite just-created './newTrain/000001.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000001.dcm' mv: will not overwrite just-created './newTrain/000002.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000002.dcm' mv: will not overwrite just-created './newTrain/000003.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000003.dcm' mv: will not overwrite just-created './newTrain/000004.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000004.dcm' mv: will not overwrite just-created './newTrain/000005.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000005.dcm' mv: will not overwrite just-created './newTrain/000006.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000006.dcm' mv: will not overwrite just-created './newTrain/000007.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000007.dcm' mv: will not overwrite just-created './newTrain/000008.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000008.dcm' mv: will not overwrite just-created './newTrain/000009.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000009.dcm' mv: will not overwrite just-created './newTrain/000010.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000010.dcm' mv: will not overwrite just-created './newTrain/000011.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000011.dcm' mv: will not overwrite just-created './newTrain/000012.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000012.dcm' mv: will not overwrite just-created './newTrain/000013.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000013.dcm' mv: will not overwrite just-created './newTrain/000014.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000014.dcm' mv: will not overwrite just-created './newTrain/000015.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000015.dcm' mv: will not overwrite just-created './newTrain/000016.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000016.dcm' mv: will not overwrite just-created './newTrain/000017.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000017.dcm' mv: will not overwrite just-created './newTrain/000018.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000018.dcm' mv: will not overwrite just-created './newTrain/000019.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000019.dcm' mv: will not overwrite just-created './newTrain/000020.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000020.dcm' mv: will not overwrite just-created './newTrain/000021.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000021.dcm' mv: will not overwrite just-created './newTrain/000022.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000022.dcm' mv: will not overwrite just-created './newTrain/000023.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000023.dcm' mv: will not overwrite just-created './newTrain/000024.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000024.dcm' mv: will not overwrite just-created './newTrain/000025.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000025.dcm' mv: will not overwrite just-created './newTrain/000026.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000026.dcm' mv: will not overwrite just-created './newTrain/000027.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000027.dcm' mv: will not overwrite just-created './newTrain/000028.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000028.dcm' mv: will not overwrite just-created './newTrain/000029.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000029.dcm' mv: will not overwrite just-created './newTrain/000030.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000030.dcm' mv: will not overwrite just-created './newTrain/000031.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000031.dcm' mv: will not overwrite just-created './newTrain/000030.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0080/01-04-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-37331/501-T2WTSEAX-47262/000030.dcm' mv: will not overwrite just-created './newTrain/000031.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0080/01-04-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-37331/501-T2WTSEAX-47262/000031.dcm' mv: will not overwrite just-created './newTrain/000000.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000000.dcm' mv: will not overwrite just-created './newTrain/000001.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000001.dcm' mv: will not overwrite just-created './newTrain/000002.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000002.dcm' mv: will not overwrite just-created './newTrain/000003.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000003.dcm' mv: will not overwrite just-created './newTrain/000004.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000004.dcm' mv: will not overwrite just-created './newTrain/000005.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000005.dcm' mv: will not overwrite just-created './newTrain/000006.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000006.dcm' mv: will not overwrite just-created './newTrain/000007.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000007.dcm' mv: will not overwrite just-created './newTrain/000008.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000008.dcm' mv: will not overwrite just-created './newTrain/000009.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000009.dcm' mv: will not overwrite just-created './newTrain/000010.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000010.dcm' mv: will not overwrite just-created './newTrain/000011.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000011.dcm' mv: will not overwrite just-created './newTrain/000012.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000012.dcm' mv: will not overwrite just-created './newTrain/000013.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000013.dcm' mv: will not overwrite just-created './newTrain/000014.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000014.dcm' mv: will not overwrite just-created './newTrain/000015.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000015.dcm' mv: will not overwrite just-created './newTrain/000016.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000016.dcm' mv: will not overwrite just-created './newTrain/000017.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000017.dcm' mv: will not overwrite just-created './newTrain/000018.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000018.dcm' mv: will not overwrite just-created './newTrain/000019.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000019.dcm' mv: will not overwrite just-created './newTrain/000020.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000020.dcm' mv: will not overwrite just-created './newTrain/000021.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000021.dcm' mv: will not overwrite just-created './newTrain/000022.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000022.dcm' mv: will not overwrite just-created './newTrain/000023.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000023.dcm' mv: will not overwrite just-created './newTrain/000024.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000024.dcm' mv: will not overwrite just-created './newTrain/000025.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000025.dcm' mv: will not overwrite just-created './newTrain/000026.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000026.dcm' mv: will not overwrite just-created './newTrain/000027.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000027.dcm' mv: will not overwrite just-created './newTrain/000028.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000028.dcm' mv: will not overwrite just-created './newTrain/000029.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000029.dcm' mv: will not overwrite just-created './newTrain/000030.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000030.dcm' mv: will not overwrite just-created './newTrain/000031.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000031.dcm'  

Any ideas on how to fix this?

Show attachment names as a coloumn in Sharepoint list – 2007

Is there a way I can show attachment names as a ‘Title’ field in SharePoint list 2007?

I’m wanting to save duplication having to type out the name of a file to show as the title in the list.

I’ve tried various formulas in the custom Title field list, but nothing is working. I don’t have SharePoint designer.

Thank you in advance!

Can ping IP address using wireless connection but not host names

First up: I’m a total Ubuntu noob with some Unix background

Installed Ubuntu 18.04 (complete overwrite on a 32-bit machine) and then updated to 18.04.1 using a wifi extender with cabled connection into machine. Firefox works wonderfully this way.

Take cable out so it uses the Broadcom 802.11 BCM4321 and Firefox times out. In terminal can only ping IP addresses and not host names.

Tried installing winbind and changed /ect/nsswitch.conf to include wins but no luck.

It seems like this should be simple. What am I missing here?

Custom display form is showing old column names

Situation:

  • I created columns A, B, and C.
  • I created a custom display form with SharePoint Designer 2013 that displays A, B, and C.
  • I renamed columns A, B, and C to X, Y, and Z, respectfully.

Problem:

The columns still show as A, B, and C on the display form even though their column names are now X, Y, and Z.

I tried comparing my custom display form to the default display form, since the default display form automatically updates the column names, but the code is totally different.

How do I change my custom display form so it shows the “dynamic” column name (the external name I can arbitrarily change) rather than the “static” column name (the one that gets set when you first create a column)?

I’m guessing it’s something similiar to the code below. I’m not looking for the value of it though, just the new name.

<xsl:value-of select="@A"/> 

How to Find Company Names in Text Using Python

I have a list of properly-formatted company names, and I am trying to find when those companies appear in a document. The problem is that they are unlikely to appear in the document exactly as they do in the list. For example, Visa Inc may appear as Visa or American Airlines Group Inc may appear as American Airlines.

How would I go about iterating over the entire contents of the document and then return the properly formatted company name when a close match is found?

This is what I have so far, but it looks at each individual word rather than clusters of words:

from fuzzywuzzy import process  company_name = ['Agilent Technologies Inc', 'Alcoa Inc', 'American Airlines Group Inc', 'Atlantic American Corp', 'Apple Inc', 'Visa Inc', 'Invisa Inc', 'Grupo Televisa,', 'American International Group Inc']  text = 'consectetur elementum Apple Agilent Inc. Aenean porta magna AA American Airlines AAMC Inc AAPL e plumbs ernum. AA Agilent Technologies Inc, American International Inc, Visa Inc, apple inc Alcoa inc'  for word in text.split():     print('- ' + word+', ', ', '.join(map(str,process.extractOne(word, company_name)))) 

What names can I use for “users” to distinguish in-app entities from the physical user?

In my code and comments, I use the word user to refer to two related but conceptually different concepts:

  1. The physical user who is interacting with (the currently running instance of) my app
  2. Entities representing any instances of (1), as they are represented in the app.

For example, when I open a browser, I am an example of the first concept; I am a person interacting with the app. But when I open a social media app, I can see and interact with other users; they are examples of the second concept. Note that, in the social media example, there would also be an entity representing myself in the app, and so I am both the concept-1 user, and a concept-2 user.

Currently, in an attempt to make the distinction clear, I usually refer to the first concept as “the user”, and the second as “a user”, but I do not feel that it is very effective. Are there other names I could substitute for either use of the name “user” to indicate its intended meaning?

Probable hack: email “from” names being corrupted

Something very weird and troubling started happening on my wife’s Gmail account today. She received an email from G. Arnold, who is a regular correspondent, but in her inbox it showed as being from “Crazy Arnold”. That sounds quite funny and off-beat, but it’s not in character for this particular person. Plus, when she opened the mail, it briefly flashed up with the sender’s real name, then switched back to “Crazy”. In the screenshot below, I captured the moment before “G… Arnold” switched to “Crazy Arnold”. In addition, the “to” address shows as “that Bnos”, instead of “Bnos …”, the organization on whose behalf she is receiving the mails.

enter image description here

I checked in the mail headers, and the “from” address is normal. There is no sign of the word “Crazy” anywhere in the source.

This is not the only email thus affected. Many other senders are showing up with strange “from” names.

The common thread I can see between all these emails is that they have passed through a particular domain that I administer.

This smells very much like a hack. Any idea what kind of hack this could be, how to remedy it, or what preventative action to take?