UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.

Slides:



Advertisements
Similar presentations
RH030 Linux Computing Essentials
Advertisements

Jump to first page Unix Commands Monica Stoica Jump to first page Introduction to Unix n Unix was born in 1969 at Bell Laboratories, a research subdivision.
Chapter One The Essence of UNIX.
1 Introduction to UNIX Ke Liu
FILE TRANSFER PROTOCOL Short for File Transfer Protocol, the protocol for exchanging files over the Internet. FTP works in the same way as HTTP for transferring.
Working with Files How to create, view, copy, rename and print files.
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Jan. 27 th, 2009 Essential Unix Commands.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
UNIX Chapter 09 Basic File Processing Mr. Mohammad Smirat.
Internet Applications: Telnet, Ping and Traceroute.
Linux+ Guide to Linux Certification, Second Edition
The Internet. Telnet Telnet means using your computer as a terminal. All commands you type are sent to the host computer you are connected to and executed.
Guide To UNIX Using Linux Third Edition
1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Overview of Linux CS3530 Spring 2014 Dr. José M. Garrido Department of Computer Science.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
CHAPTER 1 UNIX FOR NONPROGRAMMERS By U ğ ur Halıcı.
Working with Files Chapter 5. Display a Calendar Display a calendar for a specific month – cal Display a calendar for a specific year – cal 2000.
Introduction to Unix/Linux Chapter One The Essence of UNIX.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
Unix Basics Chapter 4.
Agenda Chapter 1: Linux (Unix) Features Commands (Chapters 2 & 3) Command Structure / Command line editing man, passwd, cal, date, whereis, which Working.
Linux+ Guide to Linux Certification, Second Edition
Jozef Goetz, expanded by Jozef Goetz, 2009 Credits: Parts of the slides are based on slides created by UNIX textbook authors, Syed M. Sarwar, Robert.
UNIX/LINUX Shells Shell is an UNIX/LINUX command interpreter. Shell command can be internal or external. The code to execute an internal command is part.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #4  Unix software architecture  Correcting mistakes  System setups  Useful commands for the beginner.
Introduction to Unix (CA263) Getting Started By Tariq Ibn Aziz.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Operating Systems.
Chapter 0 A “Quick-Start” into the UNIX Operating System.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX Commands cal – will print a calendar.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Introduction to UNIX Geraint Vaughan. What is UNIX? Command-line operating system (not point- and click) Designed for ‘experts’ Lots of different variants.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Introduction to Programming Using C An Introduction to Operating Systems.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
1 © 2001 John Urrutia. All rights reserved. Chapter 2 Getting Started.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
UNIX Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
A “Quick-Start” into the UNIX Operating System
Tutorial of Unix Command & shell scriptS 5027
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Andy Wang Object Oriented Programming in C++ COP 3330
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands:
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Web Programming Essentials:
Tutorial of Unix Command & shell scriptS 5027
Andy Wang Object Oriented Programming in C++ COP 3330
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Tutorial Unix Command & Makefile CIS 5027
Lab 2: Terminal Basics.
Presentation transcript:

UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat

Logging On and Logging Off Unix is a multitasks, multiusers, and interactive operating system. Unix allow people to share the same computer by logging on to it from terminals or consoles. Three general categories to connect to a UNIX system Local Area Network connection. Internet connection. Stand Alone connection.

Before trying to log in to any UNIX system in any way, you need to identify yourself as a valid user to the system. You can identify yourself to a UNIX system by typing in a valid username (log-in name) and a valid password for that username. In this chapter we will discuss 2 ways to login to a UNIX system using computers running windows system. In this course we will use the University Main Frame computer which runs a UNIX system (ip : , hostname : orchid.just.edu.jo) Logging On and Logging Off (cont … )

Connecting via PuTTY To connect to a UNIX system using this way you have to have the following A computer running a Windows operating system You computer is connected to a LAN or to the Internet You have downloaded and installed the PuTTY program. See the site You know the host name or the IP address of the UNIX computer you want to connect to. You have a username and a password that will allow you to login to the UNIX computer.

Connecting via PuTTY (cont … ) Run the PuTTY program. you will see the following window  Type the hostname or the ip address of the UNIX computer.  Change the protocal to Telnet.  Press the open button.

Connecting via PuTTY (cont … ) You will se the following window Enter your username. Enter your password. While entering the password you will not see the characters of your password on the screen for security reasons. You can then start running commands.

Connecting via Telnet To connect to a UNIX system using this way you have to have the following A computer running a Windows operating system You computer is connected to a LAN or to the Internet You know the host name or the IP address of the UNIX computer you want to connect to. You have a username and a password that will allow you to login to the UNIX computer.

Connecting via Telnet (cont … ) From start menu click RUN, you will see the following.  Type telnet and then the hostname or the ip address of the UNIX computer.  Press the Ok button.

Connecting via Telnet (cont … ) You will se the following window Enter your username. Enter your password. While entering your password you will not see the characters of the password on the screen for security reasons. You can then start running commands.

Loging-out You can disconnect yourself from the unix using one of the following commands exit

The Structure of a UNIX Command $ command [[-]option(s)] [option argument(s)] [command argument(s)] $ is the shell prompt. Command is the name of the UNIX command [-option(s)] is one or more modifiers that change the behavior of the command. [option argument(s)] is one or more modifiers that change the behavior of the [-option(s)]. [command argument(s)] is one or more objects that are affected by the command.

The Structure of a UNIX Command (cont … ) You must use space to separates commands, options, option arguments, and command arguments, but no space is necessary between multiple options or multiple option arguments. The order of multiple options is irrelevant. A space character is optional between the option and the option argument. Always press the key to submit the command for interpretation and execution.

Command Examples ls ls –la ls –la m* lpr –Pspr –n 3 proposal.ps

File and Directory Structure When you first login, you are working in the home directory. Home directory is a folder that is associated with the username and password you used to login. The directory you are presently in is known as the current working directory. There is only one current working directory active at any given time.

Changing User Password passwd is the UNIX command for changing the user password. $ passwd Changing password for cis1. Old password: New password: Retype new password: Hashed database not in use, only /etc/passwd text file updated. $

Viewing the Contents of Files using cat You can display the complete contents of one or more files on screen by using the cat command. cat[options][file-list] Concatenate/display the files in file-list on standard output. Options are: -e display $ at the end of each line -n put line numbers with the displayed lines.

CAT Examples $cat student_records [ contents of file displayed] cat exam1 exam2 [ contents of exam1 and exam2] When cat command is executed without arguments, it takes input from the keyboard. $cat This is a test. This is a test.

Creating Files Using cat cat > myfile The previous command will create a file on the current working directory named as myfile allowing you to input any text you wont. To finish the input, use the.

Viewing Files One Page at a time more[option][file list] To concatenate/display the files in file-list on standard output one screen at a time. Options: +/str start at the first line containing str. -nN display N lines per screen/page +N start displaying the contents of the file at line number N.

MORE Examples $ more sample [ contents of sample one page at a time] $ more sample letter memo [ contents of sample, letter, and memo] $ more -n20 sample [ contents of sample 20 lines per page] $more +/include test.c [ contents of test.c file in the current directory starting from the first line containing the string include]

Copying Files The UNIX command for copying files is cp. cp[options] file1 file2 will copy file1 to file2 if file2 is a directory, make a copy of file1 in this directory. Options -i if destination exist, prompt before overwriting. -r recursively copy files and subdirectories.

Moving Files The operation move in UNIX may result in simply renaming a file if it is on the same directory. If the source and destination are on different directory, the move operation results in a physical copy of the source file to the destination, followed by removal of the source file. mv [options] file1 file2 mv [options] file-list directory The first will move file1 to file2 or rename file1 as file2. The second will move all files in file_list to directory. Options -i prompt the user before overwriting the destination.

Removing/deleting Files The UNIX command for removing (deleting) files is rm. rm[options] file list To remove files in file list from the file structure. Options -i prompt the user before removing the files in file_list. -r recursively remove the files in the directory which is passed as an argument. You want to be sure that you want to do so before using this option.

The ls command ls[option][pathname-list] to send the names of the files in the directories and files specified in pathname list to the display screen. Options are the following -F display `/` after directories, * after binaries, after symbolic. -a display name of all the files including the hidden files. -i display inode number. -l display long list that includes access permissions, link count, owner, group, file size.

Creating Directories To create a directory use the command mkdir[options] dirnames options -m modes, create a directory with the given access permission ( permissions in chapter 8) -p create parent directories that do not exist in the pathnames specified in dirname.

Removing Directories To remove an empty directory us the command Rmdir[options] dirname Option -p to remove empty parent directory as well.

Accessing Directories You can access a directory using the command cd directoryName To return to the parent of the active directory use the command cd.. To return to the home directory use the command cd To display the full name of the current working directory ( active directory) use the command pwd

Getting Help With Commands To get a detailed help about one or more of the UNIX commands and their options, go to the UNIX reference manual pages. The syntax of the command is as the following $ man cmdName [cmdName] … $ man -k keyword [keyword] … To get short description of what any particular UNIX command does you can use the command whatis as the following: $ whatis cmdName [cmdName] …

Searching You can search for a file using the command whereis [options] filename Optoins -b Search only for binaries -s Search only for source code

Viewing personal information whoami, tells you who is currently logged on to a terminal. $ whoami cis1 $ To see more details about the user who is currently log in to a terminal, type the command who am i as follows $ who am i cis1 pts/4 Mar 3 08:40 ( ) $

Viewing hostname hostname command displays the name of the host computer you have logged into. $hostname orchid.just.edu.jo $

Current log-in users The who command, will tell you who are log-in right now. $ who jlp tty0 sep 20 10:05 you tty2 sep 22 10:34

Printing Files Two command to print files in UNIX systems. On System V UNIX the command lp is used to print a file and lpr command is used on System BSD UNIX. With the lpr command, you need the option –P to specify the printer name to print on and –n option to determine the number of copies to be printed. lpr -P spr sample lpr -P spr –n 3 sample With the lp command, the option –d is used to specify the printer name to print on and –n option to determine the number of copies to be printed. lp -d spr sample lp -d spr –n 3 sample

Calendar and Date The command cal is used to display the calendar of a specified month in a specified year. cal [month][year] The date command will display current date and time as follows. $date sun sep 20 11:23:01 EET 2001

Communication commands Write command is used to write on a user terminal or terminals. The command can take two parameters, the first is the user name that you want to write on his terminals. The second is the terminal name you want to write on – it is optional. You can use the mesg command to disaple the appearance of the real-time one way message on your terminal. mesg y, permits others to use write or talk commands with you. mesg n, prevents others to use write or talk commands with you. mesg displays the current status of the mesg.

Creating Aliases alias command is used to create a nickname for a command as follows. alias [name] [string] The name parameter states the new name (alias) of a command. The string parameter states the command you want to create an alias for it. The alias command without any parameters will list all the aliases in your system. To cancel an alias use the command unalias with the alias name. To cancel all the aliases use the command unalias with the option -a.