isolated-sandbox / examples /bash_system_info.sh
ChefAdorous's picture
Deploy Code Execution Sandbox with FastAPI and Docker
a89f25d
raw
history blame contribute delete
547 Bytes
#!/bin/bash
# Bash Example: System Information
echo "=== System Information ==="
echo
# Display basic system info
echo "Hostname: $(hostname)"
echo "Current user: $(whoami)"
echo "Current directory: $(pwd)"
echo "Current time: $(date)"
echo
# Display system resources
echo "Memory usage:"
free -h
echo
echo "Disk usage:"
df -h / | tail -1
echo
# Display OS information
echo "Operating System:"
cat /etc/os-release | grep PRETTY_NAME
echo
# Process information
echo "Number of running processes: $(ps aux | wc -l)"
echo "Current shell: $SHELL"