البحث عن كلمة او نص او محتوى معين في المجلدات والملفات

البحث عن كلمة او نص او محتوى معين في المجلدات والملفات

السلام عليكم ورحمة الله وبركاته 

البحث عن كلمة او محتوى ما في المجلدات والملفات

منذ مدة كنت اعاني من موضوع البحث عن اسماء او كلمات معينة ضمن آلاف الملفات الموجودة في جهاز الحاسوب وبحثت عبر الانترنت عن شيء يُحدث فرق معي في البحث بحيث لا يأخذ مني وقت وجهد لأجد ما ارغب بكل سهولة ويسر دون العناء في البحث مطولا في اروقة ومجلدات الحاسوب.  

الجهاز المستخدم في التجربة 

فاحببت مشاركتها معكم ولتكون في المفضلة لدي ضمن المقالات في الموقع مصدرنا اليوم من هذا الموقع . واتمنى ان يستفيد منه احد وتتم مشاركته٬بالنسبة في الوقت الراهن تم استخدام الاوامر في  جهاز “ماك برو” ففي المثال التالي تم تطبيقه على جهاز MackBook Pro نسخة الـ 13″ إنش من نظام التشغيل macOS Mojave 10.14.6  

الأوامر المستخدمة في عملية البحث عبر تطبيق Terminal

فمن الممكن ان لا تعمل للنسخ الاقدم او الاحدث ولكن على حد علمي انها ستعمل لانها تعتمد على الاوامر (commands) من النظام ذاته. ولكن حسب تجربتي فالأمر (command)  عمل معي في النسخة التي تم ذكرها.

الأمر التالي سينفعك للبحث عن كلمات معينة او اسماء او ارقام من داخل محتوى الملفات فعلى سبيل المثال اذا كنت ابحث عن كلمة او جملة ما ستظهر نتائج البحث عن مسار الملفات الموجودة داخل المجلدات الموجودة على جهاز الحاسوب المستخدم.

الأمر التالي يُمكنك من البحث في الجهاز بشكل عام فلم تخصص في عن المجلد الذي ترغب في البحث فيه محتواه او المجلدات الفرعية التي يضمها. حتى انه يظهر لك رسائل البريد الإلكتروني التي وصلت عبر برنامج “مايكروسوف اوت لوك “.
ولإظهار نتائج البحث يجب ان يكون البريد الإلكتروني المفعل فعليا هو البريد الإلكتروني الإفتراضي للتمكن من فتح البريد الإلكتروني.

افتح تطبيق او برنامج Terminal واكتب ادناه بعد كلمة mdfind تضع مسافة وبعدها الكلمة المراد البحث عنها.

mdfind الكلمة او النص المراد البحث عنه 

في حال رغبت في البحث عن كلمة معينة في مجلد محدد بإمكانك تحديد موقع المجلد للبحث من خلال المجلد كله مع المجلدات الفرعة. فالأمر التالي قد يساعدك. فلنفترض ان المجلد المراد البحث فيه عن الكلمة او النص موجود في المجلد Desktop الذي يحتوي المجلد الذي يراد من خلاله البحث عن المعلومات المطلوبة. بإمكانك البحث مع علامة الاقتباس أو بدونها سيعمل الامر سواء كانت الكلمة او النص باللغة العربية او الانجليزية. 

mdfind Desktop/documents “فاتورة” 

في حال كانت كلمات البحث غير متوفرة لن يتم عرض اي شي كأنك بدأت في سطر جديد لإعطاء امر آخر. 

أجهزة نظام التشغيل “وندوز” Windows

ومن الجهة الأخرى لأصحاب أجهزة نظام التشغيل “وندوز” Windows، فإمكانهم عبر النظام تفعيله بالطريقة التالية بالفيديو بحيث تبحث عن البيانات بكل سهولة سيتم فيما بعد تجربته وعرض التجربة في حال فشلت او نجحت او سيتم البحث ايضا عن طريق تطبيقها للأوامر CMD


وبالاسفل بإمكانك معرفة وقراءة المزيد عن الامر أعلاه وتم نسخ البيانات من المصدر الذي ذكره مسبقا لنظام macOS

mdfind
Spotlight search.
Syntax
mdfind [-live] [-count] [-onlyin directory] queryKey
query A string or query expression.
-0 Print an ASCII NUL character after each result path.
This is useful when used in conjunction with xargs -0.
-live Causes the mdfind command to provide live-updates to the
number of files matching the query. When an update causes the
query results to change the number of matches is updated.
The find can be cancelled by typing ctrl-C.
-count Output the total number of matches, instead of the path
to the matching items.
-onlyin dir Limit the scope of the search to the directory specified.
-literal Force the provided query string to be taken as a literal
query string, without interpretation.
-interpret Force the provided query string to be interpreted as if the
user had typed the string into the Spotlight menu.
For example, the string “search” would produce the following
query string:
(* = search* cdw || kMDItemTextContent = search* cdw)
Spotlight Keywords.
These can be included in the query expression to limit the type of documents returned:
Applications kind:application, kind:applications, kind:appAudio/Music kind:audio, kind:musicBookmarks kind:bookmark, kind:bookmarksContacts kind:contact, kind:contactsEmail kind:email, kind:emails, kind:mail message, kind:mail messagesFolders kind:folder, kind:foldersFonts kind:font, kind:fontsiCal Events kind:event, kind:eventsiCal To Dos kind:todo, kind:todos, kind:to do, kind:to dosImages kind:image, kind:imagesMovies kind:movie, kind:moviesPDF kind:pdf, kind:pdfsPreferences kind:system preferences, kind:preferencesPresentations kind:presentations, kind:presentationDate Keywords.
These can be included in the query expression to limit the age of documents returned:
date:today    $time.today()
date:yesterday .yesterday()
date:this week  .this_week()
date:this month .this_month()
date:this year  .this_year()
date:tomorrow  .tomorrow()
date:next month  .next_month()
date:next week  .next_week()
date:next year  .next_year()
Comparison Operators
By default mdfind will AND together elements of the query string.
(OR) To return items that match either word, use the pipe character: stringA|stringB
 (NOT) To exclude documents that match a string -string“equal”
== “equal”
!= “not equal”
< and > “less” or “more than”
<= and >= “less than or equal” or “more than or equal”
InRange(attributeName,minValue,maxValue) Numeric values within the range of minValue to maxValue in the specified attribute.
Whitespace is significant when building a query, use parentheses () to create groups.
Characters such as “ and ‘ in the value string should be escaped using the character
Value Comparison modifiers
kMDItemAuthors ==[c] “Steve”
To get a list of the available attributes for use in constructing queries, see mdimport(1), particularly the -X switch. Not all files are indexed by spotlight and not all file attributes are present on all files, image files, iCal files and music files all support different attributes.
Examples
Returns all files with any metadata attribute value matching the string “image”:
$ mdfind image
Return all files that contain “Len Deighton” in the kMDItemAuthor metadata attribute:
$ mdfind “kMDItemAuthor = ‘*Len Deighton*'”
Return all files with any metadata attribute value matching the string “skateboard”. The find continues to run after gathering the initial results, providing a count of the number of files that match the query.
$ mdfind -live skateboard
Return all Microsoft.Word document files:
$ mdfind “kMDItemContentType = ‘com.microsoft.word.doc'”
Return files where the composer name includes ‘Eno’ (non case sensitive search):
$ mdfind ‘kMDItemComposer = “*ENO*”c’
Return all image files matching the words ‘maude’ and ‘paris’:
$ mdfind “kind:images maude paris”
Return all the files that have been tagged as ‘Green’:
$ mdfind “kMDItemUserTags = Green”
Return all the documents created with any version of Pixelmator:
$ mdfind “kMDItemCreator = Pixelmator*”
Return all image files last edited yesterday:
$ mdfind “kind:image date:yesterday”
Return all files in the users home folder (~) that have been modified in the last 3 days:
$ mdfind -onlyin ~ ‘kMDItemFSContentChangeDate >= $time.today(-3)’

Modifier Description
c The comparison is case insensitive.
d The comparison is insensitive to diacritical marks.

kMDItemAuthors ==[c] “Steve”
To get a list of the available attributes for use in constructing queries, see mdimport(1), particularly the -X switch. Not all files are indexed by spotlight and not all file attributes are present on all files, image files, iCal files and music files all support different attributes.
Examples
Returns all files with any metadata attribute value matching the string “image”:
$ mdfind image
Return all files that contain “Len Deighton” in the kMDItemAuthor metadata attribute:
$ mdfind “kMDItemAuthor = ‘*Len Deighton*'”
Return all files with any metadata attribute value matching the string “skateboard”. The find continues to run after gathering the initial results, providing a count of the number of files that match the query.
$ mdfind -live skateboard
Return all Microsoft.Word document files:
$ mdfind “kMDItemContentType = ‘com.microsoft.word.doc'”
Return files where the composer name includes ‘Eno’ (non case sensitive search):
$ mdfind ‘kMDItemComposer = “*ENO*”c’
Return all image files matching the words ‘maude’ and ‘paris’:
$ mdfind “kind:images maude paris”
Return all the files that have been tagged as ‘Green’:
$ mdfind “kMDItemUserTags = Green”
Return all the documents created with any version of Pixelmator:
$ mdfind “kMDItemCreator = Pixelmator*”
Return all image files last edited yesterday:
$ mdfind “kind:image date:yesterday”
Return all files in the users home folder (~) that have been modified in the last 3 days:
$ mdfind -onlyin ~ ‘kMDItemFSContentChangeDate >= $time.today(-3)’
“The real voyage of discovery consists not in seeking new landscapes but in having new eyes” ~ Marcel Proust

Share files between Windows and Mac OS X

Share files between Windows and Mac OS X

Overview

To share files between any two machines they will need to be on the same network. The easiest way of doing this is connecting both machines to a common hub, switch, or router. A crossover cable can suffice as well, but it isn’t typically recommended as it has many limitations. Once the machines are connected under the same network, you can use either the Mac or the PC as the host.

Using Windows as the host

1. File sharing first needs to be enabled on the Windows machine. This process is different depending on the version of Windows.

  • Windows XP: Go to Control Panel, double click and run through the Network Setup Wizard.
  • Windows Vista: Go to Control Panel, Network and Sharing Center. Expand the File Sharing drop down and click Finally click “Turn on File and Printer Sharing”
  • Windows 7: Go to Control Panel, Network and Sharing Center. Go to Choose Homegroup and Sharing options, Change Advanced Sharing Settings. Finally click “Turn on File and Printer Sharing”.

2. Next, we need to connect to the windows machine from the Mac. You can do this in one of two ways:

  • Automatically: Open up a finder window, and on the left pane you will see shared machines under the “Shared” heading. Find the name of the windows machine you wish to share with. Clicking it will bring up a folder view where you can drag and drop files to/from the shared folder.
  • Manually: Select finder, and click Go > Connect to Server (Shortcut for this is Command+K). Type in the prefix smb:// followed by the ip address or hostname of the windows machine. For example: smb://192.168.1.102 or smb://MyPC

Using Mac OS X as the host

  1. File sharing first needs to be enabled on the Mac machine. To do this, go to System Preferences, and click on the Sharing category. OSX has a multitude of ways to serve files, but right now we are just concerned with sharing for windows. Click the check box next to “File Sharing”. Then, click the options button, and check the box next to “Share files and folders using SMB (Windows)”
  2. Next, make note of the address (IP or hostname) of the Mac. It will be listed at the top of the sharing window.
  3. Finally, we need to connect to the Mac machine from windows. Go to Start > Run (in Windows XP), or use the Quick Search bar (in Vista/Windows 7), and type in \ followed by the address of the Mac. For example: \192.168.1.102 or \MyMac