← Back to list

Tutorial:Commonly Used Commands for Glows.ai Users

This document provides a list of commonly used commands for beginners. The images provided by Glows.ai are all Linux environments. To…

Glows.ai · 2024-12-31 07:56 · 101 claps · 2.9 min read
#commands #ai-cloud #gpu #computer-power
Open on Medium ↗
Wiki topics: OPS · LLMOps & Inference AI · AI · General 🔓 · Open Source 🥊 · Combat Sports

Tutorial:Commonly Used Commands for Glows.ai Users

This document provides a list of commonly used commands for beginners. The images provided by Glows.ai are all Linux environments. To facilitate the use of Matrix Cloud instances, we have compiled a list of commonly used commands that we hope will be helpful to you.

Python

Python is the most commonly used language in machine learning, so Matrix Cloud provides multiple Python versions for use. Matrix Cloud currently supports the use of JupyterLab on the web to write Python code and also supports remote connection to local IDEs, allowing configuration from a local IDE.

JupyterLab is an interactive shell for Python that supports running Python scripts, writing Markdown documents, auto-completion of variables, auto-indentation, bash shell commands, and many useful built-in functions, providing a better experience than the native Python shell.

1.1 Python Execution

JupyterLab by default generates and uses IPython files (.ipynb). If you’re using Python files (.py), you need to run them using the python command in the Shell.

  • Create a Terminal: Open Terminal

Run Python Script: In the command line window, input the following command:

python main.py

  • This will start executing the main.py file.
  • Enter Python Interactive Shell: If you input python in the command line window, it will enter the Python interactive shell, where you can input any Python code and get immediate results. To exit, type exit() and press Enter.

1.2 pip Commands

pip is a versatile Python package management tool that enables you to search, download, install, and uninstall Python packages. You can execute pip commands in the Shell or use !pipwithin IPython.

If the pre-installed Python packages on Matrix Cloud do not meet your requirements, you can use pip to install the necessary packages or contact Matrix Cloud support for assistance.

To learn how to use pip commands, follow the format below:

File System Commands with Glows.ai

  • List files and directories:
pip <command> [options]

Here are some common pip commands for the beautifulsoup4package:

  • Install the latest version:
pip install beautifulsoup4
  • Install a specific version:
pip install beautifulsoup4==4.0.1
  • Upgrade to the latest version:
pip install -U beautifulsoup4
  • Install from a specific source:
pip install beautifulsoup4 -i http://mirrors.aliyun.com/pypi/simple/
  • Download the package:
pip download beautifulsoup4
  • Uninstall the package:
pip uninstall beautifulsoup4
  • Show package information:
pip show beautifulsoup4

2.1 File System Commands

  • List files and directories:
ls
  • Create a file:
touch filename
  • Create a directory:
mkdir dirName
  • View file contents:
cat filename
  • View file content with paging:
less filename
  • View the first 10 lines of a file:
head filename
  • Move files:
mv f1 f2
  • Copy files:
cp f1 f2
  • Delete files:
rm filename
  • Remove a directory and its contents:
rm -r foldername
  • Change file permissions:
chmod -options filename

Compress and decompress files:

  • Compress a directory:
zip -r mydata.zip mydata
  • Decompress a file:
unzip mydata.zip
  • Compress with gzip:
gzip file
  • Decompress gzip:
gzip -d file.gz

2.2 Text Operations Commands

  • Search for text in a file:
grep pattern file

Sort file lines:

sort filename
  • Remove duplicate lines:
uniq filename
  • Output specified content:
echo "Hello World"

2.3 Directory Operations Commands

  • Change to a directory:
cd dirname
  • Output current directory:
pwd

2.4 nohup Command

The nohup command allows you to run processes in the background, ensuring they continue running even if the SSH connection is lost:

nohup python run.py &

3. Conda Common Commands

3.1 Conda-Pack

conda-pack is a command-line tool for packaging conda environments, including all binary files of installed packages, for use on different machines. Note that only Python packages are included (system-installed packages are excluded).

  • Install conda-pack:
pip install conda-pack
  • Pack an environment:
conda pack -n my_env
  • Recreate the environment:
mkdir -p my_env tar -xzf my_env.tar.gz -C my_env

3.2 Conda Export

Export the environment to an environment.yml file to recreate the environment on another system:

conda env export > environment.yml

3.3 Conda Create

  • Create a new environment:
conda create -n py36 python=3.6
  • Activate the environment:
conda activate py36
  • Deactivate the environment:
conda deactivate

Conclusion

Glows.ai provides the infrastructure and tools to simplify AI development, ensuring you can focus on creating impactful solutions. This guide aims to maximize your productivity, offering essential commands and tips for seamless operation on the platform.

Come explore Glows.ai

Learn more about us:


메타데이터
post_id
90fe6b25feb3
slug
tutorial-commonly-used-commands-for-glows-ai-users-90fe6b25feb3
url
https://medium.com/@glowsai/tutorial-commonly-used-commands-for-glows-ai-users-90fe6b25feb3
canonical_url
https://medium.com/@glowsai/tutorial-commonly-used-commands-for-glows-ai-users-90fe6b25feb3
author_url
https://medium.com/@glowsai
status
ok
fetched_at
2026-07-21 11:45:55