Linux and Terminal basics
Your DGX Spark runs Linux. A few commands will take you a long way. pwd shows the folder you're in. ls lists what's there. cd moves you into another folder.
Chapters
- 0:00Introduction
- 0:06Find your way: Where am I?
- 0:15Files: Make and copy
- 0:22Look: Read files
- 0:31Take care: Think before delete
- 0:43Check up: How is the machine?
- 0:48Stuck?: Ask for help
- 0:55From afar: Log in remotely
- 1:03Wrap up
Read the transcript
Introduction
Your DGX Spark runs Linux. A few commands will take you a long way.
Find your way: Where am I?
pwd shows the folder you're in. ls lists what's there. cd moves you into another folder.
pwd
ls -la
cd projectsFiles: Make and copy
Make a folder with mkdir. Copy files with cp, and move or rename them with mv.
mkdir notes
cp report.txt notes/
mv notes/report.txt notes/old.txtLook: Read files
Less shows a file a page at a time. Press Q to leave. Tail follows a log as it grows. Grep finds lines that match.
less notes/old.txt
tail -f server.log
grep -i error server.logTake care: Think before delete
rm deletes, and there's no bin to rescue it from. Read the whole command first. Sudo runs a command with full power. Don't paste commands you don't understand.
Check up: How is the machine?
Check free space, memory, and what's busy.
df -h
free -g
topStuck?: Ask for help
Most commands explain themselves. Add --help, or open the manual page.
ls --help
man lsFrom afar: Log in remotely
From another computer, use SSH, with your user name and the machine's name. Type exit when you're done.
ssh you@your-spark
hostname
exitWrap up
Look first, then act. The terminal gets friendlier fast.
Sources
- ubuntu.com/tutorials/command-line-for-beginners
- man7.org/linux/man-pages/man1/ls.1.html
- docs.nvidia.com/dgx/dgx-spark/index.html