LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-29-2015, 08:32 AM   #1
Entropy1024
Member
 
Registered: Dec 2012
Location: UK
Distribution: Ubuntu 16 & 17
Posts: 131

Rep: Reputation: Disabled
Moving files not ending with a certain criteria


I'm trying to move files that do NOT end in .part into a sub-folder called test2. I have tried a couple of approaches but neither work.

I have tried
Code:
mv -type f !(*.part) /test2
Which does not work

I have also tried
Code:
find -type f ! -name "*.part" -exec mv -f {} \; /test2
Am I close? Certainly the code
Code:
find -type f ! -name "*.part"
returns the correct files, I just then need to move them to another folder.

Many thanks for any help
Tim
 
Old 10-29-2015, 08:48 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
The "\;" is a delimiter - make sure it is last.
 
1 members found this post helpful.
Old 10-29-2015, 09:08 AM   #3
Entropy1024
Member
 
Registered: Dec 2012
Location: UK
Distribution: Ubuntu 16 & 17
Posts: 131

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
The "\;" is a delimiter - make sure it is last.
Perfect, thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I find all files ending with a \r andrew777 Linux - General 4 09-24-2013 08:00 AM
[SOLVED] Simple bash script, moving files by criteria str1fe Linux - Newbie 9 10-24-2011 06:08 PM
Listing Files with Certain Criteria Nagglfar Linux - Newbie 3 03-06-2009 04:36 PM
How to make Simple Script to remove all files ending in mxm Marshalle Linux - General 2 12-25-2006 08:38 PM
Annoying files being created ending with ~ zwyrbla Linux - General 5 12-26-2004 02:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration