Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to move all files in a directory and subdirectory? Post 302535668 by Straitsfan on Friday 1st of July 2011 11:02:35 AM
Old 07-01-2011
How to move all files in a directory and subdirectory?

I'm trying to organize my MB Pro by moving all my jpeg files to a single folder from the desktop. There are some on the desktop that are not in any folder. I was at the command line and typed
Code:
mv *.jpg "Jpeg files"

but it only moved the files that were on the desktop, not any of the ones that were in any subdirectories. I'm forgetting something here -- can someone tell me how to get all the jpeg files (or any other files of a type, for that matter) -- no matter which subdirectory they're in -- and move them to the designated folder I want?

Last edited by Franklin52; 07-04-2011 at 04:04 AM.. Reason: Please use code tags for code and data samples, thank you
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find files in directory and its subdirectory

I am writing a script which reads a file line by line and then assigns it to a variable like this 1090373422_4028715212.jpg. I have images with file name of this format in some other directory. In my script I want to assign variable with this file name and then find this filename in some other... (11 Replies)
Discussion started by: jyotib
11 Replies

2. Shell Programming and Scripting

Move all files not in a directory into a subdirectory named for each given file

Hi Everyone! Looking for some help with a script that will take all files in any given root folder (which are not already in a folder) and put them into separate folders with the name of each given file. Any ideas? Thank you! (1 Reply)
Discussion started by: DanTheMan
1 Replies

3. Solaris

Display the number of files in a directory and recursively in each subdirectory

Display the number of files in a directory and recursively in each subdirectory To look something like below, for example /var 35 /var/tmp 56 /var/adm 46 Any ideas how can we do this? :wall: (1 Reply)
Discussion started by: jakerock
1 Replies

4. Solaris

Display the number of files in a directory and recursively in each subdirectory

Display the number of files in a directory and recursively in each subdirectory To look something like below, for example /var 35 /var/tmp 56 /var/adm 46Any ideas how can we do this? Got a sun cluser global mount point which takes ages to mount everytime, need to understand... (5 Replies)
Discussion started by: jakerock
5 Replies

5. Shell Programming and Scripting

Changing ownership of a directory, subdirectory and files as same as in another server

accidentally i have changed ownership of a directory,subdirectory and files wil below command. I want to the change ownership back as same as in same directory on another server. How can i do it? chown -R user:group /u01 is there any simple script? it is really an urgent need.. (2 Replies)
Discussion started by: johnveslin
2 Replies

6. Shell Programming and Scripting

Globbling files in the direct subdirectory of the current directory

I want to list files that end with .c in the direct subdirectory of the current directory. I have tried the following command: find ./ -mindepth 2 -maxdepth 2 -name "*.c" Is that right? Or is there any easier way to handle that problem? Another problem is that I want to grep in a file to find... (5 Replies)
Discussion started by: Ray Sun
5 Replies

7. Shell Programming and Scripting

Remove all files except the subdirectory(without pattern) in a directory

I used rm * and it deleted the files in the directory but gives and error message for unsuccessful subdirectory deletion. "rm: cannot remove 'DirectoryName': Is a directory" I dont want to explicitly get the above error. What are the modifications I have to do in the rm command? (3 Replies)
Discussion started by: duplicate
3 Replies

8. Shell Programming and Scripting

How to move to the last subdirectory one by one?

Hi, How can i traverse to the last subfolder in all the directories. eg: i have the below folders structure f1/sf1/r1 f2/sf2/r2 f3/sf3/r3/r4 i need to move to the last directory in each directory. Can anyone tell me a solution for this? I saw an example that does that. find . -type... (2 Replies)
Discussion started by: Little
2 Replies

9. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

10. UNIX for Dummies Questions & Answers

How to move gz files from one source directory to destination directory?

Hi All, Daily i am doing the house keeping in one of my server and manually moving the files which were older than 90 days and moving to destination folder. using the find command . Could you please assist me how to put the automation using the shell script . ... (11 Replies)
Discussion started by: venkat918
11 Replies
rmf(1)							      General Commands Manual							    rmf(1)

NAME
rmf - remove folder (only available within the message handling system, mh) SYNOPSIS
rmf [+folder] [-help] [-[no]interactive] OPTIONS
Prints a list of the valid options to this command. Asks for confirmation before deleting a folder. By default, rmf deletes a folder and its messages without asking for confirmation. If you specify the -interactive option, rmf asks if you are sure before deleting the folder. You are advised to use this option, since when rmf deletes a folder its contents are lost irretrievably. DESCRIPTION
The rmf command removes all of the messages within the current folder, and then removes the folder itself. If there are any files within the folder which are not part of MH, they are not removed, and an error message is displayed. You can specify a folder other than the current folder by using the +folder argument. If you do not specify a folder, and rmf cannot find the current folder,rmf asks you whether you want to delete +inbox instead. If the current folder is removed, it makes +inbox current. Note that the rmf command irreversibly deletes messages that do not have other links, so use it with caution. If the folder being removed is a sub-folder, the parent folder becomes the new current folder, and rmf tells you that this has happened. This provides an easy mechanism for selecting a set of messages, operating on the list, then removing the list and returning to the current folder from which the list was extracted. Using rmf to delete a read-only folder deletes the private sequence and current message information from the file, without affecting the folder itself. If you have sub-folders within a folder, you must delete all the sub-folders before you can delete the folder itself. PROFILE COMPONENTS
Path: To determine the user's Mail directory EXAMPLES
This example shows how rmf asks for confirmation when the -interactive option is used: % rmf -interactive +test Remove folder "test"? y FILES
The user profile. SEE ALSO
rmm(1) rmf(1)
All times are GMT -4. The time now is 12:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy