Introduction to line and accessing servers remotely

Marco Büchler, Emily Franzini, Greta Franzini, Maria Moritz eTRAP Research Group Göttingen Centre for Digital Humanities Institute of Computer Science Georg August University Göttingen, Germany

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 am I?

• 2001/2 of Quality Assurance department in a software company • 2006 Diploma in Computer Science on big • scale co-occurrence analysis • 2007- Consultant for several SMEs in IT sector • 2008 Technical project management of eAQUA project • 2011 PI and project manager of eTRACES project • 2013 PhD in „Digital Humanities“ on Text Reuse • 2014- Head of Early Career Research Group eTRAP Göttingen Centre for Digital Humanities

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 Agenda

1) Connecting to the server 2) Some command line introduction

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 Connecting to the server

1) Windows: Start Putty 2) Mac + Linux: Open a terminal 3) Connecting to server via ssh -l 192.168.11.4 4) Enter password

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 folder am I on the server?

Command: (parent working directory)

Usage: pwd

Example: pwd

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 Which files and directories are contained in my pwd?

Command: (list)

Usage: ls -l // list all files and directory one on each line ls -la // show also hidden files ls -lh // show e.g. files sizes in human- friendly version

Example: ls -l ls -lh /home/mbuechler

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 How to change a different directory?

Command: (change directory)

Usage: cd // change to

Example: cd ~ // change to „home folder“ cd /storage cd ..

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 How to create a folder?

Command: ( directory)

Usage: mkdir // change to folder

Example: mkdir /storage/mbuechler // creates a directory in /storage called mbuechler

mkdir /storage/mbuechler/ // creates a directory in /storage/mbuechler called test

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 How to copy a ?

Command: (copy file)

Usage: cp

Example: cp /storage/HelloWorld.jar /storage/mbuechler // copies HelloWorld.jar to /storage/mbuechler

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 How to remove a directory?

Command: (removes directory or file)

Usage: rm -r

Example: rm /storage/mbuechler/test

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 How to run a java programme?

Command: java (run a java programme)

Usage: java -Xmx1g -Dproperty=value -jar

Example: java -jar HelloWorld.jar

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 How to edit a file?

Command: vim ( improved)

Usage: vim

Example: vim .bash_profile (use cd ~ first)

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 How to edit a file?

vim command: 1) Change to editor modus: „i“ (insert) 2) Leave editor modus: press ESC-button 3) Leave vim without writing changes to disc: type „:q!“ 4) Leave vim with writing changes to disc: type „:wq“

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 Edit the bash_profile

vim command: 1) Change to home folder: cd /home/mbuechler 2) Edit bash_profile: vim .bash_profile 3) Add two lines for adding the correct java version:

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 Encoding guide

1) UTF-8 editors are able to display the encoding (e.g. on the bottom) 2) If you are not sure, which encoding your data is in or have troubles to display them properly in an editor AND the file is not too big, you can try to open it in your standard text processing program (e.g.Word) to information on the encoding. 3) Windows: install (https://cygwin.com/install.html) 4) After you made sure your .txt files are COPIED to your (cygwin) user directory: $ file *.txt

5) Depending on the output, list all possible encodings: $ iconv -l

6) And re-encode (e.g. Windows Hebrew to UTF-8): $ iconv -f CP1255 -t UTF-8 in.txt > out.txt

DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015