ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have following files inside a directory, e.g.;
/parent_directory/
package-01
package-02
package-03
etc.
file-01.patch
file-02.patch
file-03.patch
etc.
What single command line shall I use to send all .patches to a new sub_directory
/parent_directory/patches/
and all packages to a new sub_directory
/parent_directory/packages/
respectively. Both sub_directories have to be created in executing the command line.
For .patch file there will be no problem. But for "packages file" they have variable name without a fixed patent.
Can I apply follwing command line so that all .patch files will be moved first to /parent_directory/patches/ and then all remaining files moved to /parent_directory/packages/ afterwards
Yes, you can do that. Of course, if there are any files in that directory that aren't patches or packages, they will also be moved to the packages dir.
Also, if there are two or three patterns to the package names, you could make use of that like this (as the last command):
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.