My current path is /Users/UserName/Downloads/Downloaded_Path. In Downloaded_Path Folder i have multiple folders like F1, F2 etc and each folder contain rar part-files from rar to r99. What I want to do is to list all files which are either rar or r* extension type and copy them from those respective folder to a new folder.


It's very easy to do,

The * acts as a wildcard so that we are copying every files that has .r in it ie 133.rar or 123.r99. The cp function more properly looks like this

cp /path/from/*.r* /path/to

Edit: upon re reading the question you will want to add the recursive tag -R

cp -R /path/from/*.r* path/to

More specifically for you

cp -R /Users/UserName/Downloads/Downloaded_Path/*.r* new/path/location

Additionally what you can do to list all these files as well is

ls  /Users/UserName/Downloads/Downloaded_Path/*.r*

ls allows for some tags to give you more information about the files being listed. -a -l -t Or -alt all together. -a shows all files including the files starting with . Or .. -l lists the files in a long format -t lists them in time order (in which I believe is last touched or modified) The following code will explain more about the ls tags if you want to read more about it.

man ls

Another helpful tip is to get out of man within terminal, just press the q button.



Open new Finder window. Then click on gear icon.

enter image description here

Press 'Show Search Criteria' and select 'Other'.

enter image description here

You'll have many choices, so simply enter 'ext' in the top right search field and check 'File Extension' to show in menu.

enter image description here

Then enter '.rar' in the field and select in Finder your 'Downloaded_Path' folder. That shall select all your .rar files. Then you can select them all and copy to desired location.

enter image description here

Hope this helps.

  • I just learned a little bit of mac. – Em Ae Jan 18 '16 at 6:34
  • I put .r* as extension and it is not listing any file. I am interested that it should list all files from .rar, r00 to .r92 – Em Ae Jan 18 '16 at 6:47
  • It's a shame but MacOS X Finder sucks in wildcard searches, that's true :( So the only option to use would be terminal command as Brett wrote in his answer. If for whatever reason you need GUI then you can use free app 'EasyFind' which supports wildcard searches. devontechnologies.com/products/freeware.html – Denis Rasulev Jan 18 '16 at 7:20
  • If you were only looking for a few different file extensions this would work out fine by just adding lines of search criteria and selecting any are true. Additionally you can just use the normal search bar at the top and input .r and it will list all files that end with .r or files that contain .r in it. This could work in certain situations but not in others. I'm bummed to see that Mac doesn't allow for wildcard searches like Windows does. – Brett Reinhard Jan 18 '16 at 7:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .