Student Remote Login Procedure (see picture below): 1. Start SSH Secure Shell 2. Click the computer icon (4 th on the toolbar) 3.

Similar documents
GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Introduction to Linux. Roman Cheplyaka

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

CS246 Spring14 Programming Paradigm Notes on Linux

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

commandname flags arguments

Introduction to Unix: Fundamental Commands

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

Chapter-3. Introduction to Unix: Fundamental Commands

Outline. Structure of a UNIX command

CSCI 2132 Software Development. Lecture 4: Files and Directories

UNIX File Hierarchy: Structure and Commands

Commands are in black

INTRODUCTION TO LINUX

Introduction to Linux

Crash Course in Unix. For more info check out the Unix man pages -orhttp:// -or- Unix in a Nutshell (an O Reilly book).

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

MA 511: Computer Programming Lecture 23 Partha Sarathi Mandal

Practical 4. Linux Commands: Working with Directories

CENG 334 Computer Networks. Laboratory I Linux Tutorial

Common UNIX Commands. Unix. User Interfaces. Unix Commands Winter COMP 1270 Computer Usage II 9-1. Using UNIX. Unix has a command line interface

Files

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

CS4350 Unix Programming. Outline

Lecture # 2 Introduction to UNIX (Part 2)

Software I: Utilities and Internals

EECS2301. Lab 1 Winter 2016

Practical 5. Linux Commands: Working with Files

National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

Unix Introduction to UNIX

CS197U: A Hands on Introduction to Unix

Linux Training. for New Users of Cluster. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala

Introduction: What is Unix?

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Mauro Ceccanti e Alberto Paoluzzi

Linux Kung-Fu. James Droste UBNetDef Fall 2016

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers

UNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo

Overview of the UNIX File System

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

Getting your department account

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Esercitazione Introduzione al linguaggio di shell

You will automatically be in your user (home) directory when you login.

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Linux & Shell Programming 2014

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Filesystem Hierarchy and Permissions

Computer Systems and Architecture

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Perl and R Scripting for Biologists

Operating Systems. Copyleft 2005, Binnur Kurt

Linux Systems Administration Getting Started with Linux

Unix Workshop Aug 2014

Unix Handouts. Shantanu N Kulkarni

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Lab Working with Linux Command Line

Linux for Beginners. Windows users should download putty or bitvise:

Introduction to UNIX I: Command Line 1 / 21

Files and Directories

The landscape. File hierarchy overview. A tree structure of directories The directory tree is standardized. But varies slightly among distributions

Introduction to Linux Basics

Filesystem Hierarchy and Permissions

CS 300. Data Structures

Linux Howtos. Fedora 9 Install (114) CIS Fall Fedora 9 Install (114) Fedora 9 installation with custom partitions.

Introduction to Linux Workshop 1

Introduction to UNIX command-line

Overview of the UNIX File System. Navigating and Viewing Directories

Introduction to Linux

Linux at the Command Line Don Johnson of BU IS&T

Oxford University Computing Services. Getting Started with Unix

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Linux Kung Fu. Stephen James UBNetDef, Spring 2017

Introduction to Linux Command-Line for Beginners

CSE 390a Lecture 3. Multi-user systems; remote login; editors; users/groups; permissions

Introduction to the UNIX command line

Part 5: FTP More about this course about Internet

CSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts

Mills HPC Tutorial Series. Linux Basics I

Basic Survival UNIX.

This section reviews UNIX file, directory, and system commands, and is organized as follows:

Introduction to the Linux Command Line

Introduction to Linux Part I: The Filesystem Luca Heltai

Introduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie

Introduction to UNIX. SURF Research Boot Camp April Jeroen Engelberts Consultant Supercomputing

2) clear :- It clears the terminal screen. Syntax :- clear

Full file at

CS Fundamentals of Programming II Fall Very Basic UNIX

System Administration

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

EECS 2031E. Software Tools Prof. Mokhtar Aboelaze

5/20/2007. Touring Essential Programs

Hitchhiker s Guide to VLSI Design with Cadence & Synopsys

Introduction to Linux

Practical Session 0 Introduction to Linux

5/8/2012. Creating and Changing Directories Chapter 7

Basic Unix Command. It is used to see the manual of the various command. It helps in selecting the correct options

Transcription:

Student Remote Login Procedure (see picture below): 1. Start SSH Secure Shell 2. Click the computer icon (4 th on the toolbar) 3. Enter stargate.ncc.edu in the text field labeled Host Name: 4. Enter the 1 st three characters of your last name followed by the last 4 digits of your Banner ID in the text field labeled User Name: 5. Click the Connect button 6. Enter your password (Banner ID example N00456789) when prompted 7. Approve any other responses from the server

UNIX Shell Commands The shell is a UNIX program that interprets the commands entered from the keyboard. Examples: Bourne, Korn, C, Bash, tcsh, zsh Linux default shell is Bash (Bourne again shell) has best of Bourne and Korn shells Note: UNIX is case-sensitive uppercase and lowercase characters are treated differently Commands are entered in lowercase Help can be obtained by typing the command followed by help Example: date --help The man (manual) command gives a more in depth use of the command. Use q to exit man Example: man date The whatis command gives a brief description of the command - whatis date To display the system date: Type date [doej@xoserver ~]$ date Tue Sep 16 21:45:17 EDT 2008 [doej@xoserver ~]$ Try the command: date u (displays the date as Universal Coordinated Time or GMT) To display the calendar: cal (try the command cal 2 2009) To change your password: passwd To display the full path to the current directory: pwd Try some of these commands: set - clear - who or w - whoami -

Directory listing command ls command ls lists the directory contents ls a includes hidden files ls la list [doej@xoserver ~]$ ls CLCfg.cer IMAPmail public_html CLCfg.pem local.cshrc SidiousCLC.cer CLConSidious.cer local.login sidious.clc.matcmp.ncc.edu_clcca.crt CLCuser.cer local.profile [doej@xoserver ~]$ ls -a. CLConSidious.cer.profile.. CLCuser.cer public_html.bash_history IMAPmail.rnd.bash_logout.lesshst SidiousCLC.cer.bash_profile local.cshrc sidious.clc.matcmp.ncc.edu_clcca.crt.bashrc local.login.ssh2 CLCfg.cer local.profile CLCfg.pem.mailboxlist [doej@xoserver ~]$ ls -la total 88 drwxr-xr-x 5 doej faculty 4096 Sep 16 21:52. drwxr-xr-x 109 root root 4096 Sep 4 14:07.. -rw------- 1 doej faculty 2094 Mar 16 2008.bash_history -rw-r--r-- 1 doej faculty 33 Aug 26 19:44.bash_logout -rw-r--r-- 1 doej faculty 176 Aug 26 19:44.bash_profile -rw-r--r-- 1 doej faculty 124 Aug 26 19:44.bashrc -rw------- 1 doej faculty 1462 Aug 28 2006 CLCfg.cer -rw------- 1 doej faculty 2037 Sep 25 2006 CLCfg.pem -rw------- 1 doej faculty 958 Sep 25 2006 CLConSidious.cer -rw------- 1 doej faculty 1512 Aug 28 2006 CLCuser.cer drwx------ 3 doej faculty 4096 Aug 27 10:57 IMAPmail -rw------- 1 doej faculty 35 Sep 16 21:52.lesshst -rw-r--r-- 1 doej faculty 124 Oct 11 2002 local.cshrc -rw-r--r-- 1 doej faculty 607 Oct 11 2002 local.login -rw-r--r-- 1 doej faculty 582 Oct 11 2002 local.profile -rw-r--r-- 1 doej faculty 36 Dec 3 2005.mailboxlist -rw-r--r-- 1 doej faculty 144 Oct 11 2002.profile drwxr-xr-x 2 doej faculty 4096 Sep 16 21:27 public_html -rw------- 1 doej faculty 1024 Sep 25 2006.rnd -rw------- 1 doej faculty 958 Aug 28 2006 SidiousCLC.cer -rw------- 1 doej faculty 958 Aug 2 2005 sidious.clc.matcmp.ncc.edu_clcca.crt drwxr-xr-x 3 doej faculty 4096 Jul 23 2004.ssh2 [doej@xoserver ~]$

The command prompt PS1 environment variable To display the PS1 variable, type set or echo $PS1 Some of the Prompt display options \d date \h hostname \n gives a new line (like enter) \s shell name \t time \u username \w path of the working directory \W name of working directory only \$ displays $ or # if the user is root \[ marks the start of sequence of characters \] marks the end of sequence of characters PS1 value PS1='[\u@\h \W]\$ ' Resulting prompt [doej@xoserver ~]$ To change the prompt, enter PS1=followed by options example PS1= // cat used to create or display contents of a file example: cat > myfile.txt (to create a file) example: cat >> myfile.txt (to append to the end of a file) example: cat myfile.txt (to display the contents of a file) example: cat myfile.txt more (to view the file a page at a time) cp copy a file or multiple files examples: cp myfile.txt myfile2.txt myfile2.txt copy myfile.txt into the same directory with the name cp /etc/hosts. rm remove file or files Examples: rm myfile.txt rm -r directory Remove the file myfile.txt without prompting remove a directory, even if files exist in the directory

Directory Listing And Permissions group permissions D r w X R w x r w x owner permissions others permissions 1 st position d directory or file Owner permissions - read, write, execute (run) Group permissions - permissions for users (members) in this group Others permissions - permissions for other users Note that a dash in the permission means the permission is denied. chmod command changes permissions (see http://en.wikipedia.org/wiki/chmod ) chmod g+rx myfile.txt myfile.txt chmod ugo+x file1.txt chmod o-x file1.txt chmod 744 file1.txt grant the group read and execute permission to the file grant everyone execute permission to file1.txt deny others execute permission to file1.txt grant all permissions to owner, read to group and others

1 st column permissions 2 nd column number of subdirectories in directory, or number of files hard linked to this file 3 rd column owner 4 th column group 5 th column size in bytes 6 th column date & time file was last modified 7 th column filename Special directories in all sub-directories:. (dot) represents the current directory.. (dot dot) represents the parent directory mkdir create a directory example: mkdir mydir cd change directory examples: cd or cd ~ change to home directory cd / change to the root (main) directory cd.. change to the parent directory rmdir remove directory example: rmdir mydir exit or logout exit Linux

[grahamf@newton ~]$ ls -la / total 172 drwxr-xr-x 25 root root 4096 Jan 17 00:46. drwxr-xr-x 25 root root 4096 Jan 17 00:46.. -rw-r--r-- 1 root root 0 Jan 17 00:46.autofsck -rw-r--r-- 1 root root 0 May 22 2008.autorelabel drwxr-xr-x 2 root root 4096 Jan 17 01:58 bin drwxr-xr-x 4 root root 3072 Jan 17 00:46 boot drwxr-xr-x 11 root root 3640 Jan 17 00:46 dev drwxr-xr-x 98 root root 12288 Jan 31 04:03 etc drwxr-xr-x 8 root root 4096 Dec 5 17:48 home drwxr-xr-x 14 root root 4096 Jan 17 01:55 lib drwx------ 2 root root 16384 May 22 2008 lost+found drwxr-xr-x 2 root root 4096 Mar 29 2007 media drwxr-xr-x 2 root root 0 Jan 17 00:46 misc drwxr-xr-x 2 root root 4096 Mar 29 2007 mnt drwxr-xr-x 2 root root 0 Jan 17 00:46 net drwxr-xr-x 6 root root 4096 Sep 26 15:30 opt dr-xr-xr-x 204 root root 0 Jan 17 00:45 proc drwxr-x--- 25 root root 4096 Jan 16 19:59 root drwxr-xr-x 2 root root 12288 Jan 17 01:58 sbin drwxr-xr-x 2 root root 4096 May 22 2008 selinux drwx------ 2 root root 4096 Jul 31 2008.spamassassin drwxr-xr-x 2 root root 4096 Mar 29 2007 srv drwxr-xr-x 11 root root 0 Jan 17 00:45 sys drwxr-xr-x 3 root root 4096 Sep 26 15:10 sysadmin drwxrwxrwt 5 root root 4096 Feb 3 13:42 tmp drwxr-xr-x 16 root root 4096 Jun 2 2008 usr drwxr-xr-x 25 root root 4096 Jul 30 2008 var [grahamf@newton ~]$ Executables Bootstrap loader System Devices Configuration files Users home dir Shared library files File system check files Temp mount points Vendor based apps Virtual file system in memory only, processes root s home dir system admin Hardware info Temp storage space Most OS files & progs Error logs, mail etc [grahamf@newton ~]$ df (Amount of free space remaining on disk) Filesystem 1K-blocks Used Available Use% Mounted on /dev/cciss/c0d0p6 124641916 5902708 112305580 5% / /dev/cciss/c0d0p3 49704148 2153076 44985492 5% /var /dev/cciss/c0d0p2 99188500 2800600 91267988 3% /home /dev/cciss/c0d0p1 101086 27874 67993 30% /boot tmpfs 2009696 0 2009696 0% /dev/shm [grahamf@newton ~]$ mount /dev/cciss/c0d0p6 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/cciss/c0d0p3 on /var type ext3 (rw,usrquota,grpquota) /dev/cciss/c0d0p2 on /home type ext3 (rw,usrquota,grpquota) /dev/cciss/c0d0p1 on /boot type ext3 (rw) tmpfs on /dev/shm type tmpfs (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) [grahamf@newton ~]$ sudo mount t iso9660 /dev/scd0 /media/cdrom0

Files And Directories Enter the cd command to move to the home directory (folder) Make the directory ite213, if it does not exist Create the directories linux, windows, temp and dos within the ite213 directory Copy the contents of Examples folder (if it exists) to the linux folder. Copy the same info into to the temp folder Check both folders to make sure the contents are there Use the cat command to create the file, file1, in the ite213 folder with the following information: John Doe,Computer Science,CMP210 Bart Jones,Information Technology,ITE101 Mary Williams,Mathematics,MAT122 Sue Carson,Computer Science,CMP217 Press Ctrl-d to save and close the file Copy the file, file1, to file2 Rename file2 to students Change the permissions of the students file as follows: chmod ugo+r ~/ite213/students chmod ugo+rwx ~/ ite213/students alias and unalias commands The alias command is used to give a name to a command. The unalias command is used to remove the alias. Use the alias command to name the following Linux commands by their equivalent DOS names. alias dir="ls -l" alias copy="cp" alias rename="mv" alias md="mkdir" alias rd="rmdir" alias del="rm -i" alias deltree="rm -R" Remove the temp folder and its contents with the deltree alias.

The find Command (Find a File with Specific Characteristics) find path test action find /home name students -print Example: Starting from the home directory, find the file named students; display the results. From my home directory, find all files and folders that only I have access to: find ~ -perm 700 -print Find all of the tgz files in my home folder: find ~ -name *.tgz print See the man pages for more examples Filtering Using the grep command (Search Within A Text File) The name of the command - g/re/p (search globally for a regular expression and print lines where found). The basic structure of the command is grep [OPTION] pattern file Example: search the file /etc/passwd for your username - grep username /etc/passwd grep i john ite213/students - i option ignores differences in case grep -l john * grep -lr john /etc grep -lrs john /etc - s option suppresses error messages Example Regular Expressions - l display only the names of the files that have the pattern - r option searches (recursively) all directories in the specified directory MetaCharacter Meaning. Match any single character except newline ^ Match the beginning of a line $ Match the end of a line \< Match the beginning of a word \> Match the end of a word [list] Match any character in the brackets [^list] Match any character not in the brackets ( ) Treat as a single unit Match 1 of the choices \ Interpret character literally grep -csr ^From: IMAPmail with From: search the IMAPmail folder for files with lines beginning What does the command grep i CMP ite213/students do? How about this command? grep 1.$ ite213/students

Downloading Using The FTP Command: [grahamf@newton ~]$ ftp ftp.ncsa.uiuc.edu Connected to ftp.ncsa.uiuc.edu. 220 hemlock.ncsa.uiuc.edu FTP server (Version wu-2.6.2(1) Tue Jan 22 12:31:47 CST 2002) ready. 530 Please login with USER and PASS. KERBEROS_V4 rejected as an authentication type Name (ftp.ncsa.uiuc.edu:grahamf): anonymous 331 Guest login ok, send your complete e-mail address as password. Password: 230-Welcome to NCSA's anonymous FTP server! I hope you find what you are Remote system type is UNIX. Using binary mode to transfer files. ftp> cd Mosaic/Windows/v3.0 250-Please read the file README 250- it was last modified on Thu Feb 27 17:31:42 1997-4758 days ago 250 CWD command successful. ftp> bin 200 Type set to I. ftp> hash Hash mark printing on (1024 bytes/hash mark). ftp> ls 227 Entering Passive Mode (141,142,2,14,198,88) 150 Opening ASCII mode data connection for /bin/ls. total 2939 -rw-rw-r-- 1 12984 10 175 Feb 27 1997 README drwxrwxr-x 2 12984 10 2048 Feb 27 1997 disks -rw-r----- 1 12984 10 3006241 Feb 27 1997 mos30.exe # 226 Transfer complete. ftp> get mos30.exe local: mos30.exe remote: mos30.exe 227 Entering Passive Mode (141,142,2,14,115,166) 150 Opening BINARY mode data connection for mos30.exe (3006241 bytes). ##################################################################################### ##################################################################################### ############################################# 226 Transfer complete. 3006241 bytes received in 1.7 seconds (1.7e+03 Kbytes/s) ftp> quit 221-You have transferred 3006241 bytes in 1 files. 221-Total traffic for this session was 3008440 bytes in 2 transfers. 221-Thank you for using the FTP service on hemlock.ncsa.uiuc.edu. 221 Goodbye. [grahamf@newton ~]$

Downloading Using WGet: wget ftp://ftp.ncsa.uiuc.edu/mosaic/windows/v3.0/mos30.exe (Wget - software package for retrieving files using HTTP, HTTPS and FTP) Example: wget ftp://files1.solarwinds.net/bundle-subnetcalc-toolset.zip If the download fails, you can continue with: wget -c http://server To download several files, create a file with the URLs of files to download, wget will download each file: wget -i filename (filename contains the URLs of files to download) To download an entire directory from a site: Example: wget -r -l0 --no-parent ftp://ftp.mcafee.com/pub/datfiles/english

FTP Download Using A Web Browser: Secure FTP Using SSH Secure File Transfer: