-
Notifications
You must be signed in to change notification settings - Fork 6
Useful Unix commands
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 username@helix.nih.gov:/home/username/myfile .
How to upload a local file to Helix:
$ scp mylocalfile username@helix.nih.gov:/home/username
To run Matlab remotely, you need to tunnel the X-windows connection through the SSH connection as follows:
$ ssh -X username@helix.nih.gov
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 script 'netgen.py' on all files in current directory with extension 'ws':
$ for file in *.ws; do
$ python netgen.py $file
$ done
About
Getting Started
Essentials
Tutorials
Extras