Windows CMD
Ubuntu Terminal

Left Image Right Image
Microsoft Windows [Version 10.5.18071.1703]
(c) Microsoft Corporation. All rights reserved.

Description

This is a console simulator for both Windows Command Prompt and Ubuntu Terminal, built entirely with HTML, JavaScript, and CSS. Supported commands will be listed in the Features section. Note that only two commands are available for Windows CMD, as most efforts were focused on the Ubuntu Terminal, so it's recommended to try that instead.

This is an ongoing project, and mistakes or bugs are inevitable. While I try to catch as many as possible, it's likely I may miss one or more.

I first encountered Linux/Unix/Ubuntu (not sure of the exact common term, but they share the same roots) in my first year at university. Since it was a completely new OS and environment, I mostly learned basic navigation, relying heavily on the GUI (using the mouse). It wasn't until my third year, during an Operating Systems course, that I had to navigate the environment through the terminal. The OS course can get quite complex, but knowing how to navigate the Unix terminal basics is essential for diving deeper.

I created this Terminal Simulator, specifically for Unix-based systems, for beginners learning OS concepts. It's designed to help users get familiar with navigating files and directories, creating or deleting file nodes, checking file information, and understanding permissions, ownership, and other file attributes. Learning basic commands and their options/flags is crucial, as they are used frequently in both learning and professional environments.

What sets Unix apart is the need to use the terminal to unlock its full potential, unlike Windows, where you can perform most tasks with the mouse. Unix also provides a lot of freedom, allowing you to delete anything, with the consequences entirely on you. To simulate this, I’ve added two self-destruct features that mimic the effects of catastrophic commands in a real Unix OS. While not 100% accurate, it offers a glimpse into the potential damage you could cause, helping you avoid such mistakes on your actual system.

I hope this simulator helps you learn and have some fun along the way. I’ve included as many commands as possible, focusing on those most common for beginners. You’d be surprised how complex some of these basic commands can get when you try to code them. As I discovered their unexpected complexity while coding, I had to simplify things for my own sanity. I'm still a beginner, so there's only so much I can simulate.

Check back often, as I’ll be adding new commands, features, bug fixes, and optimizations. I hope you enjoy the experience!

Windows CMD supported command: whoami, cls

Ubuntu Terminal supported command: ls, cd, touch, echo, cat, rm, mkdir, rmdir, sudo, su, adduser, deluser, chmod, pwd, whoami, clear, history, man

  • ls: list directory contents
  • cd: change working directory
  • touch: create new file
  • echo: display a line of text (can redirect the output into a file)
  • cat: print file content on the standard output
  • rm: remove files or directories (just dont try to remove '/' 🤫)
  • mkdir: create new directory
  • rmdir: remove empty directory
  • sudo: execute a command as a super (root) user
  • su: change current active user
  • adduser: add new user
  • deluser: remove existing user (just dont try to remove root 👀)
  • chmod: change file mode (permission)
  • pwd: show current/working directory
  • whoami: show current active user
  • chmod: change file mode (permission)
  • clear: clear the terminal screen
  • history: show history of all previous input command
  • man: show manual to each or all commands
  • Natural text navigation:
    • No HTML input fields were used, every text navigation/manipulation was manually built
    • Arrow key left/right: move cursor between text
    • Arrow key up/down: traversing command history
    • Home/End key: move cursor to the head/tail of text
    • Backspace/Del key: remove character to the left/right of cursor of text
  • Optimize permission checking for ls, cd
  • Upgrade mkdir, rmdir, rm to allow nesting file path to directory/file
  • Add feature for command piping
  • Code optimizations, code reorganization
  • Implementing Tab key: auto-complete file name in during command prompting
  • To be updated