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]
ordir [path]
- Usage:
- cd: Changes the current directory.
- Usage:
cd <path>
- Usage:
- mkdir: Creates a new directory.
- Usage:
mkdir <path>
- Usage:
- rmdir: Deletes a directory.
- Usage:
rmdir <path>
- Usage:
- renamedir: Renames a directory.
- Usage:
renamedir <path> <newName>
- Usage:
- copydir: Copies a directory from source to destination.
- Usage:
copydir <source> <destination>
- Usage:
- back: Moves to the parent directory.
- Usage:
back
- Usage:
- create: Creates a new file.
- Usage:
create <path>
- Usage:
- delete: Deletes a file.
- Usage:
delete <path>
- Usage:
- read: Reads and displays the content of a file.
- Usage:
read <path>
- Usage:
- write: Writes content to a file.
- Usage:
write <path> <content>
- Usage:
- copy: Copies a file from source to destination.
- Usage:
copy <source> <destination>
- Usage:
- move: Moves a file from source to destination.
- Usage:
move <source> <destination>
- Usage:
- rename: Renames a file.
- Usage:
rename <oldPath> <newName>
- Usage:
History Commands
The following commands are used to manage command history:
- history: Displays the command history.
- Usage:
history
- Usage:
- clear: Clears the command history.
- Usage:
clear
- Usage:
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
- Usage:
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]
- Usage:
- alias: Creates an alias for a command.
- Usage:
alias <new_alias> <command>
- Usage:
- pwd: Prints the current working directory.
- Usage:
pwd
- Usage:
- reboot: Reboots the system.
- Usage:
reboot
- Usage:
- shutdown: Shuts down the system.
- Usage:
shutdown
- Usage:
- date: Shows the current date.
- Usage:
date
- Usage:
- time: Shows the current time.
- Usage:
time
- Usage:
- createuser: Creates a new user.
- Usage:
createuser <username> <password>
- Usage:
- deleteuser: Deletes a user.
- Usage:
deleteuser <username>
- Usage:
- listusers: Lists all users.
- Usage:
listusers
- Usage:
Network Commands
The following commands are used to manage the network:
- dns: Performs a DNS lookup for the specified domain.
- Usage:
dns <domain>
- Usage:
- ping: Pings the specified IP address.
- Usage:
ping <ip_address>
- Usage:
- netshutdown: Shuts down the network.
- Usage:
netshutdown
- Usage:
- 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
- Usage:
- netstatus: Displays network status.
- Usage:
netstatus
- Usage:
- tcpserver: Starts a TCP server.
- Usage:
tcpserver
- Usage:
- 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 servertimeout
- 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
- Usage:
- udpserver: Starts a UDP server.
- Usage:
udpserver [port]
- Parameters:
port
- Port number to listen on (default: 8080)
- Example:
udpserver
udpserver 9000
- Usage:
- 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 servertimeout
- 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
- Usage:
Hardware Commands
The following commands are used to display hardware information:
- memory: Displays memory information.
- Usage:
memory
- Usage:
- cpu: Display CPU information.
- Usage:
cpu
- Usage:
Process Commands
The following commands are used to manage processes:
- processinfo: Display process information.
- Usage:
processinfo [id <ID> | name <Name>]
- Usage:
Disk Commands
The following commands are used to manage disks and partitions:
- freespace: Displays available free space on a drive.
- Usage:
freespace <drive>
- Usage:
- fstype: Displays the file system type of a drive.
- Usage:
fstype <drive>
- Usage:
- format: Formats a drive.
- Usage:
format <drive_letter>
- Usage:
- partition: Creates a partition on a drive.
- Usage:
partition <drive_letter> <size>
- Usage:
- partinfo: Lists information about partitions on a drive.
- Usage:
partinfo <drive_letter>
- Usage:
- partman: Opens the partition manager.
- Usage:
partman
- Usage:
Audio Commands
The following commands are used to manage audio:
- playaudio: Plays an audio file.
- Usage:
playaudio <path>
- Usage:
- stopaudio: Stops the currently playing audio.
- Usage:
stopaudio
- Usage:
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
- Usage:
- textedit: Opens the text editor application.
- Usage:
textedit
- Usage:
Permissions Commands
The following commands are used to manage file permissions:
- permissions: Shows the permissions of a file.
- Usage:
permissions <path>
- Usage:
- setpermissions: Sets the permissions of a file.
- Usage:
setpermissions <path> <username> <allowRead> <allowWrite>
- Usage:
User Management Commands
The following commands are used to manage user sessions:
- logout: Logs out the current user.
- Usage:
logout
- Usage:
- useradmin: Manages administrator privileges for users.
- Usage:
useradmin grant <username>
- Grant administrator privilegesuseradmin revoke <username>
- Revoke administrator privileges
- Note: Only administrators can use this command.
- Usage:
- userinfo: Displays information about a user.
- Usage:
userinfo
- Show information about current useruserinfo <username>
- Show information about a specific user (admin only)
- Usage:
- changepassword: Changes the password of the current user.
- Usage:
changepassword
- Usage:
- changeusername: Changes your username.
- Usage:
changeusername <new_username>
- Note: Your home directory contents will be moved to the new username location.
- Usage: