Sponsored Content
Top Forums Shell Programming and Scripting Find Directories That Do Not Contain A Certain File Post 302425609 by pseudocoder on Friday 28th of May 2010 03:23:52 PM
Old 05-28-2010
You could try this (from the a-z directory)
Code:
$ find . -type f -name "folder.jpg" > album_art
$ sed -ie 's/\/folder.jpg//' album_art
$ find . -type d | grep -vf album_art

 

10 More Discussions You Might Find Interesting

1. Programming

to find a file in set of directories

Hi, what is the command in unix to find a file abc.c in a directory which had n number of sub-directories. thanx (3 Replies)
Discussion started by: jazz
3 Replies

2. Shell Programming and Scripting

Find a file in sub-directories.. o/p just the path

Hello All, I am somehow stumped with this ting. 'Find' will sure show me.. but I want only thepath of all the occurences of the file in any of the sub-dirs.. Any help will be sincerely appreciated. thanx! (3 Replies)
Discussion started by: pranavagarwal
3 Replies

3. Shell Programming and Scripting

find directories

I am looking a script which will find garbase directories (10 char. long)..which need to delete empty dir excluding symlink and system directories. I tried this partial script but it just find directories create a file which contains link directories..can somebody help me to complete this... (4 Replies)
Discussion started by: ddk2oo5
4 Replies

4. UNIX for Dummies Questions & Answers

Copy file into directories and sub-directories

Hello- I need to copy a file into multiple directories, and each directory's sub-directories (of which there are 5) Currently, the parent directory is set up like this: dir1 sub-dir1 sub-dir2 sub-dir3 sub-dir4 sub-dir5 dir2 sub-dir1 sub-dir2 sub-dir3 ... (1 Reply)
Discussion started by: penlok
1 Replies

5. Shell Programming and Scripting

find directories that do NOT contain a certain file extension

for x in `find /vmfs/volumes/v01tstn01a01/ -type d`; do find $x -name '*.vmx' > /dev/null || echo $x; done; The goal of this is to find the subdirectories that do NOT contain a file with the extension of .vmx Any help would be great! (6 Replies)
Discussion started by: hodnov
6 Replies

6. Shell Programming and Scripting

How to find the recent file in many sub-directories?

Hi guys, Under my root directory there are many sub-directories which contains log file for every day of running. How can I find , in one command only, the recent log file in each sub-directory? For example, If I run the following: find . -name "exp_prod_*_*_yes_*_.log" -exec ls -ltr {} \;... (12 Replies)
Discussion started by: nir_s
12 Replies

7. Shell Programming and Scripting

How to find 777 permisson is there or not for Directories and sub-directories

Hi All, I am Oracle Apps Tech guy, I have a requirement to find 777 permission is there or not for all Folders and Sub-folders Under APPL_TOP (Folder/directory) with below conditions i) the directory names should start with xx..... (like xxau,xxcfi,xxcca...etc) and exclude the directory... (11 Replies)
Discussion started by: gagan4599
11 Replies

8. UNIX for Dummies Questions & Answers

Using grep command to find the pattern of text in all directories and sub-directories.

Hi all, Using grep command, i want to find the pattern of text in all directories and sub-directories. e.g: if i want to search for a pattern named "parmeter", i used the command grep -i "param" ../* is this correct? (1 Reply)
Discussion started by: vinothrajan55
1 Replies

9. UNIX for Dummies Questions & Answers

Getting directories resulted from Find in one file

Hi Need help for the following scenario. I am having two directories /tmp/a and /tmp/b. /tmp/a again has subdirectories /tmp/a/aa and /tmp/a/ab. I want to run a script from /tmp/b to search for a file user.lst in the folders /tmp/a/aa and /tmp/a/ab, if available, i want to make a file in... (3 Replies)
Discussion started by: sudeep.id
3 Replies

10. UNIX for Dummies Questions & Answers

[Solved] Find the newest file in two directories

Hi i have two directories and files inside them Directory 1: Directory 2: These files are the same but song.mp3 in Directory 1 is newer than song.mp3 in Directory 2, and work.txt in Directory 2 is newer than work.txt in Directory 1. Now is my question. How i can compare these files... (10 Replies)
Discussion started by: Falstaff
10 Replies
The audio/video album management API.(3)			      libmtp				  The audio/video album management API.(3)

NAME
libmtp - The audio/video album management API. Functions LIBMTP_album_t * LIBMTP_new_album_t (void) void LIBMTP_destroy_album_t (LIBMTP_album_t *) LIBMTP_album_t * LIBMTP_Get_Album_List (LIBMTP_mtpdevice_t *) LIBMTP_album_t * LIBMTP_Get_Album_List_For_Storage (LIBMTP_mtpdevice_t *, uint32_t const) LIBMTP_album_t * LIBMTP_Get_Album (LIBMTP_mtpdevice_t *, uint32_t const) int LIBMTP_Create_New_Album (LIBMTP_mtpdevice_t *, LIBMTP_album_t *const) int LIBMTP_Update_Album (LIBMTP_mtpdevice_t *, LIBMTP_album_t const *const) int LIBMTP_Set_Album_Name (LIBMTP_mtpdevice_t *, LIBMTP_album_t *, const char *) Detailed Description Function Documentation int LIBMTP_Create_New_Album (LIBMTP_mtpdevice_t *device, LIBMTP_album_t *constmetadata) This routine creates a new album based on the metadata supplied. If the tracks field of the metadata contains a track listing, these tracks will be added to the album. Parameters: device a pointer to the device to create the new album on. metadata the metadata for the new album. If the function exits with success, the album_id field of this struct will contain the new ID of the album. o metadata->parent_id should be set to the parent (e.g. folder) to store this track in. Since some devices are a bit picky about where files are placed, a default folder will be chosen if libmtp has detected one for the current filetype and this parameter is set to 0. If this is 0 and no default folder can be found, the file will be stored in the root folder. o metadata->storage_id should be set to the desired storage (e.g. memory card or whatever your device presents) to store this track in. Setting this to 0 will store the track on the primary storage. Returns: 0 on success, any other value means failure. See Also: LIBMTP_Update_Album() LIBMTP_Delete_Object() References LIBMTP_album_struct::album_id, LIBMTP_album_struct::artist, LIBMTP_album_struct::composer, LIBMTP_mtpdevice_struct::default_album_folder, LIBMTP_mtpdevice_struct::default_music_folder, LIBMTP_album_struct::genre, LIBMTP_album_struct::name, LIBMTP_album_struct::no_tracks, LIBMTP_album_struct::parent_id, LIBMTP_album_struct::storage_id, and LIBMTP_album_struct::tracks. void LIBMTP_destroy_album_t (LIBMTP_album_t *album) This recursively deletes the memory for an album structure Parameters: album structure to destroy See Also: LIBMTP_new_album_t() References LIBMTP_album_struct::artist, LIBMTP_album_struct::composer, LIBMTP_album_struct::genre, LIBMTP_album_struct::name, and LIBMTP_album_struct::tracks. LIBMTP_album_t* LIBMTP_Get_Album (LIBMTP_mtpdevice_t *device, uint32_t constalbid) This function retrieves an individual album from the device. Parameters: device a pointer to the device to get the album from. albid the unique ID of the album to retrieve. Returns: a valid album metadata or NULL on failure. See Also: LIBMTP_Get_Album_List() References LIBMTP_album_struct::album_id, LIBMTP_new_album_t(), LIBMTP_album_struct::no_tracks, LIBMTP_mtpdevice_struct::params, LIBMTP_album_struct::parent_id, LIBMTP_album_struct::storage_id, and LIBMTP_album_struct::tracks. LIBMTP_album_t* LIBMTP_Get_Album_List (LIBMTP_mtpdevice_t *device) This function returns a list of the albums available on the device. Parameters: device a pointer to the device to get the album listing from. Returns: an album list on success, else NULL. If there are no albums on the device, NULL will be returned as well. See Also: LIBMTP_Get_Album() References LIBMTP_Get_Album_List_For_Storage(). LIBMTP_album_t* LIBMTP_Get_Album_List_For_Storage (LIBMTP_mtpdevice_t *device, uint32_t conststorage_id) This function returns a list of the albums available on the device. You can filter on the storage ID. Parameters: device a pointer to the device to get the album listing from. storage_id ID of device storage (if null, all storages) Returns: an album list on success, else NULL. If there are no albums on the device, NULL will be returned as well. See Also: LIBMTP_Get_Album() References LIBMTP_album_struct::album_id, LIBMTP_new_album_t(), LIBMTP_album_struct::next, LIBMTP_album_struct::no_tracks, LIBMTP_mtpdevice_struct::params, LIBMTP_album_struct::parent_id, LIBMTP_album_struct::storage_id, and LIBMTP_album_struct::tracks. Referenced by LIBMTP_Get_Album_List(). LIBMTP_album_t* LIBMTP_new_album_t (void) This creates a new album metadata structure and allocates memory for it. Notice that if you add strings to this structure they will be freed by the corresponding LIBMTP_destroy_album_t operation later, so be careful of using strdup() when assigning strings. Returns: a pointer to the newly allocated metadata structure. See Also: LIBMTP_destroy_album_t() References LIBMTP_album_struct::album_id. Referenced by LIBMTP_Get_Album(), and LIBMTP_Get_Album_List_For_Storage(). int LIBMTP_Set_Album_Name (LIBMTP_mtpdevice_t *device, LIBMTP_album_t *album, const char *newname) This function renames a single album. This simply means that the PTP_OPC_ObjectFileName property is updated, if this is supported by the device. The album filename should nominally end with an extension like '.alb'. NOTE: if you want to change the metadata the device display about a playlist you must not use this function, use LIBMTP_Update_Album() instead! Parameters: device a pointer to the device that contains the file. album the album metadata of the album 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. See Also: LIBMTP_Update_Album() References LIBMTP_album_struct::album_id, and LIBMTP_album_struct::name. int LIBMTP_Update_Album (LIBMTP_mtpdevice_t *device, LIBMTP_album_t const *constmetadata) This routine updates an album based on the metadata supplied. If the tracks field of the metadata contains a track listing, these tracks will be added to the album in place of those already present, i.e. the previous track listing will be deleted. Parameters: device a pointer to the device to create the new album on. metadata the metadata for the album to be updated. notice that the field album_id must contain the apropriate album ID. Returns: 0 on success, any other value means failure. See Also: LIBMTP_Create_New_Album() LIBMTP_Delete_Object() References LIBMTP_album_struct::album_id, LIBMTP_album_struct::artist, LIBMTP_album_struct::composer, LIBMTP_album_struct::genre, LIBMTP_album_struct::name, LIBMTP_album_struct::no_tracks, and LIBMTP_album_struct::tracks. Author Generated automatically by Doxygen for libmtp from the source code. Version 1.1.3 Sun Feb 17 2013 The audio/video album management API.(3)
All times are GMT -4. The time now is 11:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy