keep it simple version:

select FILENAME in *;
        echo "You picked $FILENAME ($REPLY), it is now only accessible to you."
        chmod go-rwx "$FILENAME"

bash linux file select output terminal



cool grafical but not working-right version:

while this does very beautiful menus… somehow it did not “work” right (did not find any files?)
could not modify default dir… anyway.

bash linux file select output terminal2

# - Remove the file using dialog box
# -------------------------------------------------
# purpose - remove file
#  $1 - filename
function delete_file(){
	local f="$1"
	local m="$0: file $f failed to delete."
	if [ -f $f ]
		/bin/rm $FILE && m="$0: $f file deleted."
		m="$0: $f is not a file."
	dialog --title "Remove file" --clear --msgbox "$m" 10 50

# select filename using dialog
# store it to $FILE
FILE=$(dialog --title "Delete a file" --stdout --title "Please choose a file to delete" --fselect /script/test/ 14 48)

# delete file
[ ! -z $FILE ] && delete_file "$FILE"


liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!