[Bio-Linux] Fwd: undo mv command

Tim Booth tbooth at ceh.ac.uk
Mon Apr 13 09:12:56 EDT 2015


Hi Tauqeer,

Tony's debsums suggestion is good, but I'd already written this by the
time I saw his reply, so here's my alternative in case you need it...

I did a similar thing to myself a few years ago, but in this case it was
"rm" rather than "mv".  Well done on getting back to a usable system.
The good news is that you can use 'dpkg' to check that everything is
back correctly because it has a registry of all the files installed
in /usr/bin, assuming you didn't add them via some other means.

$ dpkg -S /usr/bin | sed 's/, /\n/g;s/: .*//' | xargs dpkg -L | grep ^/usr/bin/ | sort > /tmp/files_expected

and

$ find /usr/bin -mindepth 1 | sort > /tmp/files_found

Now, to find files that dpkg thinks should be in /usr/bin but are
actually missing, compare the two lists:

$ grep -vFf /tmp/files_found /tmp/files_expected

This first list should be empty.  If not, use 'dpkg -S /usr/bin/foo' to
discover the package that is missing a file and re-install that package.

$ grep -vFf /tmp/files_expected /tmp/files_found

This second list shouldn't be empty, but it will normally contain only
symlinks.  Check like so:

$ grep -vFf /tmp/files_expected /tmp/files_found | xargs ls --color=always -l

As for the files you listed, /usr/bin/formatrpsdb is part of the BLAST
package, so reinstall 'blast2' just to be sure.  I don't recognise the
others, and I'd not expect any .jar file to be living in either /usr/bin
or /usr/local/bin.

Cheers,

TIM

On Mon, 2015-04-13 at 02:29 +0100, Tauqeer Alam wrote:
> Hi Tim
> This is related to my earlier email (pls see below). I tried to
> retrieve all the files which I had accidentally moved back to "/bin"
> and it seems that everything is working now. I am attaching with this
> email the ls output of the current "/bin" directory. I have 3 extra
> files which I am not sure if they are part of the "/bin" or
> "/usr/local/bin", these are-
> 
> 
> seq_cache_populate.pl 
> formatrpsdb 
> htsjdk-1.119.jar
> 
> 
> Also, is there anyway to confirm that the "/bin" now has all the
> original files?
> 
> 
> Thanks
> 
> 
> Tauqeer
> 
> 
> 
> 
> ---------- Forwarded message ----------
> 
> From: Tauqeer Alam <tauqeer9 at gmail.com>
> Date: Sun, Apr 12, 2015 at 3:29 AM
> Subject: undo mv command
> To: Bio-Linux help and discussion <bio-linux at nebclists.nerc.ac.uk>
> 
> 
> Hi Tim
> I Just made a mistake while installing a program on my Bio-linux. I
> was trying to move something from the bin of a program
> to /usr/local/bin/, but I typed the following command by mistake.
> 
> 
> $ sudo mv /bin/* /usr/local/bin/
> 
> 
> 
> How can i get everything back in the /bin directory? Pleas help.
> 
> 
> Thanks
> 
> 
> Tauqeer
> 
> 
> -- 
> *********************************************
> Md Tauqeer Alam, Ph.D
> Division of Infectious Diseases
> Emory University School of Medicine
> 615 Michael Street, Atlanta, GA 30322, USA
> tauqeer9 at gmail.com
> 
> 
> 
> 
> 
> -- 
> *********************************************
> Md Tauqeer Alam, Ph.D
> Division of Infectious Diseases
> Emory University School of Medicine
> 615 Michael Street, Atlanta, GA 30322, USA
> tauqeer9 at gmail.com
> 

-- 
Tim Booth <tbooth at ceh.ac.uk>
NERC Environmental Bioinformatics Centre 

Centre for Ecology and Hydrology
Maclean Bldg, Benson Lane
Crowmarsh Gifford
Wallingford, England
OX10 8BB 

http://environmentalomics.org/bio-linux
+44 1491 69 2297




More information about the Bio-linux-list mailing list