Introduction to command line and accessing servers remotely Marco - - PowerPoint PPT Presentation

introduction to command line and accessing servers
SMART_READER_LITE
LIVE PREVIEW

Introduction to command line and accessing servers remotely Marco - - PowerPoint PPT Presentation

Introduction to command line and accessing servers remotely Marco Bchler, Emily Franzini, Greta Franzini, Maria Moritz eTRAP Research Group Gttingen Centre for Digital Humanities Institute of Computer Science Georg August University


slide-1
SLIDE 1
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

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

slide-2
SLIDE 2
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

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

slide-3
SLIDE 3
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

Agenda

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

slide-4
SLIDE 4
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

Connecting to the server

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

slide-5
SLIDE 5
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

Which folder am I on the server?

Command: pwd (parent working directory) Usage: pwd <ENTER> Example: pwd <ENTER>

slide-6
SLIDE 6
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

Which files and directories are contained in my pwd?

Command: ls (list) Usage: ls -l <FOLDER> <ENTER> // list all files and directory one on each line ls -la <FOLDER> <ENTER> // show also hidden files ls -lh <FOLDER> <ENTER> // show e.g. files sizes in human- friendly version Example: ls -l <ENTER> ls -lh /home/mbuechler <ENTER>

slide-7
SLIDE 7
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

How to change a different directory?

Command: cd (change directory) Usage: cd <FOLDER> <ENTER> // change to <folder> Example: cd ~ <ENTER> // change to „home folder“ cd /storage <ENTER>

cd .. <ENTER>

slide-8
SLIDE 8
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

How to create a folder?

Command: mkdir (make directory) Usage: mkdir <FOLDER> <ENTER> // change to folder Example: mkdir /storage/mbuechler <ENTER>

// creates a directory in /storage called mbuechler mkdir /storage/mbuechler/test <ENTER> // creates a directory in /storage/mbuechler called test

slide-9
SLIDE 9
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

How to copy a file?

Command: cp (copy file) Usage: cp <PATH_TO_FILE> <TARGET_FOLDER> <ENTER> Example: cp /storage/HelloWorld.jar /storage/mbuechler <ENTER>

// copies HelloWorld.jar to /storage/mbuechler

slide-10
SLIDE 10
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

How to remove a directory?

Command: rm (removes directory or file) Usage: rm -r <PATH_TO_FILE_OR_FOLDER> <ENTER> Example: rm /storage/mbuechler/test <ENTER>

slide-11
SLIDE 11
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

How to run a java programme?

Command: java (run a java programme) Usage: java -Xmx1g -Dproperty=value -jar <programme> <ENTER> Example: java -jar HelloWorld.jar

slide-12
SLIDE 12
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

How to edit a file?

Command: vim (vi improved) Usage: vim <file_name> <ENTER> Example: vim .bash_profile (use cd ~ first)

slide-13
SLIDE 13
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

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“

slide-14
SLIDE 14
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

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:

slide-15
SLIDE 15
  • 20. Oktober 2015

DH Estonia 2015 - Text Reuse Hackathon

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