I am trying to find the "Notes" backup from my iPhone in my folder ~/Library/Application\ Support/MobileSync/Backup/[UDID] which used to be in the sqlite file ca3bc056d4da0bbf88b5fb3be254f3b7147e639c. But since an update of the MacOS it is still there, but not updated anymore. (This is off topic, but probably somebody knows the right answer?)
My question: I would like to connect the commands find/ls -l with a pipe to file to get the following information of all files with size an type together (here an example for the old backup filename of Notes:
find . -type f -name "ca3*" -ls -print
12954433 2632 -rw-r--r-- 1 mstep staff 1347584 8 Mai 12:17 ./ca3bc056d4da0bbf88b5fb3be254f3b7147e639c
And this of course for all files of my iPhone-Backup. Fantastic would be, if a filter for a keyword like SQLite or XML would be possible, to get only these files. Is this possible?
If I understand what you're trying to do correctly (run the file utility with the pathnames of all regular files in the file hierarchy rooted in the current directory whose final component filenames contain the string SQLite or the string XML ), this should do what you want:
---------- Post updated 05-18-16 at 06:24 AM ---------- Previous update was 05-17-16 at 11:43 PM ----------
Thank you Don Cragun! No! this is not working. My posting was not clear! Mea culpa, sorry. In the backup folder of iPhone are only cryptic file names, and many of them like:
ls -lh | head
total 283624
8 -rw-r--r-- 1 mstep staff 228B 8 Mai 12:17 000cae3437db21095a85771716e6874f92ce7593
8 -rw-r--r-- 1 mstep staff 647B 18 Mai 06:00 0014310bf09a503606714f20a1c0602059a15e3d
24 -rw-r--r-- 1 mstep staff 8,8K 8 Mai 12:17 0026af8b0c56f79d958d8d59085db5e37328b6d2
144 -rw-r--r-- 1 mstep staff 71K 8 Mai 12:18 007f5d9bfb179f6e22c203eb1867379f6ebd29fe
16 -rw-r--r-- 1 mstep staff 7,6K 8 Mai 12:17 007fdf26e30550ee76f4ce0e238c63e544ade889
8 -rw-r--r-- 1 mstep staff 255B 12 Mai 22:13 012707a2ae34d77a28b16a9e443b780ea4e6b0aa
56 -rw-r--r-- 1 mstep staff 28K 8 Mai 12:17 015ff977c6cb9eb67b715f319bd9f8cec4e263bd
32 -rw-r--r-- 1 mstep staff 14K 16 Mai 22:43 01a14737bf725839e60201704f5e0447e23800a6
8 -rw-r--r-- 1 mstep staff 42B 8 Mai 12:17 02080c751f0cd98738a2e9ccf7c133f0197865fa
The file type is only discovered with the command
file
like follows:
file * | head
000cae3437db21095a85771716e6874f92ce7593: Apple binary property list
0014310bf09a503606714f20a1c0602059a15e3d: Apple binary property list
0026af8b0c56f79d958d8d59085db5e37328b6d2: Adaptive Multi-Rate Codec (GSM telephony)
007f5d9bfb179f6e22c203eb1867379f6ebd29fe: JPEG image data, JFIF standard 1.01
007fdf26e30550ee76f4ce0e238c63e544ade889: Adaptive Multi-Rate Codec (GSM telephony)
012707a2ae34d77a28b16a9e443b780ea4e6b0aa: Apple binary property list
015ff977c6cb9eb67b715f319bd9f8cec4e263bd: JPEG image data
01a14737bf725839e60201704f5e0447e23800a6: XML document text
02080c751f0cd98738a2e9ccf7c133f0197865fa: Apple binary property list
028402bab9ac2d1ff052d0aa85f71c8604975cf3: PNG image data, 431 x 768, 8-bit colormap, non-interlaced
my question is: how to connect the two commands to get at least following file informations:
size + type (SQLite or XML ...) and filename
To make a file filter to get only XML files, would be even better. I am unable to pass only the filenames through the pipe to
file
but keep all the informations of the preceding
ls
or
find
Is there a way to do it, or should I try with Perl?
You are genius! Wow! Really impressing. Why this is working without an opening parenthesis? I added one and it is working too. I am stumbled
*SQLite*|*XML*)
Greetings to all and thank you to all
marek
---------- Post updated at 11:53 AM ---------- Previous update was at 11:43 AM ----------
Thanks too to RudiC
I just saw your answer now. Your command looks completely logic and very elegant; its surly working on your computer, but not on my Mac and with tcsh - ah! and in bash too.