OTS ‐ File Management - Mistium/Origin-OS GitHub Wiki

Terminal Commands Documentation

Navigating the Terminal

By default, you are in your user folder:

origin/(C) Users/[Username]

ls /path

This command lists the files in the specified directory in the terminal. You can use ls without any arguments to list all files in the current working directory. Alternatively, you can specify a path to list files in a different directory. For example:

ls /Downloads

This command will list all files in the "Downloads" directory.

Example:

ls
# Lists all files in the current working directory
ls /Documents
# Lists all files in the "Documents" directory

la

la is similar to ls but it lists every file in your system, which can be very useful for finding files that have become inaccessible to the user.

Example:

la
# Lists all files in the system

cd /path

Sets the working directory of the terminal system.

Example:

cd "/(A) System"
# Goes to a specific path

cd "My Folder"
# Goes into a folder called "My Folder"

cd Downloads
# Goes to a relative directory

pwd

Returns the working directory of the terminal system.

Example:

pwd
# Returns the current directory

cat

Concatenates a specified file to the terminal.

Example:

cat filename.txt
# Displays the contents of filename.txt

cat "My Document.docx"
# Displays the contents of "My Document.docx"

rm

Deletes a specified file immediately.

Example:

rm filename.txt
# Deletes filename.txt

rm 1234
# Deletes the file with the ID 1234

Practical Examples

Listing Files

To list all files in the "Downloads" directory:

ls /Downloads

Changing Directories

To navigate to the "Documents" directory from your user folder:

cd Documents

To navigate to a directory named "Projects" within "Documents":

cd Documents/Projects

Viewing the Current Directory

To see your current working directory:

pwd

Viewing File Contents

To display the contents of a text file named "notes.txt":

cat notes.txt

Deleting Files

To delete a file named "old_file.txt":

rm old_file.txt

To delete a file using its ID, for instance, ID 5678:

rm 5678