Linux Introduction

From RCSWiki
Revision as of 18:55, 15 October 2021 by Ian.percel (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page provides an introduction to the elements of working at the Linux command line and Bash scripting that are most relevant for users of the computing clusters managed by Research Computing Services (RCS) as well as Compute Canada. Working at the command line is an extremely valuable skill for anyone who handles and processes large collections of data. (Nature - Five Reasons Why Researchers Should Learn to Love the Command Line) The command line is a text-only interface that emphasizes automation of complex tasks through simple scripts or short sequences of commands. Relative to working with a graphical interface, it is somewhat less intuitive and takes some time to learn. However, with a few days of work it is possible to become proficient enough to be comfortable working on HPC systems.

Linux Permissions

A detailed introduction to ls -l output and making sense of Linux permissions can be found in the wiki article: Linux Permissions

Useful commands

Change current Unix group

If you are a member of several Unix groups on a system, you default group is normally your personal group with the same name as your user name. As a result, newly created files will normally have this group ownership. Sometimes you may want to force the new files to have a different group ownership. It can be done by using the

$ newgrp groupname

command. It temporarily changes your current default group to groupname. The command actually starts and new shell. Once the shell is exited the group changes back.

To see all the groups you belong to:

$ groups

or, for a specific user:

$ groups username

Further Reading

A free book that provides a fairly illuminating dive into working at the Linux command line and Bash scripting. The main topics required for working on RCS clusters are covered in the first 4 chapters, although the chapters on shell scripting are also very useful.