# Commands-for-KS

### Commands for KS

The commands in the entirety of the kernel are programs that allow you to do what they're supposed to do. They can be either implemented internally (which is what we call the normal commands), implemented as an alias (an alias to normal commands or mods), or created by mods.

All the shells (either normal or custom) share a common command input parser, such as arguments, switches, and so on. Some commands have arguments (either required, for which you should provide to make the command work, or optional, for which you can omit), and some don't provide any.

The switches are special arguments that have the dash in front of them. They change how the commands work, but must be implemented before they actually work.

### General commands

These commands that are mentioned below are available in all of the shells.

| Command                               | Description              |
| ------------------------------------- | ------------------------ |
| [exit](unified/ks-command-exit)       | Exits the subshell       |
| [presets](unified/ks-command-presets) | Changes the shell preset |

### UESH shell commands

The below commands for Kernel Simulator can be used in the normal UESH shell, the one that is started after you log in to your account.

For more information about every command, click the command.

#### Administrative commands

> \[!IMPORTANT] The user must have at least the administrative privileges before they can run the below commands.

| Command                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [adduser](uesh/ks-command-adduser)             | You can add the user's name whenever you need, with the password if required. However, passwords are required to ensure security.                                                                                                                                                                                                                                                                                                                                                                                                      |
| [alias](uesh/ks-command-alias)                 | You can manage your aliases to commands so you don't have to type long commands.                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [arginj](uesh/ks-command-arginj)               | You can inject arguments into the kernel so that when you reboot, the arguments that are injected will be run.                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [blockdbgdev](uesh/ks-command-blockdbgdev)     | You can block an IP address of a debug device to prevent it from entering remote debug until it's unblocked.                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [cdbglog](uesh/ks-command-cdbglog)             | You can clear debug log, resetting the size to 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [chhostname](uesh/ks-command-chhostname)       | You can change your hostname of your kernel to personalize things. It has an argument of `chhostname <AnyHostName>.`                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [chlang](uesh/ks-command-chlang)               | Changes your language                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [chmal](uesh/ks-command-chmal)                 | You can change your message of the day after login, and it supports the same placeholders.                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [chmotd](uesh/ks-command-chmotd)               | You can change your message of the day, and you can include your own placeholders, including `<user>` which stands for username, `<shortdate>` for the short date in "MM/DD/YYYY" format, `<longdate>` for the long date that looks like "Saturday, December 1, 2018", `<shorttime>` for the short time in "HH:MM" format, `<longtime>` for the long time in "HH:MM:SS AM/PM" format, `<timezone>` for the standard time zone (eg. Egypt Standard Time), `<summertimezone>` for the daylight time zone name (eg. Syria Daylight Time). |
| [chpwd](uesh/ks-command-chpwd)                 | You can change your password, or someone else's password.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [chusrname](uesh/ks-command-chusrname)         | You can change your username, or someone else's name, although if you changed your own username to new name, you'll be signed out immediately.                                                                                                                                                                                                                                                                                                                                                                                         |
| [disconndbgdev](uesh/ks-command-disconndbgdev) | Disconnects a debug device                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [langman](uesh/ks-command-langman)             | Manage languages                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [lsdbgdev](uesh/ks-command-lsdbgdev)           | Lists all debug devices that are connected                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [modman](uesh/ks-command-modman)               | Manages your mods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [netinfo](uesh/ks-command-netinfo)             | You can check your network status and network interface information, including WiFi support. You can also use this for troubleshooting problems with the network, and you can look at the packets that has an error.                                                                                                                                                                                                                                                                                                                   |
| [perm](uesh/ks-command-perm)                   | You can manage user's permission settings.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [rmuser](uesh/ks-command-rmuser)               | You can remove usernames, but you can't remove yours, if the specified user doesn't want to use the computer, or is uninvited, or is redundant.                                                                                                                                                                                                                                                                                                                                                                                        |
| [rdebug](uesh/ks-command-rdebug)               | Enables or disables remote debugging functionality                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [reloadconfig](uesh/ks-command-reloadconfig)   | You can reload the configuration file to read the new changes, but the changes will be applied after you restart the kernel.                                                                                                                                                                                                                                                                                                                                                                                                           |
| [reloadsaver](uesh/ks-command-reloadsaver)     | Reloads the specified screensaver mod file                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [rexec](uesh/ks-command-rexec)                 | Remotely executes a command in another kernel instance (other PC)                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [savecurrdir](uesh/ks-command-savecurrdir)     | Saves the current directory information to kernel config.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [setsaver](uesh/ks-command-setsaver)           | You can set your screensaver of your choice or your customized one as the default one, and if you plan to use customized screensavers, you should name your extension as `<ScreensaverName>SS.m` to be recognized as a screensaver, not as an extension.                                                                                                                                                                                                                                                                               |
| [settings](uesh/ks-command-settings)           | Changes kernel settings.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [testshell](uesh/ks-command-testshell)         | Opens a test shell                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [unblockdbgdev](uesh/ks-command-unblockdbgdev) | You can unblock an IP address so it can enter remote debug again.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [update](uesh/ks-command-update)               | Checks for updates, and if it found one, it tells you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

#### Normal user commands

| Command                                                  | Description                                                                                                                                                |
| -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [chattr](uesh/ks-command-chattr)                         | Changes the attributes of a file                                                                                                                           |
| [chdir](uesh/ks-command-chdir)                           | You can change your working directory.                                                                                                                     |
| [cls](uesh/ks-command-cls)                               | To clear your screen from text.                                                                                                                            |
| [calc](uesh/ks-command-calc)                             | It's back! The Calculator calculates the formulas like `4 / 2`.                                                                                            |
| [calendar](uesh/ks-command-calendar)                     | Simple calendar                                                                                                                                            |
| [clearfiredevents](uesh/ks-command-clearfiredevents)     | Clears the fired events                                                                                                                                    |
| [copy](uesh/ks-command-copy)                             | Copies the source file to the destination                                                                                                                  |
| [colorhextorgb](uesh/ks-command-colorhextorgb)           | Converts the hexadecimal representation of the color to RGB numbers.                                                                                       |
| [colorhextorgbks](uesh/ks-command-colorhextorgbks)       | Converts the hexadecimal representation of the color to RGB numbers in KS format.                                                                          |
| [colorrgbtohex](uesh/ks-command-colorrgbtohex)           | Converts the color RGB numbers to hex.                                                                                                                     |
| [combine](uesh/ks-command-combine)                       | Combines the two text files or more into the output file                                                                                                   |
| [convertlineendings](uesh/ks-command-convertlineendings) | Converts the line endings in text files                                                                                                                    |
| [dict](uesh/ks-command-dict)                             | The English Dictionary                                                                                                                                     |
| [dismissnotif](uesh/ks-command-dismissnotif)             | Dismisses a specific notification.                                                                                                                         |
| [dismissnotifs](uesh/ks-command-dismissnotifs)           | Dismisses all notifications                                                                                                                                |
| [edit](uesh/ks-command-edit)                             | Opens the text editor shell to an existing text file.                                                                                                      |
| [fileinfo](uesh/ks-command-fileinfo)                     | Gets file information                                                                                                                                      |
| [find](uesh/ks-command-find)                             | Finds a specified file                                                                                                                                     |
| [firedevents](uesh/ks-command-firedevents)               | Lists all fired events                                                                                                                                     |
| [ftp](uesh/ks-command-ftp)                               | You can transfer files from/to an FTP server, and interact with the servers.                                                                               |
| [genname](uesh/ks-command-genname)                       | Name generator                                                                                                                                             |
| [get](uesh/ks-command-get)                               | Downloads a file from the specified URL.                                                                                                                   |
| [gettimeinfo](uesh/ks-command-gettimeinfo)               | Gets the time information for the specified time                                                                                                           |
| [hexedit](uesh/ks-command-hexedit)                       | Opens a binary file to the hex editor                                                                                                                      |
| [http](uesh/ks-command-http)                             | The HTTP Shell                                                                                                                                             |
| [hwinfo](uesh/ks-command-hwinfo)                         | Shows hardware information                                                                                                                                 |
| [jsonbeautify](uesh/ks-command-jsonbeautify)             | Beautifies the JSON file                                                                                                                                   |
| [jsonminify](uesh/ks-command-jsonminify)                 | Minifies the JSON file                                                                                                                                     |
| [jsonshell](uesh/ks-command-jsonshell)                   | The JSON Shell                                                                                                                                             |
| [keyinfo](uesh/ks-command-keyinfo)                       | Gets the key information                                                                                                                                   |
| [list](uesh/ks-command-list)                             | You can list your current working directory, or another directory.                                                                                         |
| [lockscreen](uesh/ks-command-lockscreen)                 | You can lock your screen and show your default screensaver set by you or by the kernel. Default screensaver is Matrix.                                     |
| [lovehate](uesh/ks-command-lovehate)                     | Starts the Love/Hate comment responder game                                                                                                                |
| [logout](uesh/ks-command-logout)                         | You can log off your account when you're finished working.                                                                                                 |
| [lsvars](uesh/ks-command-lsvars)                         | Lists variables                                                                                                                                            |
| [mail](uesh/ks-command-mail)                             | Opens the mail shell to your mail account.                                                                                                                 |
| [md](uesh/ks-command-md)                                 | You can make your directory on the root directory.                                                                                                         |
| [meteor](uesh/ks-command-meteor)                         | You're a spaceship and the meteors are destroying you.                                                                                                     |
| [mkfile](uesh/ks-command-mkfile)                         | You can create your file under any name.                                                                                                                   |
| [mktheme](uesh/ks-command-mktheme)                       | Makes a new theme.                                                                                                                                         |
| [modmanual](uesh/ks-command-modmanual)                   | Mod manual                                                                                                                                                 |
| [move](uesh/ks-command-move)                             | Moves the source file to the destination                                                                                                                   |
| [open](uesh/ks-command-open)                             | Opens a URL                                                                                                                                                |
| [ping](uesh/ks-command-ping)                             | Pings addresses.                                                                                                                                           |
| [put](uesh/ks-command-put)                               | Uploads a file to the URL using a file.                                                                                                                    |
| [rarshell](uesh/ks-command-rarshell)                     | Opens a RAR shell to the specified rar file                                                                                                                |
| [rm](uesh/ks-command-rm)                                 | You can remove a directory or file.                                                                                                                        |
| [reboot](uesh/ks-command-reboot)                         | You can restart your kernel if you have made manual or tool configuration changes for them to be reflected, or if you want to see the boot sequence again. |
| [reportbug](uesh/ks-command-reportbug)                   | Opens a prompt to let you file a bug report.                                                                                                               |
| [retroks](uesh/ks-command-retroks)                       | Retro Kernel Simulator based on 0.0.4.1                                                                                                                    |
| [rss](uesh/ks-command-rss)                               | Opens an RSS shell.                                                                                                                                        |
| [savescreen](uesh/ks-command-savescreen)                 | You can show the screensaver to prevent screen burn-outs.                                                                                                  |
| [search](uesh/ks-command-search)                         | Searches for a specific string in a specific file using regular expressions.                                                                               |
| [searchword](uesh/ks-command-searchword)                 | Searches for a specific string in a specified file using text.                                                                                             |
| [setthemes](uesh/ks-command-setthemes)                   | You can set the color set for your kernel, as known as themes.                                                                                             |
| [sftp](uesh/ks-command-sftp)                             | You can transfer files from/to an SFTP server, and interact with the servers.                                                                              |
| [shownotifs](uesh/ks-command-shownotifs)                 | Shows the notifications.                                                                                                                                   |
| [showtd](uesh/ks-command-showtd)                         | You can show your current time and date, as well as your timezone.                                                                                         |
| [showtdzone](uesh/ks-command-showtdzone)                 | You can show the time and date of the timezone, or you can show all of the dates and times of the timezones in the current time and date.                  |
| [shutdown](uesh/ks-command-shutdown)                     | You can shut down your computer (the kernel, not the actual PC)                                                                                            |
| [snaker](uesh/ks-command-snaker)                         | Starts the snake game                                                                                                                                      |
| [solver](uesh/ks-command-solver)                         | Starts the math solver game                                                                                                                                |
| [speedpress](uesh/ks-command-speedpress)                 | Initializes the speedpress game                                                                                                                            |
| [spellbee](uesh/ks-command-spellbee)                     | Plays the spelling bee game                                                                                                                                |
| [sshell](uesh/ks-command-sshell)                         | Opens the SSH connection. Press ESC to disconnect when in session.                                                                                         |
| [sshcmd](uesh/ks-command-sshcmd)                         | Opens the SSH connection to send a command.                                                                                                                |
| [stopwatch](uesh/ks-command-stopwatch)                   | A simple stopwatch                                                                                                                                         |
| [sumfile](uesh/ks-command-sumfile)                       | Calculates the MD5, SHA1, SHA256, or SHA512 sum of a specific file.                                                                                        |
| [sumfiles](uesh/ks-command-sumfiles)                     | Calculates the MD5, SHA1, SHA256, or SHA512 sums of the files in the specified directory.                                                                  |
| [sysinfo](uesh/ks-command-sysinfo)                       | You can show your system information, as well as the kernel settings.                                                                                      |
| [timer](uesh/ks-command-timer)                           | A simple timer                                                                                                                                             |
| [unitconv](uesh/ks-command-unitconv)                     | Unit conversion                                                                                                                                            |
| [unzip](uesh/ks-command-unzip)                           | Extracts a zip file                                                                                                                                        |
| [usermanual](uesh/ks-command-usermanual)                 | Opens the Kernel Simulator wiki                                                                                                                            |
| [verify](uesh/ks-command-verify)                         | Verifies a file.                                                                                                                                           |
| [weather](uesh/ks-command-weather)                       | Gets weather information for a city.                                                                                                                       |
| [wrap](uesh/ks-command-wrap)                             | Wraps a command                                                                                                                                            |
| [zip](uesh/ks-command-zip)                               | Makes a zip file                                                                                                                                           |
| [zipshell](uesh/ks-command-zipshell)                     | Opens a ZIP shell to the specified zip file                                                                                                                |

#### Scripting commands

These commands can be used in shell and in scripting, though it works better in scripting.

| Command                              | Description                                           |
| ------------------------------------ | ----------------------------------------------------- |
| [beep](uesh/ks-command-beep)         | Makes your PC speaker beep in specified n Hz in n ms. |
| [cat](uesh/ks-command-cat)           | Prints the content of a specific file to console      |
| [choice](uesh/ks-command-choice)     | Makes user choices                                    |
| [echo](uesh/ks-command-echo)         | Prints written strings                                |
| [if](uesh/ks-command-if)             | Satisfies the condition and then executes the command |
| [input](uesh/ks-command-input)       | Makes user input                                      |
| [set](uesh/ks-command-set)           | Sets a variable to a specified value.                 |
| [setrange](uesh/ks-command-setrange) | Makes an array of variable with values                |
| [select](uesh/ks-command-select)     | Makes user selection                                  |
