-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashScript.sh
More file actions
executable file
·36 lines (34 loc) · 978 Bytes
/
bashScript.sh
File metadata and controls
executable file
·36 lines (34 loc) · 978 Bytes
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
36
#!/bin/bash
PS3="Select an action from the menu: "
select opt in "List files" "Show free disk space" "Show system path" "Display command history" "Backup files" "Exit"
do
case $opt in
"List files")
echo "$opt - " $(ls -a)
echo " ";;
"Show free disk space")
echo "$opt - " $(df -H)
echo " ";;
"Show system path")
echo "$opt - " $(pwd)
echo " ";;
"Display command history")
echo "$opt - "
cat ~/.bash_history
echo " ";;
"Backup files")
echo "$opt - "
read -p "Enter directory name to backup: " directory
mkdir -p BackupFolder
cp -r $directory BackupFolder
echo "Contents of backup - "
ls -R BackupFolder
echo " ";;
"Exit")
echo "Goodbye!"
break;;
*)
echo "Invalid option"
echo " ";;
esac
done