Linux Introduction: Difference between revisions

From RCSWiki
Jump to navigation Jump to search
Line 17: Line 17:
  $ newgrp groupname
  $ newgrp groupname


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


To see all the groups you belong to:
To see all the groups you belong to:

Revision as of 20:36, 1 September 2021

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.


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.

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