Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Move folders containing certain files Post 302289981 by xavix on Saturday 21st of February 2009 03:49:37 AM
Old 02-21-2009
The above command will move Subfolder1 and Subfolder2 as they have the same modification date. What I would like to do is just move the Subfolder1 because it contains files with date 'Feb 13'.
Probably need to code more, with any kind of loop to make new dir in DestFolder taking the Subfolder name from an awk or sed and finally move the files and rmdir the empty Subfolder.
I'm taking a look to it
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to move files into different folders based on filename

I need to move a bunch of files into folders that have the same name. I wanted to either do this with some filter command or some type of batch file that I could save that would already include all of the mv commands since I will have to do this process often. Whatever method you think is easier. ... (7 Replies)
Discussion started by: italia5
7 Replies

2. Shell Programming and Scripting

Shell script to move files to 3 different folders

Hi guys: I've got this problem, I want to move a bunch of files to 3 different folders, without any specific order, and I'm trying to automatize it with a shell script. I'm a newbie at shell scripting so this is my first try: #!/bin/bash COUNTER=`ls -1 | wc -l` while do ARRAY=(... (11 Replies)
Discussion started by: wretchedmike
11 Replies

3. Shell Programming and Scripting

Move files to Folders

Hi Friends, Below is my requirement and i am not clear how to approach this issue in unix programming. I have a folder with 2500 files. The files are in below format. 1234_name1.txt 1234_name123.txt 4567_name1.txt 4567_name123.txt and i need a program which will read each file from this... (5 Replies)
Discussion started by: diva_thilak
5 Replies

4. Shell Programming and Scripting

Help with auto-detect new files/folders then zip and move script

Hello, I need a simple script to Auto-detect new files and folders in the directory. And then I need to zip the new files and bzip2 new folders and move them out of that folder where I am detecting changes to the other folder. Remember, I need simple one. If anyone could do it fast, I may... (1 Reply)
Discussion started by: juzt1s
1 Replies

5. Shell Programming and Scripting

Move all files but not folders to a new folder

Hi, I have a sub directory with a number of files and folders. What i want is a subdirectory with just folders and not files for cleanliness sake. So I want to move the files into the new folder but keep the folders in the same place. Move all files (but not folders) to new folder. I am... (4 Replies)
Discussion started by: Hopper_no1
4 Replies

6. Shell Programming and Scripting

Help to move folders, subfolders and files from unix to windows

Hi Unix Gurus, I am able to copy only files that exist in the parent folder. My parent folder has sub folders and within sub folders there are lots files. I need to copy folder, sub folders and files from Unix to the remote windows SFTP location. The directory structure is something like... (1 Reply)
Discussion started by: shankar1dada
1 Replies

7. Solaris

Move files into different folders based on its month

Hi All, I want to move the files in to different folders based on the files month in the file timestamp. For example All the september files in the directory should moves into the folder "sep_bkp_files" , August files in to aug_bkp_files folder... Please help me to achive the above... (10 Replies)
Discussion started by: velava
10 Replies

8. Shell Programming and Scripting

Script to move files in multiple folders

Hello all, I would appreciate any help to write a script. I have folder A which contains over 30 thousands xml files, I would like create multiple folders and move those files (500 in each folders). Thank you (1 Reply)
Discussion started by: mmsiddig
1 Replies

9. Shell Programming and Scripting

Move only folders and skipping files

How do I move all folders and its contents from a directory A to another directory B, skipping all files in Directory A ? ---------- Post updated at 12:53 PM ---------- Previous update was at 12:42 PM ---------- Ok. Got it. mv /A/*/ /B/ (1 Reply)
Discussion started by: DHeisenberg
1 Replies
The folder management API.(3)					      libmtp					     The folder management API.(3)

NAME
libmtp - The folder management API. Functions LIBMTP_folder_t * LIBMTP_new_folder_t (void) void LIBMTP_destroy_folder_t (LIBMTP_folder_t *) LIBMTP_folder_t * LIBMTP_Get_Folder_List (LIBMTP_mtpdevice_t *) LIBMTP_folder_t * LIBMTP_Get_Folder_List_For_Storage (LIBMTP_mtpdevice_t *, uint32_t const) LIBMTP_folder_t * LIBMTP_Find_Folder (LIBMTP_folder_t *, uint32_t const) uint32_t LIBMTP_Create_Folder (LIBMTP_mtpdevice_t *, char *, uint32_t, uint32_t) int LIBMTP_Set_Folder_Name (LIBMTP_mtpdevice_t *, LIBMTP_folder_t *, const char *) Detailed Description Function Documentation uint32_t LIBMTP_Create_Folder (LIBMTP_mtpdevice_t *device, char *name, uint32_tparent_id, uint32_tstorage_id) This create a folder on the current MTP device. The PTP name for a folder is 'association'. The PTP/MTP devices does not have an internal 'folder' concept really, it contains a flat list of all files and some file are 'associations' that other files and folders may refer to as its 'parent'. Parameters: device a pointer to the device to create the folder on. name the name of the new folder. Note this can be modified if the device does not support all the characters in the name. parent_id id of parent folder to add the new folder to, or 0 to put it in the root directory. storage_id id of the storage to add this new folder to. notice that you cannot mismatch storage id and parent id: they must both be on the same storage! Pass in 0 if you want to create this folder on the default storage. Returns: id to new folder or 0 if an error occured References DEVICE_FLAG_BROKEN_SEND_OBJECT_PROPLIST, LIBMTP_mtpdevice_struct::params, strip_7bit_from_utf8(), and LIBMTP_mtpdevice_struct::usbinfo. void LIBMTP_destroy_folder_t (LIBMTP_folder_t *folder) This recursively deletes the memory for a folder structure. This shall typically be called on a top-level folder list to detsroy the entire folder tree. Parameters: folder folder structure to destroy See Also: LIBMTP_new_folder_t() References LIBMTP_folder_struct::child, LIBMTP_destroy_folder_t(), LIBMTP_folder_struct::name, and LIBMTP_folder_struct::sibling. Referenced by LIBMTP_destroy_folder_t(), and LIBMTP_Get_Folder_List_For_Storage(). LIBMTP_folder_t* LIBMTP_Find_Folder (LIBMTP_folder_t *folderlist, uint32_tid) Helper function. Returns a folder structure for a specified id. Parameters: folderlist list of folders to search id of folder to look for Returns: a folder or NULL if not found References LIBMTP_folder_struct::child, LIBMTP_folder_struct::folder_id, LIBMTP_Find_Folder(), and LIBMTP_folder_struct::sibling. Referenced by LIBMTP_Find_Folder(). LIBMTP_folder_t* LIBMTP_Get_Folder_List (LIBMTP_mtpdevice_t *device) This returns a list of all folders available on the current MTP device. Parameters: device a pointer to the device to get the folder listing for. Returns: a list of folders References LIBMTP_Get_Folder_List_For_Storage(). LIBMTP_folder_t* LIBMTP_Get_Folder_List_For_Storage (LIBMTP_mtpdevice_t *device, uint32_t conststorage) This returns a list of all folders available on the current MTP device. Parameters: device a pointer to the device to get the folder listing for. storage a storage ID to get the folder list from Returns: a list of folders References LIBMTP_folder_struct::child, LIBMTP_folder_struct::folder_id, LIBMTP_destroy_folder_t(), LIBMTP_new_folder_t(), LIBMTP_folder_struct::name, LIBMTP_mtpdevice_struct::params, LIBMTP_folder_struct::parent_id, LIBMTP_folder_struct::sibling, and LIBMTP_folder_struct::storage_id. Referenced by LIBMTP_Get_Folder_List(). LIBMTP_folder_t* LIBMTP_new_folder_t (void) This creates a new folder structure and allocates memory for it. Notice that if you add strings to this structure they will be freed by the corresponding LIBMTP_folder_track_t operation later, so be careful of using strdup() when assigning strings, e.g.: Returns: a pointer to the newly allocated folder structure. See Also: LIBMTP_destroy_folder_t() References LIBMTP_folder_struct::folder_id. Referenced by LIBMTP_Get_Folder_List_For_Storage(). int LIBMTP_Set_Folder_Name (LIBMTP_mtpdevice_t *device, LIBMTP_folder_t *folder, const char *newname) This function renames a single folder. This simply means that the PTP_OPC_ObjectFileName property is updated, if this is supported by the device. Parameters: device a pointer to the device that contains the file. folder the folder metadata of the folder to rename. On success, the name member is updated. Be aware, that this name can be different than newname depending of device restrictions. newname the new name for this object. Returns: 0 on success, any other value means failure. References LIBMTP_folder_struct::folder_id, and LIBMTP_folder_struct::name. Author Generated automatically by Doxygen for libmtp from the source code. Version 1.1.3 Sun Feb 17 2013 The folder management API.(3)
All times are GMT -4. The time now is 03:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy