Skip to content

Commands

TheSailOS provides a variety of commands to interact with the system. Below is a detailed list of available commands, categorized by functionality.

File System Commands

The following commands are used to manage files and directories:

  • ls, dir: Lists files and directories in the current directory or specified path.
    • Usage: ls [path] or dir [path]
  • cd: Changes the current directory.
    • Usage: cd <path>
  • mkdir: Creates a new directory.
    • Usage: mkdir <path>
  • rmdir: Deletes a directory.
    • Usage: rmdir <path>
  • renamedir: Renames a directory.
    • Usage: renamedir <path> <newName>
  • copydir: Copies a directory from source to destination.
    • Usage: copydir <source> <destination>
  • back: Moves to the parent directory.
    • Usage: back
  • create: Creates a new file.
    • Usage: create <path>
  • delete: Deletes a file.
    • Usage: delete <path>
  • read: Reads and displays the content of a file.
    • Usage: read <path>
  • write: Writes content to a file.
    • Usage: write <path> <content>
  • copy: Copies a file from source to destination.
    • Usage: copy <source> <destination>
  • move: Moves a file from source to destination.
    • Usage: move <source> <destination>
  • rename: Renames a file.
    • Usage: rename <oldPath> <newName>

History Commands

The following commands are used to manage command history:

  • history: Displays the command history.
    • Usage: history
  • clear: Clears the command history.
    • Usage: clear

Search Commands

The following commands are used to search files and content:

  • find: Finds files matching a specified pattern.
    • Usage: find <pattern> [path]
    • Examples:
      • find *.txt - Find all .txt files

System Commands

The following commands are used to manage the system:

  • help: Displays help information for a command or lists available commands.
    • Usage: help [command]
  • alias: Creates an alias for a command.
    • Usage: alias <new_alias> <command>
  • pwd: Prints the current working directory.
    • Usage: pwd
  • reboot: Reboots the system.
    • Usage: reboot
  • shutdown: Shuts down the system.
    • Usage: shutdown
  • date: Shows the current date.
    • Usage: date
  • time: Shows the current time.
    • Usage: time
  • createuser: Creates a new user.
    • Usage: createuser <username> <password>
  • deleteuser: Deletes a user.
    • Usage: deleteuser <username>
  • listusers: Lists all users.
    • Usage: listusers

Network Commands

The following commands are used to manage the network:

  • dns: Performs a DNS lookup for the specified domain.
    • Usage: dns <domain>
  • ping: Pings the specified IP address.
    • Usage: ping <ip_address>
  • netshutdown: Shuts down the network.
    • Usage: netshutdown
  • netconfig: Configures the network settings.
    • Usage:
      • netconfig - Configure with default settings (192.168.1.69)
      • netconfig <ip_address> <subnet_mask> <gateway> - Configure with custom settings
      • Example: netconfig 192.168.1.69 255.255.255.0 192.168.1.254
  • netstatus: Displays network status.
    • Usage: netstatus
  • tcpserver: Starts a TCP server.
    • Usage: tcpserver
  • tcpclient: Starts a TCP client and connects to a remote server.
    • Usage: tcpclient <destination_ip> <destination_port> <local_port> <data> [timeout]
    • Parameters:
      • destination_ip - Remote server IP address (e.g. 192.168.1.100)
      • destination_port - Remote server port number (e.g. 80)
      • local_port - Local port number to use (e.g. 8080)
      • data - Data to send to the server
      • timeout - Optional connection timeout in ms (default: 80)
    • Examples:
      • tcpclient 192.168.1.100 80 8080 "GET / HTTP/1.1"
      • tcpclient 10.0.0.1 8080 9000 "Hello Server" 120
  • udpserver: Starts a UDP server.
    • Usage: udpserver [port]
    • Parameters:
      • port - Port number to listen on (default: 8080)
    • Example:
      • udpserver
      • udpserver 9000
  • udpclient: Starts a UDP client and connects to a remote server.
    • Usage: udpclient <destination_ip> <destination_port> <local_port> <message> [timeout]
    • Parameters:
      • destination_ip - Remote server IP address (e.g. 192.168.1.100)
      • destination_port - Remote server port number (e.g. 8080)
      • local_port - Local port number to use (e.g. 9000)
      • message - Message to send to the server
      • timeout - Optional connection timeout in ms (default: 80)
    • Examples:
      • udpclient 192.168.1.100 8080 9000 "Hello Server"
      • udpclient 10.0.0.1 8080 9000 "Test Message" 120

Hardware Commands

The following commands are used to display hardware information:

  • memory: Displays memory information.
    • Usage: memory
  • cpu: Display CPU information.
    • Usage: cpu

Process Commands

The following commands are used to manage processes:

  • processinfo: Display process information.
    • Usage: processinfo [id <ID> | name <Name>]

Disk Commands

The following commands are used to manage disks and partitions:

  • freespace: Displays available free space on a drive.
    • Usage: freespace <drive>
  • fstype: Displays the file system type of a drive.
    • Usage: fstype <drive>
  • format: Formats a drive.
    • Usage: format <drive_letter>
  • partition: Creates a partition on a drive.
    • Usage: partition <drive_letter> <size>
  • partinfo: Lists information about partitions on a drive.
    • Usage: partinfo <drive_letter>
  • partman: Opens the partition manager.
    • Usage: partman

Audio Commands

The following commands are used to manage audio:

  • playaudio: Plays an audio file.
    • Usage: playaudio <path>
  • stopaudio: Stops the currently playing audio.
    • Usage: stopaudio

Game Commands

The following commands are used to play games:

  • snake: Play Snake game.
    • Use arrow keys to move, ESC to exit.
  • tetris: Play Tetris game.
    • Use arrow keys to move, ESC to exit.
  • tictactoe: Play Tic-Tac-Toe against the computer.
    • Use numpad (1-9) to place X.

Application Commands

The following commands are used to manage applications:

  • calculator: Opens the calculator application.
    • Usage: calculator
  • textedit: Opens the text editor application.
    • Usage: textedit

Permissions Commands

The following commands are used to manage file permissions:

  • permissions: Shows the permissions of a file.
    • Usage: permissions <path>
  • setpermissions: Sets the permissions of a file.
    • Usage: setpermissions <path> <username> <allowRead> <allowWrite>

User Management Commands

The following commands are used to manage user sessions:

  • logout: Logs out the current user.
    • Usage: logout
  • useradmin: Manages administrator privileges for users.
    • Usage:
      • useradmin grant <username> - Grant administrator privileges
      • useradmin revoke <username> - Revoke administrator privileges
    • Note: Only administrators can use this command.
  • userinfo: Displays information about a user.
    • Usage:
      • userinfo - Show information about current user
      • userinfo <username> - Show information about a specific user (admin only)
  • changepassword: Changes the password of the current user.
    • Usage: changepassword
  • changeusername: Changes your username.
    • Usage: changeusername <new_username>
    • Note: Your home directory contents will be moved to the new username location.