TRACER TUTORIAL: TEXT REUSE DETECTION INTRODUCTION TO THE COMMAND LINE AND ACCESSING SERVERS REMOTELY M arco B¨ uchler, Emily Franzini and Greta Franzini
TABLE OF CONTENTS 1. C onnecting to the server 2. Command line introduction 2/100
CONNECTING TO THE SERVER
CONNECTING TO THE SERVER 1. Mac + Linux: Open a terminal 2. Connect to server via ssh -l <login> 192.168.11.4 3. Enter password 4. Windows: Start Putty 4/100
COMMAND LINE INTRODUCTION
WHICH FOLDER AM I IN ON THE SERVER? To identify your current directory location: • Command: pwd (parent working directory) • Usage: pwd <ENTER> • Example: pwd <ENTER> /Users/mbuechler 6/100
WHICH FILES DOES MY PWD CONTAIN? To list directory contents: • Command: ls (list) • Usage: • ls -l <FOLDER> <ENTER> // list all files and directories, one per line; • ls -la <FOLDER> <ENTER> // show also hidden files; • ls -lh <FOLDER> <ENTER> // show e.g. file sizes in a human-readable format. • Example: • ls -l <ENTER> • ls -lh /home/mbuechler <ENTER> 7/100
HOW TO CHANGE TO A DIFFERENT DIRECTORY? To change to 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> 8/100
HOW TO CREATE A FOLDER? 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” 9/100
HOW TO COPY A FILE? 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 10/100
HOW TO REMOVE A DIRECTORY? To remove a directory: • Command: rm (removes a directory or a file) • Usage: rm -r <PATH TO FILE OR FOLDER> <ENTER> • Example: rm /storage/mbuechler/test <ENTER> 11/100
HOW TO RUN A JAVA PROGRAMME? To run a Java programme: • Command: java (run a java programme) • Usage: java -Xmx1g -Dproperty=value -jar <programme> <ENTER> • Example: java -jar HelloWorld.jar 12/100
HOW TO EDIT A FILE? To edit a file: • Command: vim (vi improved) • Usage: vim <file name> <ENTER> • Example: vim .bash profile (use cd first) 13/100
HOW TO EDIT A FILE? vim commands: 1. Change to editor modus: type i (insert) 2. Leave editor modus: press ESC 3. Leave vim without writing changes to the disc: type :q! 4. Leave vim and write changes to the disc: type :wq 14/100
EDIT THE BASH PROFILE vim commands: 1. Change to home folder : cd /home/mbuechler 2. Edit bash profile: vim .bash profile 3. Add two lines to select the correct Java version: 15/100
ENCODING GUIDE 1. Most UTF-8 editors display the file encoding. 2. If you’re unsure about the encoding of your data or cannot display it correctly in a text editor, if the file is not too big try opening it in your standard text processing program (e.g. Microsoft Word or Open Office) to find information regarding the encoding. 3. Windows machines: install Cygwin from https://cygwin.com/install.html • COPY your .txt files to your Cygwin user directory and then: $ file *.txt • Depending on the output, list all possible encodings: $ iconv -l • And re-encode (e.g. Windows Hebrew to UTF-8): $ iconv -f CP1255 -t UTF-8 in.txt > out.txt 16/100
FINITO! 17/100
CONTACT Team Marco B¨ uchler, Greta Franzini and Emily Franzini. Visit us http://www.etrap.eu contact@etrap.eu 18/100
LICENCE The theme this presentation is based on is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Changes to the theme are the work of eTRAP. cba 19/100
Recommend
More recommend