Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Useful Unix commands

Antonio Ulloa edited this page Jun 3, 2015 · 1 revision

Below you will find a list of some of the most frequently used commands when using LSNM in a Unix/Linux workstation. Please note that they are not meant to be exhaustive and that some of them apply only if you are located within the NIH computer network.

How to tar and zip a directory prior to copying or transferring:

$ tar -cvzf file_name.tar.gz directory_name

How to unpack and unzip a tar.gz file:

$ tar -xzvf file_name.tar.gz

How to download a file from Helix:

$ scp [email protected]:/home/username/myfile .

How to upload a local file to Helix:

$ scp mylocalfile [email protected]:/home/username

To run Matlab remotely, you need to tunnel the X-windows connection through the SSH connection as follows:

After pressing <Enter>, you will have to provide your Helix password, after which the Matlab window will be displayed on your local terminal.

How to execute same command on a number of files using a unix (bash) script loop. Let's say we want to execute the command 'netgen' on all files in current directory with extension 'ws':

$ for file in *.ws; do
$     netgen $file
$ done