10-16-2011
Deleting all files recursively from directories while ignoring one file type
Hi,
Seems like I need help again with a problem:
I want to delete all files from my lets say "Music" Directory inkluding all of the subfolders
except for .mp3 and .MP3 files.
I tried it with globalignoring mp3 files, finding and deleting all other files, which
resulted in all files in the Music Dir to get deleted leaving me with empty dirs.
Thanks in advance for any help
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Say I have a directory call test, and several directories nested in it, and several directories nested in them. And I want to remove all directories within "test" and its subdirectories that have the name "cvs", how can I do this?
I tried rm -r cvs, but that only removed the top level direcotry... (4 Replies)
Discussion started by: mikeshank
4 Replies
2. UNIX for Dummies Questions & Answers
How do I delete just the symbolic links in a directory? I have files that I wish to keep that have similar names, length and date/time. Can I use file size?
Thanks
kyle (4 Replies)
Discussion started by: kryan_toolboy
4 Replies
3. UNIX for Advanced & Expert Users
hi
This should be easy but i'm obviously missing something obvious. :)
I'm looking to delete files from yesterday and older of extension .txt and there a range of subfolders with these files in them. The command runs but doesn't delete anything. SUSE 10.
find /testfolder -maxdepth 2 -type f... (6 Replies)
Discussion started by: cmap
6 Replies
4. UNIX for Advanced & Expert Users
Can anyone see why the following command returns all files and not just the directories as specified?
find . -type d -exec ls -F {} \;
Also tried
find . -type d -name "*" -exec ls -F {} \;
find . -type d -name "*" -exec ls -F '{}' \; -print
Always returns all files :-\
OS is... (2 Replies)
Discussion started by: tuns99
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
Please help me, how to get all the direcotries, its sub directories and its sub directories recursively, need to exclude all the files in the process.
I wanted to disply using a unix command all the directories recursively excluding files.
I tried 'ls -FR' but that display files as... (3 Replies)
Discussion started by: pointers
3 Replies
6. Shell Programming and Scripting
I would like to transfer all files ending with .log from /tmp and to /tmp/archive (using find )
The directory structure looks like :-
/tmp
a.log
b.log
c.log
/abcd
d.log
e.log
When I tried the following command , it movies all the log files... (8 Replies)
Discussion started by: frintocf
8 Replies
7. Shell Programming and Scripting
Hi
Can someone assist in writing a script.
I have a filesystem named /sybase in my aix lpar.
When this filesystem becomes 94% full all the files and directories under /sybase/logs should be deleted immediately. :confused: (7 Replies)
Discussion started by: newtoaixos
7 Replies
8. Shell Programming and Scripting
I have directory path in which there are several sub directories. In all these sub dir there will be one env.cnf file. I want to copy this env.cnf file from
each sub dir's and place them in destination path by creating same filename as sub dir_env.cnf.
After copying env.cnf files from source... (4 Replies)
Discussion started by: Optimus81
4 Replies
9. Shell Programming and Scripting
i have directory dgf
in the dgf( some other Sub-dir are there)
00 01 02 03 04
in all the Sub directory there is a SG.csv ..
i want the scripts should run one by one Sub-dir and print the result for that particular Sub-dir ..then go to next Sub-Dir and print the result.......
please... (6 Replies)
Discussion started by: Aditya.Gurgaon
6 Replies
10. Shell Programming and Scripting
Hello,
I supposed that it was working fine but now I see that it's not working as expected.
I am running under ubuntu14.04, trusty.
My plan was to search folderA and all subdirectories and move any txt file to destination folder, folderB :
find /home/user/folderA/ -type f -iname "*.txt"... (0 Replies)
Discussion started by: baris35
0 Replies
LEARN ABOUT DEBIAN
mp3::tag::id3v1
MP3::Tag::ID3v1(3pm) User Contributed Perl Documentation MP3::Tag::ID3v1(3pm)
NAME
MP3::Tag::ID3v1 - Module for reading / writing ID3v1 tags of MP3 audio files
SYNOPSIS
MP3::Tag::ID3v1 is designed to be called from the MP3::Tag module.
use MP3::Tag;
$mp3 = MP3::Tag->new($filename);
# read an existing tag
$mp3->get_tags();
$id3v1 = $mp3->{ID3v1} if exists $mp3->{ID3v1};
# or create a new tag
$id3v1 = $mp3->new_tag("ID3v1");
See MP3::Tag for information on the above used functions.
* Reading the tag
print " Title: " .$id3v1->title . "
";
print " Artist: " .$id3v1->artist . "
";
print " Album: " .$id3v1->album . "
";
print "Comment: " .$id3v1->comment . "
";
print " Year: " .$id3v1->year . "
";
print " Genre: " .$id3v1->genre . "
";
print " Track: " .$id3v1->track . "
";
# or at once
@tagdata = $mp3->all();
foreach $tag (@tagdata) {
print $tag;
}
* Changing / Writing the tag
$id3v1->comment("This is only a Test Tag");
$id3v1->title("testing");
$id3v1->artist("Artest");
$id3v1->album("Test it");
$id3v1->year("1965");
$id3v1->track("5");
$id3v1->genre("Blues");
# or at once
$id3v1->all("song title","artist","album","1900","comment",10,"Ska");
$id3v1->write_tag();
* Removing the tag from the file
$id3v1->remove_tag();
AUTHOR
Thomas Geffert, thg@users.sourceforge.net
DESCRIPTION
title(), artist(), album(), year(), comment(), track(), genre()
$artist = $id3v1->artist;
$artist = $id3v1->artist($artist);
$album = $id3v1->album;
$album = $id3v1->album($album);
$year = $id3v1->year;
$year = $id3v1->year($year);
$comment = $id3v1->comment;
$comment = $id3v1->comment($comment);
$track = $id3v1->track;
$track = $id3v1->track($track);
$genre = $id3v1->genre;
$genre = $id3v1->genre($genre);
Use these functions to retrieve the date of these fields, or to set the data.
$genre can be a string with the name of the genre, or a number describing the genre.
all()
@tagdata = $id3v1->all;
@tagdata = $id3v1->all($title, $artist, $album, $year, $comment, $track, $genre);
Returns all information of the tag in a list. You can use this sub also to set the data of the complete tag.
The order of the data is always title, artist, album, year, comment, track, and genre. genre has to be a string with the name of the
genre, or a number identifying the genre.
fits_tag()
warn "data truncated" unless $id3v1->fits_tag($hash);
Check whether the info in ID3v1 tag fits into the format of the file.
as_bin()
$str = $id3v1->as_bin();
Returns the ID3v1 tag as a string.
write_tag()
$id3v1->write_tag();
[old name: writeTag() . The old name is still available, but you should use the new name]
Writes the ID3v1 tag to the file.
remove_tag()
$id3v1->remove_tag();
Removes the ID3v1 tag from the file. Returns negative on failure, FALSE if no tag was found.
(Caveat: only one tag is removed; some - broken - files may have many chain-loaded one after another; you may need to call remove_tag()
in a loop to handle such beasts.)
[old name: removeTag() . The old name is still available, but you should use the new name]
genres()
@allgenres = $id3v1->genres;
$genreName = $id3v1->genres($genreID);
$genreID = $id3v1->genres($genreName);
Returns a list of all genres, or the according name or id to a given id or name.
new()
$id3v1 = MP3::Tag::ID3v1->new($mp3fileobj[, $create]);
Generally called from MP3::Tag, because a $mp3fileobj is needed. If $create is true, a new tag is created. Otherwise undef is
returned, if now ID3v1 tag is found in the $mp3obj.
Please use
$mp3 = MP3::Tag->new($filename);
$id3v1 = $mp3->new_tag("ID3v1"); # Empty new tag
or
$mp3 = MP3::Tag->new($filename);
$mp3->get_tags();
$id3v1 = $mp3->{ID3v1}; # Existing tag (if present)
instead of using this function directly
SEE ALSO
MP3::Tag, MP3::Tag::ID3v2
ID3v1 standard - http://www.id3.org
COPYRIGHT
Copyright (c) 2000-2004 Thomas Geffert. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, distributed with Perl.
perl v5.14.2 2009-11-28 MP3::Tag::ID3v1(3pm)