Quality of Life tips 2019-11-26 Anders Sjlander - - PowerPoint PPT Presentation

quality of life tips
SMART_READER_LITE
LIVE PREVIEW

Quality of Life tips 2019-11-26 Anders Sjlander - - PowerPoint PPT Presentation

Quality of Life tips 2019-11-26 Anders Sjlander anders.sjolander@uppmax.uu.se Terminal improvements There are a lot of small tips that will improve your experience greatly. This lecture will cover some of them: Navigating the


slide-1
SLIDE 1
slide-2
SLIDE 2

Quality of Life tips

2019-11-26 Anders Sjölander anders.sjolander@uppmax.uu.se

slide-3
SLIDE 3

Terminal improvements

  • There are a lot of small tips that will improve your

experience greatly.

  • This lecture will cover some of them:

○ Navigating the terminal ○ Finding files and contents of files

  • Also covered: How to transfer files to/from Rackham
slide-4
SLIDE 4

Command history

  • Up & down arrow to step through history
slide-5
SLIDE 5

Command history

  • Up & down arrow to step through history
  • Ctrl+r to search through previous commands
slide-6
SLIDE 6

Command history

  • Up & down arrow to step through history
  • Ctrl+r to search through previous commands

○ Ctrl+r again to search further back

slide-7
SLIDE 7

Quicker cursor

  • Navigating the command line can be done quicker

than with just left and right arrows

slide-8
SLIDE 8

Quicker cursor

  • Navigating the command line can be done quicker

than with just left and right arrows

ctrl+a and ctrl+e places the cursor at the beginning and end of command line respectively

slide-9
SLIDE 9

Quicker cursor

  • Navigating the command line can be done quicker

than with just left and right arrows

ctrl+a and ctrl+e places the cursor at the beginning and end of command line respectively alt+b to go back a word, alt+f to go forward

slide-10
SLIDE 10

Cursor position

  • No need to be at end of line when pressing enter
  • Only determines where you type or erase

$ echo “Position not important”

slide-11
SLIDE 11
  • No need to be at end of line when pressing enter
  • Only determines where you type or erase

$ echo “Position not important”

Cursor position

slide-12
SLIDE 12

Previous directory

  • Remembers previous directory

user@rackham5 ~/ $

slide-13
SLIDE 13

Previous directory

  • Remembers previous directory

user@rackham5 ~/ $ cd /proj/g2019020

slide-14
SLIDE 14

Previous directory

  • Remembers previous directory

user@rackham5 ~/ $ cd /proj/g2019020 user@rackham5 /proj/g2019020 $

slide-15
SLIDE 15

Previous directory

  • Remembers previous directory

user@rackham5 ~/ $ cd /proj/g2019020 user@rackham5 /proj/g2019020 $ cd -

slide-16
SLIDE 16

Previous directory

  • Remembers previous directory

user@rackham5 ~/ $ cd /proj/g2019020 user@rackham5 /proj/g2019020 $ cd - user@rackham5 ~/ $

slide-17
SLIDE 17

Previous directory

  • Remembers previous directory

user@rackham5 ~/ $ cd /proj/g2019020 user@rackham5 /proj/g2019020 $ cd - user@rackham5 ~/ $ cd -

slide-18
SLIDE 18

Previous directory

  • Remembers previous directory

user@rackham5 ~/ $ cd /proj/g2019020 user@rackham5 /proj/g2019020 $ cd - user@rackham5 ~/ $ cd - user@rackham5 /proj/g2019020 $

slide-19
SLIDE 19

Rsync & SCP

  • Copy files between computers
  • Similar syntax as cp

rsync user@host:/path/to/file /local/path

slide-20
SLIDE 20

Rsync & SCP

  • Copy files between computers
  • Similar syntax as cp

rsync user@rackham.uppmax.uu.se:/home/user/t.txt .

slide-21
SLIDE 21

Rsync & SCP

  • Copy files between computers
  • Similar syntax as cp
  • rsync: -a save modification time, -P show progress

rsync -aP user@rackham.uppmax.uu.se:/home/user/t.txt .

slide-22
SLIDE 22

Rsync & SCP

  • Copy files between computers
  • Similar syntax as cp
  • rsync: -a save modification time, -P show progress
  • Copy files either direction

rsync -aP t.txt user@rackham.uppmax.uu.se:/home/user/

slide-23
SLIDE 23

Rsync & SCP

  • Copy files between computers
  • Similar syntax as cp
  • rsync: -a save modification time, -P show progress
  • Copy files either direction

rsync -aP user@rackham.uppmax.uu.se:/sw/courses/ngsintro/qol/aa.fa .

slide-24
SLIDE 24

Find

  • Find files based on name

$ find /path/to/look/ -name nametolookfor.txt

slide-25
SLIDE 25

Find

  • Find files based on name

$ find /path/to/look/ -name nametolookfor.txt $ find . -name *.txt

slide-26
SLIDE 26

Grep

  • Searches content of files

$ grep texttofind filetolookin.txt

slide-27
SLIDE 27

Grep

  • Searches content of files

$ grep texttofind filetolookin.txt $ grep “text to find” /path/to/files/*.txt

slide-28
SLIDE 28

Grep

  • Searches content of files

$ grep texttofind filetolookin.txt $ grep “text to find” /path/to/files/*.txt $ grep MYNAME protein_seq.fa

slide-29
SLIDE 29

Grep

  • Searches content of files

$ grep texttofind filetolookin.txt $ grep “text to find” /path/to/files/*.txt $ grep MYNAME protein_seq.fa $ grep -r found filetree

slide-30
SLIDE 30

Ctrl+c

  • Kills whatever your terminal is currently running

○ Sometimes we want to end programs prematurely, for whichever reason.

slide-31
SLIDE 31

Ctrl+c

  • Kills whatever your terminal is currently running

○ Destroys hanged or non-executing commands ○ Cancel commands that are running for too long ○ Cancel commands that you realize are incorrect

slide-32
SLIDE 32

UPPMAX cheat sheet

  • https://uppmax.uu.se/support/getting-started/uppmax-cheat-sheet/
slide-33
SLIDE 33

Using multiple terminals

  • Launch and use several terminals for better
  • verview of your work

○ Write your scripts in one terminal, run your scripts in another, read the output in a third…

  • Just like you might have several tabs in your

browser or have several documents open at once