Hallo ich habe hier mal ne frage...,
Ich habe auf meinem Server etwas vor was ich aber noch ned geschafft hab umzu setzen,
also ich möchte auch meinem server Via Shell abfrage schauen ob in einem bestimmten Ordner MP3 Files vorhanden sind. Sofern diese vorhanden sind will ich Via Shell eine playliste erstellen lassen (dies ist kein Problem) dazu habe ich bei wer-weiss-was.de schon bei einer Frage den Code hier gefunden.
if [ `ls -1a|wc -l` ]; then echo 1; fi
diesen habe ich nun noch erweitert gehabt mit einem else und grep nach MP3
if [ `ls -1a|grep mp3|wc -l` ]; then echo 1; else echo leer; fi
so nun ist aber das Problem das er NUR nach MP3 Files suchen soll und wenn er Keine findet die dann die info leer ausgibt.
kann mir da wer helfen?
Ordnerinhalt abfragen per Shell auf debian
Re: Ordnerinhalt abfragen per Shell auf debian
Auflisten der MP3-Files:
Die Liste auswerten musst Du aber selbst ;)
Code: Select all
find /pfad/zum/ordner/ -type f -iname \*.mp3 -print0 | xargs -0 lsPayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
