#!/bin/bash # Function to display current directory and files display_files() { local files files=$(ls -1) echo "Current Directory: $(pwd)" echo "Files:" echo "$files" } # Function to display head of file display_head() { local file file=$1 head $file } # Main loop while true; do # Clear screen clear # Display current time date +"%T" # Display files and head of selected file display_files read -p "Enter a file to view head: " file display_head $file # Handle user input read -p "Enter command (up, left, right, grep, copy, move, rename, nano, shell): " cmd case $cmd in "up") cd .. ;; "left") cd .. ;; "right") read -p "Enter directory to go into: " dir cd $dir ;; "grep") read -p "Enter search string: " search grep -r $search . ;; "copy") read -p "Enter file to copy: " file read -p "Enter destination: " dest cp $file $dest ;; "move") read -p "Enter file to move: " file read -p "Enter destination: " dest mv $file $dest ;; "rename") read -p "Enter file to rename: " file read -p "Enter new name: " newname mv $file $newname ;; "nano") read -p "Enter file to edit: " file nano $file ;; "shell") read -p "Enter command: " command eval $command ;; esac done