Skip to content

Chapter 3: The Command Line - your primary tool

In the previous chapter, you've logged in to LUMI. If you were successful, you saw LUMI's login wolf, a "Did you know?" fact, and a Command Line that looked similar to this:

user@LUMI: ~
     

Welcome to the Command Line Interface (CLI). The underlying program that actually reads and executes your commands here is known as the Shell.

When you use Windows or macOS, you see folders and icons. You double-click a folder to see what’s inside. On LUMI, those folders (called directories in the Command Line) and files are still there, but you are "navigating by description" rather than "navigating by sight."

Why do we use this for AI?

  • Flexibility: Graphical interfaces are often just "wrappers" that sit on top of Command Line tools. By working directly in the Shell, you're removing the middleman. You gain the ability to use every piece of software in the LUMI ecosystem exactly how the developers intended, without being restricted by visual menu options.
  • Automation: You can write a list of commands (a script) that LUMI can follow while you are asleep. You can't "script" a mouse click easily.
  • Efficiency: LUMI is optimised for math and data processing. Displaying a fancy visual desktop for thousands of users would waste massive amounts of power that should be used for your AI models instead.

Command Line study materials

To learn about the Command Line and the commands to use it, we recommend reading Linux Command Line for beginners.

If you are more of a visual learner or if this is your first time learning about the Command Line, watch this video guide (Optional).

Practice

If you prefer a visual guide, you can watch this video walkthrough of the practice steps:

The best way to learn after having studied some theory is to practise. Log in to LUMI (see Chapter 2) and let's apply what you've learned in the guides in our Command Line Terminal on LUMI. Follow these step-by-step instructions:

  1. Where am I? When you log into LUMI using ssh as we did in Chapter 2, you end up in your user's $HOME folder (this is the current "Working Directory"). Check it by running the pwd (print Working Directory) command:

    user@LUMI: ~
    pwd

    The output (what is printed/shown on the screen) should be /users/<username>. This is "where you are" now.

  2. Create a directory and name it "first_dir" using mkdir (make directory):

    user@LUMI: ~
    mkdir first_dir

    If it was successful, mkdir has no output (it won't print a "Success!" message, it will just drop you to a new, empty prompt). Check the result by listing all the files and directories in the current Working Directory:

    user@LUMI: ~
    ls

    You should see your new directory there.

  3. Move Inside. Change your Working Directory to the new directory using cd (change directory):

    user@LUMI: ~
    cd first_dir

    Notice that the text at the beginning of your line has updated to include ~/first_dir>. This indicates that you are now inside the new folder.

  4. Create a Document. While in the new directory, create a new text file using nano, a very simple text editor:

    user@LUMI: ~
    nano first_file.txt

    Once the editor opens, follow these steps to add content and save it:

    • First, type or paste some text into the editor (if pressing ctrl+V doesn't work, try ctrl+shift+V or right-click to paste).
    • Then, save the file by pressing ctrl+S. To help you remember, "S" in this case stands for "save".
    • Finally, exit the editor by pressing ctrl+X. "X" stands for "exit".
  5. View the file:

    user@LUMI: ~
    less first_file.txt

    Press q to exit the less viewer.

  6. Upload a file. Even though we are working in the Command Line, using the web interface is the simplest way to upload a small file from your machine (PC/laptop) to LUMI:

    • Open www.lumi.csc.fi in your browser (don't close your Terminal!), log in and go to Home directory. This is your $HOME user directory. There you should see our first_dir folder (do not click into it so your upload lands in $HOME, not inside first_dir).
    • Click "Upload" and select any image from your computer to upload directly to your $HOME directory. If you don't have one at hand, download a random image from the internet for this exercise.
  7. Navigate to the Parent Directory. Open your Terminal. Return to the "Parent Directory" of the current Working Directory:

    user@LUMI: ~
    cd ..

    Now, when you're in your $HOME directory you should see the file that you uploaded there (Hint: use ls to check that it's there).

  8. Copy the uploaded image to the new directory using cp (copy). Replace <your_image.png> with the actual name of your file (using its actual extension, like .jpg or .jpeg if it's not a .png), and run:

    user@LUMI: ~
    cp <your_image.png> first_dir

    Change your Working Directory to first_dir and list the files in it. Hint: look at steps 2 and 3.

  9. Rename the copied image. Let's rename it to renamed_image.png (using your file's actual extension if it's not .png, like renamed_image.jpg). We use the mv (move) command for this, as renaming is essentially moving a file to the same location under a new name:

    user@LUMI: ~
    mv <your_image.png> renamed_image.png
  10. Delete the original image. Use rm (remove) to delete the original image that we left in the Parent Directory:

    user@LUMI: ~
    rm ../<your_image.png>

    Make sure that the original image has been removed by navigating to the Parent Directory and listing the files there.

  11. Clear the screen. If your Terminal is getting cluttered, you can clear all previous output to get a fresh screen. This just moves previous commands and outputs out of view (but doesn't remove or reverse anything):

    user@LUMI: ~
    clear
  12. Disconnect. Great job! You can now disconnect from LUMI by pressing Ctrl+D. You will notice the Command Line prompt change back to your local computer's format (such as username@your_computer on Mac/Linux, or C:\Users\Name on Windows). This confirms you are safely back on your machine.

You can learn more about Linux Command Line on the Linux basics tutorial for CSC page. (Optional)

Your Command Line cheatsheet

Command / KeyActionQuick Note
pwdPrint Working Directory"Where am I right now?"
lsListShow all files and folders here.
mkdir <name>Make DirectoryCreate a new folder.
cd <name>Change DirectoryEnter a folder.
cd ..Navigate UpMove up to the "parent" folder.
nano <file>Text EditorCreate or edit text files.
less <file>View FileRead a file without editing it (press q to exit).
cp <old> <new>CopyCopy a file to a new location (or/and under a new name).
mv <old> <new>Move / RenameMove a file or change its name.
rm <file>removeIrreversibly delete a file
clearClearClear the terminal screen (moves output out of view).
TABAutocompleteType a few letters and hit Tab to finish the name.
Ctrl + SSaveSave changes in the nano editor.
Ctrl + XExitClose the nano editor.
Ctrl + DDisconnectLogout from LUMI and return to your local machine.

Summary checklist

  • You know what a Command Line is and why it is used.
  • You have learned the basics of the Command Line.
  • You have practised learned commands on LUMI.

Knowledge check

Chapter 3 Quiz
Question 1 of 6

Why do AI developers primarily use the Command Line Interface (CLI) instead of graphical desktops on a supercomputer?

Select all that apply.

© 2026 LUMI AI FactoryContent licensed under CC BY 4.0Code licensed under the MIT Licence

The LUMI AI Factory Service Center is funded jointly by the EuroHPC Joint Undertaking and the Participating States FI, CZ, DK, EE, NO, PL.