Introduction to command 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 Who am I?
• 2001/2 Head 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 at 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
DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 Which folder am I on the server?
Command: pwd (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: ls (list)
Usage: ls -l
Example: ls -l
DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 How to change a different directory?
Command: cd (change directory)
Usage: cd
Example: cd ~
DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 How to create a folder?
Command: mkdir (make directory)
Usage: mkdir
Example: mkdir /storage/mbuechler
mkdir /storage/mbuechler/test
DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 How to copy a file?
Command: cp (copy file)
Usage: cp
Example: cp /storage/HelloWorld.jar /storage/mbuechler
DH Estonia 2015 - Text Reuse Hackathon 20. Oktober 2015 How to remove a directory?
Command: rm (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 (vi 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: type „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) Most 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 find information on the encoding. 3) Windows: install Cygwin (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