(Perdón por spamear) He añadido el código necesario para comprobar y eliminar las carpetas vacias (Mi script es un grandísimo if xD) Y hecho esto, solo quedan añadir algunas extensiones mas para ordenar y ya estará listo para hornear :) Muchas gracias a todos y si a alguno le es útil pues mejor que mejor :) Saludos! ------------------------- #!/bin/sh #Organizer 0.5 MENSAJE=$"El script organizer.sh ordenará sus archivos por extensión en categorías, por favor, elija el directorio que quiere ordenar." HOME=$"/home" DWN=$"/home/Downloads" #Definiendo variable value=$(alert --idea "$MENSAJE" "$HOME" "$DWN" "Salir") #Comprobando que es el primer botón if [ "$value" = "$HOME" ]; then mkdir -p /boot/home/Videos ; mkdir -p /boot/home/Music ; mkdir -p /boot/home/Pdf ; mkdir -p /boot/home/Compress_Files ; mkdir -p /boot/home/Text ; mkdir -p /boot/home/Pictures ; mkdir -p /boot/home/Packages ; mv *.zip /boot/home/Compress_Files ; mv *.rar /boot/home/Compress_Files ; mv *.7z /boot/home/Compress_Files ; mv *.arj /boot/home/Compress_Files ; mv *.tgz /boot/home/Compress_Files ; mv *.txt /boot/home/Text ; mv *.doc /boot/home/Text ; mv *.pdf /boot/home/Pdf; mv *.pkg /boot/home/Packages ; mv *.zpkg /boot/home/Packages ; mv *.zip.pkg /boot/home/Packages ; mv *.mp3 /boot/home/Music ; mv *.jpg /boot/home/Pictures ; mv *.bmp /boot/home/Pictures ; mv *.gif /boot/home/Pictures ; mv *.png /boot/home/Pictures ; mv *.tga /boot/home/Pictures ; mv *.jpeg /boot/home/Pictures ; mv screenshot* /boot/home/Pictures ; mv *.ico /boot/home/Pictures ; mv *.pcx /boot/home/Pictures ; mv *.rle /boot/home/Pictures ; mv *.pic /boot/home/Pictures ; mv *.iff /boot/home/Pictures ; mv *.rgb /boot/home/Pictures ; mv *.avi /boot/home/Videos ; mv *.mpg /boot/home/Videos ; mv *.divx /boot/home/Videos ; mv *.xvid /boot/home/Videos ; mv *.flv /boot/home/Videos ; mv *.mp4 /boot/home/Videos ; mv *.asf /boot/home/Videos ; mv *.mov /boot/home/Videos ; mv *.wmv /boot/home/Videos ; mv *.3gp /boot/home/Videos ; #Comprobando y eliminando carpetas vacias. cvideo=$(ls /home/Videos) if [ "$cvideo" = "" ]; then rmdir /boot/home/Videos fi cmusic=$(ls /boot/home/Music) if [ "$cvideo" = "" ]; then rmdir /boot/home/Music fi cpdf=$(ls /boot/home/Pdf) if [ "$cvideo" = "" ]; then rmdir /boot/home/Pdf fi ccf=$(ls /boot/home/Compress_Files) if [ "$ccf" = "" ]; then rmdir /boot/home/Compress_Files fi ctext=$(ls /boot/home/Text) if [ "$ctext" = "" ]; then rmdir /boot/home/Text fi cpics=$(ls /boot/home/Pictures) if [ "$cpics" = "" ]; then rmdir /boot/home/Pictures fi cpkg=$(ls /boot/home/Packages) if [ "$cpkg" = "" ]; then rmdir /boot/home/Packages fi #Finalizando variable fi if [ "$value" = "$DWN" ]; then mkdir -p /boot/home/Downloads/Videos ; mkdir -p /boot/home/Downloads/Music ; mkdir -p /boot/home/Downloads/Pdf ; mkdir -p /boot/home/Downloads/Compress_Files ; mkdir -p /boot/home/Downloads/Text ; mkdir -p /boot/home/Downloads/Pictures ; mkdir -p /boot/home/Downloads/Packages ; mv *.zip /boot/home/Downloads/Compress_Files ; mv *.rar /boot/home/Downloads/Compress_Files ; mv *.7z /boot/home/Downloads/Compress_Files ; mv *.arj /boot/home/Downloads/Compress_Files ; mv *.tgz /boot/home/Downloads/Compress_Files ; mv *.txt /boot/home/Downloads/Text ; mv *.doc /boot/home/Downloads/Text ; mv *.pdf /boot/home/Downloads/Pdf; mv *.pkg /boot/home/Downloads/Packages ; mv *.zpkg /boot/home/Downloads/Packages ; mv *.zip.pkg /boot/home/Downloads/Packages ; mv *.mp3 /boot/home/Downloads/Music ; mv *.jpg /boot/home/Downloads/Pictures ; mv screenshot* /boot/home/Downloads/Pictures ; mv *.bmp /boot/home/Downloads/Pictures ; mv *.gif /boot/home/Downloads/Pictures ; mv *.png /boot/home/Downloads/Pictures ; mv *.tga /boot/home/Downloads/Pictures ; mv *.jpeg /boot/home/Downloads/Pictures ; mv *.ico /boot/home/Downloads/Pictures ; mv *.pcx /boot/home/Downloads/Pictures ; mv *.rle /boot/home/Downloads/Pictures ; mv *.pic /boot/home/Downloads/Pictures ; mv *.iff /boot/home/Downloads/Pictures ; mv *.rgb /boot/home/Downloads/Pictures ; mv *.avi /boot/home/Downloads/Videos ; mv *.mpg /boot/home/Downloads/Videos ; mv *.divx /boot/home/Downloads/Videos ; mv *.xvid /boot/home/Downloads/Videos ; mv *.flv /boot/home/Downloads/Videos ; mv *.mp4 /boot/home/Downloads/Videos ; mv *.asf /boot/home/Downloads/Videos ; mv *.mov /boot/home/Downloads/Videos ; mv *.wmv /boot/home/Downloads/Videos ; mv *.3gp /boot/home/Downloads/Videos ; #Comprobando y eliminando carpetas vacias. cvideo=$(ls /home/Downloads/Videos) if [ "$cvideo" = "" ]; then rmdir /boot/home/Downloads/Videos fi cmusic=$(ls /boot/home/Downloads/Music) if [ "$cvideo" = "" ]; then rmdir /boot/home/Downloads/Music fi cpdf=$(ls /boot/home/Downloads/Pdf) if [ "$cvideo" = "" ]; then rmdir /boot/home/Downloads/Pdf fi ccf=$(ls /boot/home/Downloads/Compress_Files) if [ "$ccf" = "" ]; then rmdir /boot/home/Downloads/Compress_Files fi ctext=$(ls /boot/home/Downloads/Text) if [ "$ctext" = "" ]; then rmdir /boot/home/Downloads/Text fi cpics=$(ls /boot/home/Downloads/Pictures) if [ "$cpics" = "" ]; then rmdir /boot/home/Downloads/Pictures fi cpkg=$(ls /boot/home/Downloads/Packages) if [ "$cpkg" = "" ]; then rmdir /boot/home/Downloads/Packages fi #Finalizando Variable fi #Botón de salida if [ "$value" = "Salir" ]; then exit fi---------------- |