Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What are the command used to find many files at the same time ? Do you know a program can make many files search at the same time?

user-image
Question added by Deleted user
Date Posted: 2014/02/24
ghilman ahmed
by ghilman ahmed , System Administrator , Streaming Networks Pvt Ltd

Find command can be used to find multiple type of files using diffrent patternsfor example below mentioned command searches for files ending with .txt having123 in the file name and files with prefix of file_.find . -type f \\( -name "*.txt" -o -name "*123*" -o -name "file_*" \\)

Akash Dubey
by Akash Dubey , Senior Technical Lead , Fulcrum Software Worldwide Pvt. Ltd.

unless you need to search a package under a package more appropriate is 'locate <filename>' , on debian based OS's it may not be available by default so you can do  'apt-get install locate' or 'aptitude install locate' also locate is dependent on its internal file database which needs to be updated periodically, run updatedb which will update the locate db and after this you can run locate 'partial string' and this will search all mount points for any file which contains the string partially or fully ( grep -i like effect :))

Deleted user
by Deleted user

bsm alah alrahman alrahim

 

To Find a  program use one of the following commands :

 

 $ dpkg - l | grep < program name or just first letters you remmber from the program name >

 

observe some times you can't use tab key with grep ( hang )

 

or use this command :

 

$ sudo apt-cache policy < program name or just first letters you remmber from the program name and use tab key to compleat the name  >

 

To Find many files at the same time use the following command :

 

$ sudo find -name "file name " -o -name "file name"

 

observe file name can be just a part of the name , but you must put " * " with the name , ( eg chor* , chor*.deb , chor*.* , etc )

 

 To Copy or Move Many Files at the same Time use the foloowing commands :

 

For Copy :

 

 $ sudo cp -t  < DESTINATION Folder name >  file1 file2 file3 ..... etc

 

For Move :

 

 $ sudo mv -t  < DESTINATION Folder name >  file1 file2 file3 ..... etc

 

observe example file1 can be like that  /home/accountName/Desktop/FileName

 

 

To make find  command and copy command with one click use bash script like the foolowing Ex :

 

#!/bin/bashsudo find -name "dru*.deb" -o -name "wordp*.deb" > /home/adam/Desktop/hh.shsudo cp -t /home/adam/Desktop/adamCopy/ /var/cache/apt/archives/drupal7_7.25-0ubuntu1ppa1_all.deb /home/adam/Desktop/adamCopy/wordpress-l10n_3.3.1+dfsg-1_all.deb

More Questions Like This