Linux 101

Files and Directories on Linux

Linux isn't so different from the files and folders you're used to on your Windows or Mac computer. However, you're more likely to be accessing them from a text-based command line rather than a point-and-click interface.

Some important distinctions when using Linux:

  • upper-case and lower-case matter

    MyNotes.txt is not the same file as mynotes.txt

  • names with spaces in them may confuse certain applications - use underscores instead of spaces

    my_file instead of my file

  • More advanced file types are sometimes used on Linux - Google them if you run across them:

    • symlinks, hard links, named pipes, etc.

Getting around Linux

Start with these two commands:

  • ls shows a listing of the current folder/directory

    [user@computer ~]$ ls
    
    Desktop        Documents        Downloads
    Pictures       projects         Templates
  • cd <directory_name> changes into the directory you specify

    [user@computer ~]$ cd Documents

There are great Linux resources on the web:

The shell (Command Line Interface)

We use the Bourne Again Shell (Bash). Bash is the default shell for most Linux distributions. It works very well and there's no need to worry about other shells if you're just getting started.

Google bash script or bash programming when writing batch scripts (which you would submit to Torque or SLURM).

You can customize the way your shell looks and operates in real-time, but you'll need to edit the start-up file (~/.bash_profile) to make these changes permanent.

Other Notes on Linux

Linux is often more flexible than other operating systems, but requires an adjustment period. You will notice differences - for example, file extensions are often unnecessary or ignored. There's no need to put .txt or .exe at the end of each file.

If there's a task you're trying to accomplish, it's likely someone else has already written the software and posted the tool online for all to see. Google it!

Last updated