Easy Glide into Linux

Click here to read a transcript of the audio.

You've gone through the Get Set Up page and now should have this web page and the window to the remote Linux computer both visible on your screen. A bit of overlap is ok, but you need to be able to read the instructions on this page and see the remote computer window as you type in commands and watch the results. Please don't cut and paste, this is learning by doing and you will get more out of actually doing!

This tutorial is divided into easy to handle chunks with alternating audio discussions and commands shown. After you've listened to an audio clip or read the transcript, type in the command into the window, as directed, and check to make sure it works. If you don't execute each command (shown in the examples below in bold face) and think about the result (not shown - you need to execute the commands to see the results) you won't get the full benefit. Then play the next audio or read the next transcript. Each section has an explanatory title.
|Don't make your browser window narrower than this or you'll miss things. →|


It's best to go through the sections below in order - but this could help to find sections when you return after a break or want to review something:
Listing Directory Contents : Creating and Editing Files : Viewing File Contents : Copying, Moving and Removing Files : Man Pages : Directories : Exiting Linux : What's Next : Learning More
Entering Commands

Transcript

[hes@vm18-165 ~]$ _
← your typing will start at the cursor position indicated by _
Note: Your userid will be in the prompt, not mine, and the id of the remote computer you are using will be there instead of the ones I used for these examples. To the right is a picture of the command line in a command window with the cursor shown.

showing login line as at left


Listing Directory Contents

Note: in Linux UPPER and lower case are considered to be different, so use the case as shown in these examples. The keyboard key called Enter or Return will simply be referred to as the Enter key.

Transcript

[myid@vm18-165 ~]$ ls
Transcript

[myid@vm18-165 ~]$ ls -l
Transcript

[myid@vm18-165 ~]$ ls c
We'll come back to directories in a while and permissions later, but for now we'll work on files and their contents. P.S. It's best to not have blanks in file or directory names. (It can be done, but requires extra effort to work with. We won't deal with that here.)
Three different ways of using the ls command.

If you're really having trouble.

Note: The ~ is twiddle/tilde symbol which was mentioned.


Creating and Editing Files
Let's look at creating and editing text files.

Transcript

[myid@vm18-165 ~]$ nano nexample
Transcript

[myid@vm18-165 ~]$ ls [myid@vm18-165 ~]$ nano nexample
  GNU nano 2.3.1                File: nexample


          [This is what the nano window looks like when
           entering the nexample file, except that this 
           doesn't show the black highlighting. The ^
           indicates holding down the Ctrl key. To scroll
           through a file longer than your nano window
           use the up and down arrow keys.]


^G Get Help  ^O WriteOut  ^R Read File ^Y Prev Page ^K Cut Text  ^C Cur Pos
^X Exit      ^J Justify   ^W Where Is  ^V Next Page ^U UnCut Text^T To Spell

For more on nano, a tutorial.

Viewing Text File Contents

Transcript

[myid@vm18-165 ~]$ cat nexample [myid@vm18-165 ~]$ less nexample
  (For less: space bar → next page; b → previous page; and q → exit.)
  (For cat, less, head and tail: Ctrl-C i.e. hold down control and press C, will exit.)
[myid@vm18-165 ~]$ head nexample [myid@vm18-165 ~]$ tail nexample
Transcript

[myid@vm18-165 ~]$ cat a
Transcript

[myid@vm18-165 ~]$ cat nexample a
Transcript

[myid@vm18-165 ~]$ cat nexample a > merged-file
And then use cat to see what's in the file merged-file. It will show the contents of nexample followed by the contents of a.

Using >> instead of > will add the output to the the end of an existing file given after the >>, instead of putting the output in a new file. (Be careful, if you put an existing file's name after >, the file will be replaced - with no warning given.)

If you're really having trouble.


Copying, Moving and Removing Files

Transcript

[myid@vm18-165 ~]$ cp a a-new [myid@vm18-165 ~]$ ls -l
Transcript

[myid@vm18-165 ~]$ rm a-new [myid@vm18-165 ~]$ ls -l
Transcript

[myid@vm18-165 ~]$ cp a a-new [myid@vm18-165 ~]$ ls [myid@vm18-165 ~]$ mv a-new xyz [myid@vm18-165 ~]$ ls [myid@vm18-165 ~]$ mv xyz c/xyz      Note: c is a directory name [myid@vm18-165 ~]$ ls [myid@vm18-165 ~]$ ls c
Transcript

What's Next, near the bottom of this page, discusses local/remote file transfer.

A small time-saving tip: The up arrow key on the keyboard will scroll up to show past commands which can be executed or modified and then executed. The down arrow key will scroll down.


Linux Manual Pages

Transcript

  As with less: space bar → next page; b → previous page; and q → exit.)

[myid@vm18-165 ~]$ man man [myid@vm18-165 ~]$ man ls

Directories

Transcript

[myid@vm18-165 ~]$ pwd
Transcript

[myid@vm18-165 ~]$ cd /home [myid@vm18-165 home]$ pwd [myid@vm18-165 home]$ ls
Transcript

[myid@vm18-165 home]$ cd
Transcript

[myid@vm18-165 ~]$ cd .. [myid@vm18-165 home]$ cd
Transcript

[myid@vm18-165 ~]$ mkdir mynewdir [myid@vm18-165 ~]$ ls
Transcript

[myid@vm18-165 ~]$ rmdir mynewdir [myid@vm18-165 ~]$ ls
                    For a more visual display of the tree structure.


Leaving a Linux Session

Transcript

[myid@vm18-165 ~]$ exit [myid@vm18-165 ~]$ logout

What's Next

Transcript

Transferring Files between local and remote computers This will be needed for serious projects, and so will
File Permissions when you are running your own programs or working with others.

Some more useful commands and Linux functionality


Learning More
This Easy Glide is meant to be a short easy way to get started. The Linux man pages can be helpful at times, but are very condensed and aimed at people who already know most or all of the material and just need to jog their memory or add a detail.

Next, using a good quality online Linux tutorial would be a good idea. They generally are aimed at readers who have gone through the basics and want to learn more. e.g., for the general Linux environment. This is a pretty comprehensive guide to starting to use the Linux terminal. Another one only uses a local computer and explains how to install the necessary software into a Windows computer (the Mac already has what's needed.) If you go this route, and/or can't use the VCL, this details how to set up the Glide environment. Red Hat has a free online course Red Hat Enterprise Linux Technical Overview which is oriented to people "seeking a high-level understanding of Linux." and looks career oriented.

Scripting can be extremely useful when one gets into production work. Typing in a sequence of many commands, often with many options, is tedious and error prone. But a full treatment of this is beyond the scope of our Easy Glide. A short motivational discussion on command line commands and scripting is at Five reasons why researchers should learn to love the command line. Luckily there are a number of extended tutorials, such as Linux bash scripts from the Finish CSC - IT Center for Science, and this from GeeksforGeeks. A free eBook also covers this area.


Copyright 2019, 2020, 2021, 2022 by Henry E. Schaffer. Comments and suggestions are welcome, and should go to hes@ncsu.edu
Licensed under the Creative Commons Attribution-NonCommercial 4.0 International Public License https://creativecommons.org/licenses/by-nc/4.0/legalcode
Last updated 3/31/2025.