After running the following code in a directory (actually a sub-directory of my pictures folder, if that helps) consisting of nothing other than about 60 png images:  for i in *; do  mv "${i}" Surv${53+count}.`echo "${i}" | awk -F. '{print $2}'`; ((++count)); done   I found that all but the last of these pngs images had vanished. Is there any way to restore them? At the time I thought that I had them backed up, but I am sad to discover that I have in fact not.
4166
Are there any tools, methods, incantations to recover recently deleted files on Ubuntu?  If it makes any difference, I want to recover a  2.x database file. But would be better to have a method/tool that works on any kind of file.
55018
My technophobe mother returned from a European trip to discover she'd erased all but 15 images from a nearly full 2GB card. As I am the computer guy in the family, she posted the card to me and asked that I make something magical happen.  The photos were taken with and deleted by a Nikon Coolpix. (I don't know the model.)  I am a Linux guy, but there is a Windows Vista box at my disposal.  What is my best strategy to try to recover something?
31108
Suppose an apache log file gets deleted but it's held open by apache; then this is what I am doing:  pid=$(lsof | grep text.txt | awk '/deleted/ {print $2}') fd=$(lsof | grep text.txt | awk '/deleted/ {print $4}' | grep -oE "[[:digit:]]{1,}")  cp /proc/$pid/fd/$fd directorytobecopied/testfile.txt   This is what I am doing to recover the file and put it back where it was. Is there any simpler way of doing this because above code doesn't look good. Furthermore how do I know from where the file was deleted(directorytobecopied) so that I don't have to manually ask somebody where the file was located originialy and put it back there.
68863
I find the page numbers of a multiline pattern in a pdf file, by  and     $ pdfgrep -Pn '(?s)image\s+?not\s+?available'  main_text.pdf  49: image    not available 51: image    not available 53: image    not available 54: image    not available 55: image    not available   I would like to extract the page number only,  but because the pattern is multiline, I get  $ pdfgrep -Pn '(?s)image\s+?not\s+?available'  main_text.pdf | awk -F":" '{print $1}' 49    not available 51    not available 53    not available 54    not available 55    not available   instead of  49 51 53 54 55   I wonder how I can extract the page numbers only, regardless if the pattern is multiline? Thanks.
4294
I deleted lots of files &amp; folders on my laptop and then I put a new files in the same folders. I need to recover the deleted files. I tried a lot of recovery software and I couldn't recover my old files.   I read that if you refill the folders with new files after deleting old ones then I can't recover them again. Is that true?   What should I do?
114047
I just deleted some files from directory but deleting progress never ends, it happens often, once I didn't turn off pc 3 days and progress was still not finished.. what might be the problem?
54591
I scanned pen drive using clamscan and I closed the terminal after scanning without reading the result.   Now one of my folders on the pen drive is missing. I wanted to know if clamav deleted it.   So I want to view the last scan result.
61766
I recursively deleted the contents of my root directory with sudo privileges. My display reset, and windowing stopped working. I could no longer run non-buitin commands. Most of my directories (including the home directory disappeared).  What I meant to run:  sudo rm ./* -rf   What I believe I ran:  sudo rm /* -rf   I understand how this command works (see ).  I'm trying to get a better sense of how much (and what parts) of the original files and directory-structure physically remains on the hard-drive.  How much of these "remains" are recoverable? E.g is it possible to use data recovery software like TestDisk/PhotoRec to recover the full home dir itself? What about config files?
49090
I wish to recursively go through the folders of a directory structure and copy any .jpg I find into another directory.  I think I had the wrong idea with:  cp -R photos/*.jpg /cpjpg   How can I do this from the command line in Ubuntu?
95488
I have a directory which contains numbered image files, something like this:  01.png 02.png 03.png 03.svg 04.png 05.png 06.jpg 07.png 08.png 09.png 09.svg 10.png   Sometimes there may be multiple versions of a file in different formats (eg. a png and svg version of the 03 and 09 files above) but the numbers are otherwise consecutive.  Typically there are 40-80 such files in each directory.  The numbers correspond to the order these images appear in a manuscript (a Word document, but that's not important).  There is no other way to determine the order of the images.  If I add a new image to the manuscript I need to place a copy of the image in this directory with the correct numbering.  So if the new image is the fifth in the manuscript I need to rename the files in the directory to this in order to make room for it:  01.png 02.png 03.png 03.svg 04.png 06.png 07.jpg 08.png 09.png 10.png 10.svg 11.png   What is the most straightforward way from the command line, or from a script or macro to renumber all the files starting at a certain number?  I have a standard Fedora Linux install using bash.
62699
I'm working on a bash script that appends to /etc/profile but instead of appending, I accidentally wrote over it, losing all of its content. How can I restore the file?  I did search here but being new to Ubuntu, I don't know if the posted /etc/profile content I see in other questions is the default content.
20405
All of my images are in a single folder which are in excess of 1.6K. I want to make a batch of 30 images from the folder, and copy that batch over to its respective separate folder. The names of these folders can be anything, like folder1, folder2, fodler3, and so on. I have no idea how to approach the problem. I thought about writing a Python script to copy the files one by one and, as soon as the count reaches 30, change the folder. But I thought that maybe you guys have a better idea on how to do it with Bash.
91419
I'm trying to tidy-up my photos which are, for various historic reasons, scattered all over my system. To enable me to make a start on this task, I've been trying to use the command line to construct a list of all directories that contain one or more jpg files.  I'm certain that I don't have to be concerned about looking for other image file formats, but I do have to allow for jpg appearing in upper and lower case.  I'd like each directory name to appear only once in the final list.  To provide an example, if I have the following directories each of which contain one or more jpg or JPG files....  ~Mike/Pictures ~Mike/Pictures/London/Olympics ~Mike/Pictures/London ~Mike/Pictures/London/Holiday ~Mike/Photos ~Mike/Family History/Swaine   I'd like the results to appear with each directory listed only once - irrespective of the number of image files it might contain - preferably sorted and then written to a file  ~Mike/Family History/Swaine ~Mike/Photos ~Mike/Pictures ~Mike/Pictures/London ~Mike/Pictures/London/Holiday ~Mike/Pictures/London/Olympics   My command line skills are just not up to this!  I can use a lot of the simpler forms of single commands, but once they get complex and/or have to be piped things tend to go wrong.
52620
How can I use the following script to recursively convert a directory containing .mp4 to .png (1 frame only).  Right now it only converts the directory.  It's not recursive.  for i in *.mp4 do name=`echo "$i" | cut -d'.' -f1` echo "$name" ffmpeg -i "$i" -r 0.0033 -vf scale=-1:1024 -vcodec png "${name}.png" done
30711
I would like to help to my friend.  She opened a email, and after that, all files is transform to some encrypt format on she computer.  Every image, document extension replaced by .locky.  Now, after hours and hours searching on google I dosen't find any trusted way for she get back they files.  I hope we can find out something.  What I already tried:   Remove virus with programs: Malwerebytes, Hitmanpro, they dosen't find any result. I tried restore the system from the control panel.-Gess what, no restore points.. I tried shadowfile explorer, which capable search shadow files-No results. I tried rename files from .locky to original format like:png,jpg, etc.- Dosen't work either.   At this point I gived up, I need some help from a experted person.  We would like to target one specifick file types, images, like jpg, jpeg, png and others.  Is there anyway for we can recover this files, without for we need to pay to the hacker?  My friend does not have any backups of the files in question.
6003
I have a harddisk with two partitions: one for windows and one for data. I've reinstalled windows on the first partition and formatted the data partition with full format (without /Q option) making sure that all my data is backed up. After that I've created the same folder structure (without files inside) on data partition as it was before formatting.   I then realized that all my photos were NOT backed up :((((  I've tried several tools to recover my data without any success:   Wordershare Photo Recovery Active File Recovery R-Studio PhotoRec from CGSecurity Recuva   There are max 50Mb of new data on that partition, so data overwriting is minimal.  What is the reason why I'm not able to recover my data with data recovery tools: full format or same folder structure?  And... can I get my photos back or they are lost forever?
97948
I'm assuming this is fairly easy to do, but I have zero experience with Windows's command line utilities. Basically, I need to iterate over all files in a directory (great if it can do sub-directories, but I can run it on each of the 5 directories if need be), get the name as a variable, and have it run   "C:\Program Files\ImageMagick-6.7.6-Q16\convert.exe" -compress LZW     -colorspace Gray -colors 32 file_var file_var   I saw . Would I be able to use that (swapping the SET... with the above command)? The space on the computer in question is beyond limited so I can't perform a backup prior to running this at this stage (bad, I know).