Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Search for avi file, and play them with vlc - Bash script


#!/bin/bash
#In variable filename save result for find
filename="result.txt"

#use find command for search for file +1G search for file gt 1G
find /home/borko/ -maxdepth 6 -type f -name *.avi -size +1G > $filename &&

#If not result save data in file
if [ $? -ne 0 ]
then
date >> $filename

fi

#Function read line by line and play with vlc
while read line
do
name=$line
echo "Played - $line"
vlc "$name"
kill -9 vlc
done


#If you not use file do this in same line for play mp3 file:
find /home/borko/ -maxdepth 6 -type f -name *.mp3 -size -exec vlc {} \;
#This is a little function
mp3(){
cd "/home/borko/Музика/"
o=$IFS
IFS=$(echo -n "\n\b")
find -type f -name "*.mp3" -print0 | while read -d $'\0' name
do
`vlc $name`
done
IFS=o
}


This post first appeared on Linux Command's, please read the originial post: here

Share the post

Search for avi file, and play them with vlc - Bash script

×

Subscribe to Linux Command's

Get updates delivered right to your inbox!

Thank you for your subscription

×