Welcome, guest | Sign In | My Account | Store | Cart

A basic Linux menu which can do the following:

  • Display Files and Directory's
  • Remove Files Displayed
  • Copy Files Displayed
  • Make Directory
Bash, 35 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
selection=
until [ "$selection" = "0"]; do
     echo ""
     echo "PROGRAM MENU"
     echo "1 - Display Files and Directorys"
     echo "2 - Remove Files Displayed"
     echo "3 - Copy Files Displayed"
     echo "4 - Make Directory"
     echo ""
     echo "0 - Exit program"
     echo ""
     echo -n "Enter Selection:"
     read selection
     echo ""
     case $selection in
         1 ) ls -f;;
         2 ) echo "This removes files"
             echo "Please type name of file to remove"
             read deletefiles  
             rm $deletefiles;;
         3 ) echo "This copies files from source to destination"
             echo "Please enter source file to copy:" 
             read source
             echo "Please enter destination of file to copy"
             read destination
             cp $source $destination;;
         4 ) echo This makes a Directory
             echo "Please enter Directory name"
             read destination
             mkdir $destination;;
         0 ) exit;;
         * ) echo "Please enter 1,2,3,4 or 0"
     esac
done

Linux Man Pages http://www.linuxmanpages.com/

General Linux Commands http://www.linuxmanpages.com/man1/

1 comment

Alexander James Wallar 9 years, 8 months ago  # | flag

Really nice demo :D very helpful