Each time we launch the terminal application, it creates a new session. The session immediately loads settings and preferences that make up the command line environment.

We can configure the environment to support the commands and programs we create. This enables us to customize greetings and create nicknames (aliases) for commands, and create variables to share across commands and programs.

You can reference the filesystem for this lesson with this diagram.

In this first exercise, let’s pull up a basic command line text editor called nano. Follow the steps below to create and save your first file in the terminal.

Note: If you are having trouble in nano and need to exit, use Ctrl + X.



In the terminal, type:

nano hello.txt

This will open the nano text editor.


In nano, at the top of the window, type:

"Hello, I am nano."

Using the menu at the bottom of the terminal for reference, type Ctrl + O (the letter, not zero) to save the file. The keys are not case-sensitive, so don’t worry about capitalizing.

Press Enter, when prompted about the filename to write.

Then type Ctrl + X to exit nano.

Finally, type

cat hello.txt

to confirm that there are now contents in hello.txt.

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?