Your Ultra Shell - A Beginner's Guide
Your Ultra shell provides command-line access to your Ultra service. You can use it to navigate directories, manage files, inspect storage usage, control supported applications, and run command-line utilities.
This beginner’s guide introduces the Bash shell and the commands required for common tasks. If you have not connected yet, follow Connect to your Ultra slot via SSH.
Understand Your Home Directory
After you connect with SSH, Bash normally places you in your home directory.
- Display your current directory:
pwd- The output normally uses the following format:
/home/<username>- Display the home directory configured for your account:
printf '%s\n' "$HOME"- Return to your home directory from any location:
cd- You can also use:
cd ~- The tilde (
~) and the$HOMEenvironment variable both represent your home directory. Prefer them over hardcoded paths in commands and scripts.
Understand Logical and Physical Paths
Your displayed home directory can be a symbolic link to another location on the server.
- Display the logical path:
pwd -L- Resolve symbolic links and display the physical path:
pwd -PPreserve Default Files and Directories
Your home directory contains files and directories required by your Ultra service. Core items commonly include:
~/.bashrc~/.profile~/bin~/downloads~/media~/www- Installed applications also store configuration and operational data in locations such as
~/.apps.
- If required files were deleted, follow Restore Default File/Folder Structure.
Display Hidden Files
- Names beginning with a period (
.) are hidden by default. Examples include.bashrc,.profile,.ssh, and.apps. - Display regular and hidden entries:
ls -la- Display sizes in a human-readable format:
ls -lahNavigate Directories
Change Directories
- Use
cdfollowed by a directory path:
cd <directory>- Open the
mediadirectory in your home directory:
cd ~/media- Move to the parent directory:
cd ..- Move up two directory levels:
cd ../..- Return to the previous directory:
cd -Linux paths use the following references:
~represents your home directory..represents the current directory...represents the parent directory./represents the filesystem root.
List Directory Contents
- List entries in the current directory:
ls- List entries in another directory:
ls ~/media- Include hidden entries and detailed information:
ls -lahUse Tab Completion
- Enter the first part of a file, directory, or command name and press Tab.
- Bash completes the name when there is one match or displays possible matches when there are several. Tab completion reduces typing errors and helps with names containing spaces or special characters.
Work With Paths Safely
- Linux file and directory names can contain spaces. Enclose these paths in quotation marks:
cd "$HOME/media/TV Shows"mv "Movie One.mkv" "$HOME/media/"- Use
--before a file name that could begin with a hyphen:
rm -- "-example.txt"Shell wildcards require care:
- matches visible entries.
- A command using
directory/*does not include hidden files. - Review wildcard matches before using them with
mv,cp, orrm.
Create Files and Directories
- Create a directory:
mkdir <directory>- Create parent directories when required:
mkdir -p "$HOME/media/Movies"- Create an empty file:
touch <filename>Move and Rename Files
Use mv to move or rename a file or directory.
- Move a file:
mv "Movie1.mkv" "$HOME/media/"- Rename a file:
mv "Movie1.mkv" "Movie 1.mkv"- Prompt before overwriting an existing destination:
mv -i "Movie1.mkv" "$HOME/media/"- If the destination is an existing directory,
mvplaces the source inside it. If the destination does not exist,mvrenames the source.
Copy Files and Directories
Use cp to copy files and directories.
- Copy a file:
cp "Movie1.mkv" "$HOME/media/"- Prompt before overwriting an existing file:
cp -i "Movie1.mkv" "$HOME/media/"- Copy a directory and its contents:
cp -a "$HOME/media" "$HOME/media-backup"- The
-aoption preserves the directory structure and common file attributes while copying recursively.
Delete Files and Directories
- Prompt before deleting a file:
rm -i <filename>- Delete an empty directory:
rmdir <directory>- Review and delete a directory recursively:
rm -rI <directory>Extract Archives
Extract a ZIP Archive
- Open the directory containing the archive:
cd /path/to/archive- Extract the archive into the current directory:
unzip archive-name.zip- Extract the archive into a specified directory:
unzip archive-name.zip -d /path/to/destination- List the archive’s contents without extracting it:
unzip -l archive-name.zipExtract a RAR Archive
- Extract a RAR archive:
unrar x archive-name.rar- List its contents without extracting it:
unrar l archive-name.rarGet Command Help
- Many commands provide short usage instructions through
--help:
ls --help- For a complete manual page, use
man:
man lsWhile viewing a manual page:
- Press
/and enter a keyword to search. - Press
nto find the next match. - Press
qto exit. - Press Ctrl+C to interrupt most running terminal commands.
For additional utilities available on Ultra servers, see List of Pre-Installed Tools.
Run Long Tasks Safely
- A normal foreground command can stop when its SSH session disconnects. Use
screenortmuxfor a long-running interactive task. - Create a named
screensession:
screen -S <session-name>- Create a named
tmuxsession:
tmux new -s <session-name>- Display help for either utility:
screen --help
tmux --helpManage Ultra Applications
- Ultra provides
app-<appname>commands for supported applications. Replace<appname>with the application’s command name. - Display the available operations:
app-<appname> help- Start an application:
app-<appname> start- Stop an application:
app-<appname> stop- Restart an application:
app-<appname> restart- Repair an application when supported:
app-<appname> repair- Use the User Control Panel for normal application installation, uninstallation, updates, and repairs unless an application guide or Ultra support instructs you to use a shell command.
Check Storage Usage
Inspect Files and Directories
- Use
ncduto identify the files and directories using storage space:
ncdu -x ~- Use the arrow keys to navigate.
- Press Enter to open a directory.
- Press
dto request deletion of the selected item. - Press
qto exit.
- See the NCDU guide for detailed instructions.
View Disk and Traffic Statistics
- Display the recorded disk and traffic statistics:
app-stats show- Display the available filters and periods:
app-stats show --help- For more information, see Disk/Traffic Usage Command.
Understand Service Restrictions
Your Ultra shell is an unprivileged user environment.
- Install custom software only inside your home directory.
- Do not expect
rootor unrestrictedsudoaccess. - Do not attempt to install Docker or software that requires privileged kernel or system changes.
- Keep custom applications within your plan’s CPU, memory, disk, and traffic limits.
- Follow the application developer’s documentation and Ultra’s policies.
- Be aware that Ultra support may not troubleshoot unsupported custom applications.
Troubleshooting
Restore a Broken Shell Environment
A missing or damaged .bashrc or .profile can affect the shell prompt, environment variables, and application-management commands.
- Do not create replacement startup files from an unverified internet source.
- Exit the current SSH session:
exit- Reconnect through SSH to confirm that the issue persists.
- Follow Restore Default File/Folder Structure.
- Contact Ultra support if the problem continues.
Resolve a Command Not Found Error
If Bash reports that a command was not found:
- Confirm the command’s spelling and capitalization.
- Check whether the command is available:
command -v <command>- Reload your profile if you recently changed it:
source ~/.profile- Reconnect through SSH and try the command again.
- Consult the relevant Ultra application or utility guide.
If you require further assistance, you can open a support ticket here.
- Your Ultra Shell - A Beginner's Guide
- Understand Your Home Directory
- Understand Logical and Physical Paths
- Preserve Default Files and Directories
- Display Hidden Files
- Navigate Directories
- Change Directories
- List Directory Contents
- Use Tab Completion
- Work With Paths Safely
- Create Files and Directories
- Move and Rename Files
- Copy Files and Directories
- Delete Files and Directories
- Extract Archives
- Extract a ZIP Archive
- Extract a RAR Archive
- Get Command Help
- Run Long Tasks Safely
- Manage Ultra Applications
- Check Storage Usage
- Inspect Files and Directories
- View Disk and Traffic Statistics
- Understand Service Restrictions
- Troubleshooting
- Restore a Broken Shell Environment
- Resolve a Command Not Found Error