Skip to content
Snippets Groups Projects

Update 3 files

Merged Fanny Wegner requested to merge master-patch-5bbb into master
3 files
+ 201
3
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -27,6 +27,7 @@ cp foo.txt bar.txt # Copy file
mv foo.txt bar.txt # Move/Rename file
rm foo.txt # Delete foo.txt
rm * # Delete all files in current directory
ln -s foo bar # Create a link 'bar' to the file 'foo'
```
## Read and manipulate files
@@ -39,6 +40,7 @@ tail foo.txt # Print bottom 10 lines of file
nano foo.txt # Simple file editor
vi foo.txt # Advanced file editor
wc foo.txt # List number of lines words and characters in the file
cut -d [delimiter] -f [field] foo.txt # Cuts out the specified fields that are separated by the specified delimiter
```
## Input and Output
@@ -47,7 +49,43 @@ wc foo.txt # List number of lines words and characters in the file
echo "Hello world!" # Print statement to standard output
echo "foo" > bar.txt # Direct output into file. Overwrites file if it already exists.
echo "foo" >> bar.txt # Direct output into file and append if it already exists.
command 1 | command2 # Directs output from command1 as standard input into command2
command1 | command2 # Directs output from command1 as standard input into command2
```
<br><br>
# SLURM Cheat Sheet
## Connect to Science Cluster
```bash
ssh shirtname@cluster.s3it.uzh.ch
```
## Submitting jobs
In a script `myjob.sh`:
```bash
#!/usr/bin/env bash
#SBATCH --cpus-per-task=[number]
#SBATCH --mem=[memory]
#SBATCH --time=[hr:min:sec]
#SBATCH --job-name=[name]
#SBATCH --output=[name]_%j.out
#SBATCH --error=[name]_%j.err
# load any required modules
module load [module name]
command1
command2
command3
```
Submit script as job to the computing nodes:
```bash
sbatch myjob.sh
```
Loading