Archiv 3. November 2013

Sonntag, 3. November 2013

(Aus dem Archiv) Remove file types except those which contain ‚foobar‘

Der vorliegende Artikel habe ich ursprünglich irgendwann einmal ab 2002 auf meinem damaligen Linux-Entwicklungsserver im Web publiziert. Da ich das bloggen erst 2005 entdeckt habe, waren die Tipps in einer grossen HTML-Seite untergebracht. Anlässlich einer Aufräumaktion auf dem Server habe ich mich entschieden, die „Perlen“ über meine heutige Kommunikationsplattform ins Web zu posaunen. Seitdem ich die Artikel verfasst habe, sind viele Tage ins Land gegangen — ob der Artikel noch Gültigkeit hat, entscheidet der geneigte Leser selber.

My linux servers hosts my complete electronic Music Library, sharing it using daapd. All downloads come with a mess of additional files like covers, cue-sheets, nfo-files etc. Usually, I’m too lazy to get rid of’em directly after the download. As time passed by, everything got messed up with every new album I’ve leeched. Instead of going through every directory – and there are many of them – I used another fine find-command to remove anything not an mp3-file within my MP3-Folder:

find . -type f \! -name "*.mp3" -exec rm '{}' ';'

Tags: , ,
Labels: Linux

Keine Kommentare | neuen Kommentar verfassen

Sonntag, 3. November 2013

(Aus dem Archiv) Remove Apple-specific files

Der vorliegende Artikel habe ich ursprünglich irgendwann einmal ab 2002 auf meinem damaligen Linux-Entwicklungsserver im Web publiziert. Da ich das bloggen erst 2005 entdeckt habe, waren die Tipps in einer grossen HTML-Seite untergebracht. Anlässlich einer Aufräumaktion auf dem Server habe ich mich entschieden, die „Perlen“ über meine heutige Kommunikationsplattform ins Web zu posaunen. Seitdem ich die Artikel verfasst habe, sind viele Tage ins Land gegangen — ob der Artikel noch Gültigkeit hat, entscheidet der geneigte Leser selber.

.DS_Store contains information on how to display folders; e.g. list view. Such files are of no use for Linux- and Windows-users. The following command finds all .DS_Store-files in the current directory and every subdirectory and deletes it immediately. I put it in a cron-job, which is performed every five minutes.

find . -type f -name .DS_Store -exec rm -f '{}' ';'

The next thing is about these fucking Resource Forks. If I could, I would travel back through time and eliminate the person who created it. Anyway, they’re among us now, and we can’t get rid of’em. Well, at least they serve no needs on a Linux-server, so it’s (usually) safe to delete them. As example, if you drag photos from iPhoto to a Samba-Share, not only the JPGs are stored, but also ._-files with thumbnails in it. Well then, good bye little bastards:

find . -type f -name ._* -exec rm -f '{}' ';'

Tags: , , , , , , ,
Labels: Apple

Keine Kommentare | neuen Kommentar verfassen