moving files to a folder and zip the folder
Clash Royale CLAN TAG#URR8PPP
I have to zip a few files induvidually from folder A and move them to folder B on the same directory which takes lot of time. So I thought of moving all those files to be zipped to a new folder(c), zip it and move it to folder B . Is it possible to do it with few commands? suggestions are welcomed.
zip gzip mv
add a comment |
I have to zip a few files induvidually from folder A and move them to folder B on the same directory which takes lot of time. So I thought of moving all those files to be zipped to a new folder(c), zip it and move it to folder B . Is it possible to do it with few commands? suggestions are welcomed.
zip gzip mv
3
Your question is very hard to understand. Please edit and show us an example of the files and directories involved.
– terdon♦
Oct 6 '14 at 22:42
add a comment |
I have to zip a few files induvidually from folder A and move them to folder B on the same directory which takes lot of time. So I thought of moving all those files to be zipped to a new folder(c), zip it and move it to folder B . Is it possible to do it with few commands? suggestions are welcomed.
zip gzip mv
I have to zip a few files induvidually from folder A and move them to folder B on the same directory which takes lot of time. So I thought of moving all those files to be zipped to a new folder(c), zip it and move it to folder B . Is it possible to do it with few commands? suggestions are welcomed.
zip gzip mv
zip gzip mv
edited Oct 9 '14 at 3:01
Community♦
1
1
asked Oct 6 '14 at 22:33
Boo NaBoo Na
1112
1112
3
Your question is very hard to understand. Please edit and show us an example of the files and directories involved.
– terdon♦
Oct 6 '14 at 22:42
add a comment |
3
Your question is very hard to understand. Please edit and show us an example of the files and directories involved.
– terdon♦
Oct 6 '14 at 22:42
3
3
Your question is very hard to understand. Please edit and show us an example of the files and directories involved.
– terdon♦
Oct 6 '14 at 22:42
Your question is very hard to understand. Please edit and show us an example of the files and directories involved.
– terdon♦
Oct 6 '14 at 22:42
add a comment |
3 Answers
3
active
oldest
votes
Possibly a shell type of script could help you:
enter code here
mv <file.a>...<file.n> <new_folder>
zip -r <new_folder>
mv new_folder.zip /destination_folder
add a comment |
cp -R (the path of the folder to copy) (the name of the copied file)
then
zip -r (name your zip) (the name of the copied file)
Example scenario:
Let's say that I want to copy the plugins of a WordPress installation and after zip them (while I'm in the root folder of WordPress).
I will do:
cp -R wp-content/plugins plugins_backup
then to check I'll do:
ls -la
I will see the new directory plugins_backup, and I will zip it:
zip -r plugins_backup.zip plugins_backup
ready. (then follow the answer of mv to move it anywhere).
add a comment |
Somehow I've been ignorant all this time of the FUSE plug-in for ZIP file support. It allows the user to mount (or create) a ZIP file as though it were a read/write filesystem.
First create a new (empty) file ending in .zip and mount it on /mnt. Since you want the ZIP file to eventually end up in folder_B, we'll create it there:
# rm -f /folder_B/my_files.zip
# fuse-zip /folder_B/my_files.zip /mnt
Your post isn't clear, but it sounds like you want the .ZIP file to contain folder_C, and then all your files reside there. So we'll create folder_C inside the .ZIP file that's on /mnt:
# mkdir /mnt/folder_C
Now you can simply go into folder_A and move all the files you want to be zipped into /mnt/folder_C:
# cd /folder_A
# mv file1 file2 ... fileN /mnt/folder_C
Finally, unmount and inspect the ZIP file:
# umount /mnt
# unzip -v /folder_B/my_files.zip
I realize this looks convoluted, but the basic four steps are:
# fuse-zip /folder_B/my_files.zip /mnt
# mkdir /mnt/folder_C
# mv /folder_A/file1 /folder_A/file2 ... /folder_A/fileN /mnt/folder_C
# umount /mnt
I don't mean to imply this is method is any better nor worse than the other solutions, just a different way to do it. I hope you find it interesting.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f159712%2fmoving-files-to-a-folder-and-zip-the-folder%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Possibly a shell type of script could help you:
enter code here
mv <file.a>...<file.n> <new_folder>
zip -r <new_folder>
mv new_folder.zip /destination_folder
add a comment |
Possibly a shell type of script could help you:
enter code here
mv <file.a>...<file.n> <new_folder>
zip -r <new_folder>
mv new_folder.zip /destination_folder
add a comment |
Possibly a shell type of script could help you:
enter code here
mv <file.a>...<file.n> <new_folder>
zip -r <new_folder>
mv new_folder.zip /destination_folder
Possibly a shell type of script could help you:
enter code here
mv <file.a>...<file.n> <new_folder>
zip -r <new_folder>
mv new_folder.zip /destination_folder
edited Oct 6 '14 at 22:59
answered Oct 6 '14 at 22:36
vembutechvembutech
26515
26515
add a comment |
add a comment |
cp -R (the path of the folder to copy) (the name of the copied file)
then
zip -r (name your zip) (the name of the copied file)
Example scenario:
Let's say that I want to copy the plugins of a WordPress installation and after zip them (while I'm in the root folder of WordPress).
I will do:
cp -R wp-content/plugins plugins_backup
then to check I'll do:
ls -la
I will see the new directory plugins_backup, and I will zip it:
zip -r plugins_backup.zip plugins_backup
ready. (then follow the answer of mv to move it anywhere).
add a comment |
cp -R (the path of the folder to copy) (the name of the copied file)
then
zip -r (name your zip) (the name of the copied file)
Example scenario:
Let's say that I want to copy the plugins of a WordPress installation and after zip them (while I'm in the root folder of WordPress).
I will do:
cp -R wp-content/plugins plugins_backup
then to check I'll do:
ls -la
I will see the new directory plugins_backup, and I will zip it:
zip -r plugins_backup.zip plugins_backup
ready. (then follow the answer of mv to move it anywhere).
add a comment |
cp -R (the path of the folder to copy) (the name of the copied file)
then
zip -r (name your zip) (the name of the copied file)
Example scenario:
Let's say that I want to copy the plugins of a WordPress installation and after zip them (while I'm in the root folder of WordPress).
I will do:
cp -R wp-content/plugins plugins_backup
then to check I'll do:
ls -la
I will see the new directory plugins_backup, and I will zip it:
zip -r plugins_backup.zip plugins_backup
ready. (then follow the answer of mv to move it anywhere).
cp -R (the path of the folder to copy) (the name of the copied file)
then
zip -r (name your zip) (the name of the copied file)
Example scenario:
Let's say that I want to copy the plugins of a WordPress installation and after zip them (while I'm in the root folder of WordPress).
I will do:
cp -R wp-content/plugins plugins_backup
then to check I'll do:
ls -la
I will see the new directory plugins_backup, and I will zip it:
zip -r plugins_backup.zip plugins_backup
ready. (then follow the answer of mv to move it anywhere).
answered Aug 31 '17 at 12:40
StefanoWPStefanoWP
112
112
add a comment |
add a comment |
Somehow I've been ignorant all this time of the FUSE plug-in for ZIP file support. It allows the user to mount (or create) a ZIP file as though it were a read/write filesystem.
First create a new (empty) file ending in .zip and mount it on /mnt. Since you want the ZIP file to eventually end up in folder_B, we'll create it there:
# rm -f /folder_B/my_files.zip
# fuse-zip /folder_B/my_files.zip /mnt
Your post isn't clear, but it sounds like you want the .ZIP file to contain folder_C, and then all your files reside there. So we'll create folder_C inside the .ZIP file that's on /mnt:
# mkdir /mnt/folder_C
Now you can simply go into folder_A and move all the files you want to be zipped into /mnt/folder_C:
# cd /folder_A
# mv file1 file2 ... fileN /mnt/folder_C
Finally, unmount and inspect the ZIP file:
# umount /mnt
# unzip -v /folder_B/my_files.zip
I realize this looks convoluted, but the basic four steps are:
# fuse-zip /folder_B/my_files.zip /mnt
# mkdir /mnt/folder_C
# mv /folder_A/file1 /folder_A/file2 ... /folder_A/fileN /mnt/folder_C
# umount /mnt
I don't mean to imply this is method is any better nor worse than the other solutions, just a different way to do it. I hope you find it interesting.
add a comment |
Somehow I've been ignorant all this time of the FUSE plug-in for ZIP file support. It allows the user to mount (or create) a ZIP file as though it were a read/write filesystem.
First create a new (empty) file ending in .zip and mount it on /mnt. Since you want the ZIP file to eventually end up in folder_B, we'll create it there:
# rm -f /folder_B/my_files.zip
# fuse-zip /folder_B/my_files.zip /mnt
Your post isn't clear, but it sounds like you want the .ZIP file to contain folder_C, and then all your files reside there. So we'll create folder_C inside the .ZIP file that's on /mnt:
# mkdir /mnt/folder_C
Now you can simply go into folder_A and move all the files you want to be zipped into /mnt/folder_C:
# cd /folder_A
# mv file1 file2 ... fileN /mnt/folder_C
Finally, unmount and inspect the ZIP file:
# umount /mnt
# unzip -v /folder_B/my_files.zip
I realize this looks convoluted, but the basic four steps are:
# fuse-zip /folder_B/my_files.zip /mnt
# mkdir /mnt/folder_C
# mv /folder_A/file1 /folder_A/file2 ... /folder_A/fileN /mnt/folder_C
# umount /mnt
I don't mean to imply this is method is any better nor worse than the other solutions, just a different way to do it. I hope you find it interesting.
add a comment |
Somehow I've been ignorant all this time of the FUSE plug-in for ZIP file support. It allows the user to mount (or create) a ZIP file as though it were a read/write filesystem.
First create a new (empty) file ending in .zip and mount it on /mnt. Since you want the ZIP file to eventually end up in folder_B, we'll create it there:
# rm -f /folder_B/my_files.zip
# fuse-zip /folder_B/my_files.zip /mnt
Your post isn't clear, but it sounds like you want the .ZIP file to contain folder_C, and then all your files reside there. So we'll create folder_C inside the .ZIP file that's on /mnt:
# mkdir /mnt/folder_C
Now you can simply go into folder_A and move all the files you want to be zipped into /mnt/folder_C:
# cd /folder_A
# mv file1 file2 ... fileN /mnt/folder_C
Finally, unmount and inspect the ZIP file:
# umount /mnt
# unzip -v /folder_B/my_files.zip
I realize this looks convoluted, but the basic four steps are:
# fuse-zip /folder_B/my_files.zip /mnt
# mkdir /mnt/folder_C
# mv /folder_A/file1 /folder_A/file2 ... /folder_A/fileN /mnt/folder_C
# umount /mnt
I don't mean to imply this is method is any better nor worse than the other solutions, just a different way to do it. I hope you find it interesting.
Somehow I've been ignorant all this time of the FUSE plug-in for ZIP file support. It allows the user to mount (or create) a ZIP file as though it were a read/write filesystem.
First create a new (empty) file ending in .zip and mount it on /mnt. Since you want the ZIP file to eventually end up in folder_B, we'll create it there:
# rm -f /folder_B/my_files.zip
# fuse-zip /folder_B/my_files.zip /mnt
Your post isn't clear, but it sounds like you want the .ZIP file to contain folder_C, and then all your files reside there. So we'll create folder_C inside the .ZIP file that's on /mnt:
# mkdir /mnt/folder_C
Now you can simply go into folder_A and move all the files you want to be zipped into /mnt/folder_C:
# cd /folder_A
# mv file1 file2 ... fileN /mnt/folder_C
Finally, unmount and inspect the ZIP file:
# umount /mnt
# unzip -v /folder_B/my_files.zip
I realize this looks convoluted, but the basic four steps are:
# fuse-zip /folder_B/my_files.zip /mnt
# mkdir /mnt/folder_C
# mv /folder_A/file1 /folder_A/file2 ... /folder_A/fileN /mnt/folder_C
# umount /mnt
I don't mean to imply this is method is any better nor worse than the other solutions, just a different way to do it. I hope you find it interesting.
answered Jan 4 at 21:23
Jim L.Jim L.
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f159712%2fmoving-files-to-a-folder-and-zip-the-folder%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
Your question is very hard to understand. Please edit and show us an example of the files and directories involved.
– terdon♦
Oct 6 '14 at 22:42