Hello, I'm Arthur. When I started working with AI projects, I realized that knowing Python was not enough. I also needed to understand how to manage files, monitor resources, and troubleshoot problems on a Linux server.
Many AI developers use Linux because it provides a flexible environment for running Python applications, machine learning frameworks, and GPU workloads.
Here are seven Linux commands that can make your development work easier.
1. Check Your Current Directory
When working on a server, it is easy to lose track of where your files are located.
The pwd command shows your current working directory.
pwd
This is useful when switching between project folders or running scripts from different locations.
2. List Files and Directories
The ls command displays files and directories in your current location.
ls -lah
The options provide additional details, including hidden files, file sizes, and permissions.
This can help you quickly check whether a dataset, Python script, or configuration file is present.
3. Monitor CPU and Memory Usage
AI applications can consume significant system resources.
The top command shows running processes and system resource usage.
top
You can use it to identify processes consuming large amounts of CPU or RAM.
If a training job becomes unexpectedly slow, checking system resources is a useful first step.
4. Check Available Disk Space
AI datasets, model weights, and checkpoints can take up a lot of storage.
The df command helps you check available disk space.
df -h
If your disk is nearly full, you may encounter errors when downloading datasets, saving checkpoints, or installing packages.
Checking storage regularly can help prevent these problems.
5. Find Large Files
Sometimes, a project directory contains old checkpoints or datasets that are no longer needed.
The du command helps identify which directories are using the most storage.
du -sh ./*
This displays the approximate size of each item in the current directory.
Before deleting anything, make sure the files are not needed for your project.
6. Monitor GPU Usage
For developers working with NVIDIA GPUs, nvidia-smi is one of the most useful commands.
nvidia-smi
It shows GPU utilization, VRAM usage, temperature, and running GPU processes.
For example, if your AI model runs out of memory, this command can help you check how much VRAM is currently being used.
If you are planning to run larger AI workloads, understanding GPU memory and server specifications is important. You can compare available configurations through HelloServer's dedicated GPU servers.
7. Keep Long-Running Jobs Active With tmux
AI training jobs can run for hours, so keeping a terminal session open is not always practical.
The tmux tool allows you to create a terminal session that continues running after you disconnect from SSH.
Start a session with:
tmux new -s training
Detach from the session using Ctrl+B, followed by D.
To reconnect later, use:
tmux attach -t training
This is useful when running long experiments on remote servers.
However, tmux does not protect a training job from a server reboot or system crash. For important experiments, save model checkpoints regularly.
Final Thoughts
Linux skills can make AI development much easier, especially when working on remote servers.
You do not need to memorize every command at once. Start by practicing file navigation, resource monitoring, and terminal sessions.
As your projects become more complex, these small skills can help you troubleshoot problems faster and spend more time building useful applications.
The next time you run an AI training job, try monitoring CPU, memory, and GPU usage together. Understanding how these resources work together is a valuable skill for any AI developer.
Top comments (0)