UNIX 1: Introduction to UNIX

Total Page:16

File Type:pdf, Size:1020Kb

UNIX 1: Introduction to UNIX UNIX 1: Introduction to UNIX Workbook Edition 5 October 2001 UNIX 1: Introduction to UNIX Edition 5,October 2001 EUCS Document Number: F.5.WB-3184-10/2001 Copyright © EUCS 2001 Permission is granted to any individual or institution to use, copy or redistribute this document whole or in part, so long as it is not sold for profit and provided that the above copyright notice and this permission notice appear in all copies. Where any part of this document is included in another document, due acknowledgement is required. Chapter 1: Using Unix . 7 What is Unix? . 9 Unix is widely used . 10 Shell : Unix’s user interface . 11 Unix and window systems . 12 Multi-user system . 13 Logging in . 14 Choosing a password . 16 Logging out! . 18 Computer files . 20 File names . 21 Manipulating files . 22 Unix commands . 24 Unix is flexible . 26 ls (list files) . 27 Filenames and directories . 28 more . 30 Modifying more . 31 Modifying more (contd.) . 32 cat . 34 Copying files - ‘cp’ and ‘mv’ . 36 Deleting files - ‘rm’ . 38 Editing: ue (microemacs) . 40 microemacs (contd.) . 41 microemacs (contd.) . 42 Printing file contents . 44 lpr (contd.) . 45 Has the file printed yet? . 46 Postscript files . 48 enscript . 50 Getting help! . 52 Chapter 2: The Unix filesystem . 55 Directory Structure . 57 Finding your location: pwd . 58 Relative pathnames . 60 Making new directories . 62 Commands and pathnames . 64 Other people’s filespace! . 66 Groups . 68 File permissions! . 70 Directory permissions . 72 Changing permissions . 74 Copying files . 76 Removing directories . 78 Backup facilities . 80 Computer disks . 81 Investigating your quota . 82 Saving space . 84 Disk usage . 86 Chapter 3: Unix Facilities. 89 Saving time using the shell . 91 Filename completion. 92 History mechanism . 94 Edit a command line . 96 Wildcards . 98 Question mark ? . 100 Redirecting information . 102 Pipes . 104 grep . ..
Recommended publications
  • The Oldest Rivalry in Computing Forget Apple Vs
    Follow us on Twitter for more great Slate stories! Follow @slate BITWISE DECODING THE TECH WORLD. MAY 9 2014 9:57 AM The Oldest Rivalry in Computing Forget Apple vs. Google. Emacs and Vi have been battling for text-editor supremacy among programmers for 40 years. By David Auerbach An early Emacs manual cover from 1981. Courtesy of GNU Emacs n a world where both software and hardware frequently become obsolete right I on release, two rival programs can stake a claim to being among the longest-lived applications of all time. Both programs are about to enter their fifth decades. Both programs are text editors, for inputting and editing code, data files, raw HTML Web pages, and anything else. And they are mortal enemies. Their names are Emacs and Vi (styled by programmers as “vi”). These editors are legendary and ancient, no exaggeration. Both date back to at least 1976, making them older than the vast majority of people currently using them. Both programs are text editors, which means they are not WYSIWYG (what you see is what you get)—unlike, say, word processors like Microsoft Word, they do not format your words onscreen. Programming is very different from word processing, and the basic goal of Emacs and Vi—fast editing of source code (and any other text files)—has yet to become obsolete. Both have been in ongoing development for almost 40 years. These two wizened programs are as close to equally matched enemies as any two programs have ever been. If you know a programmer who uses one of them, there’s a good chance that she hates the other.
    [Show full text]
  • Learning the Vi Editor
    Learning the vi Editor en.wikibooks.org December 29, 2013 On the 28th of April 2012 the contents of the English as well as German Wikibooks and Wikipedia projects were licensed under Creative Commons Attribution-ShareAlike 3.0 Unported license. A URI to this license is given in the list of figures on page 103. If this document is a derived work from the contents of one of these projects and the content was still licensed by the project under this license at the time of derivation this document has to be licensed under the same, a similar or a compatible license, as stated in section 4b of the license. The list of contributors is included in chapter Contributors on page 101. The licenses GPL, LGPL and GFDL are included in chapter Licenses on page 107, since this book and/or parts of it may or may not be licensed under one or more of these licenses, and thus require inclusion of these licenses. The licenses of the figures are given in the list of figures on page 103. This PDF was generated by the LATEX typesetting software. The LATEX source code is included as an attachment (source.7z.txt) in this PDF file. To extract the source from the PDF file, you can use the pdfdetach tool including in the poppler suite, or the http://www. pdflabs.com/tools/pdftk-the-pdf-toolkit/ utility. Some PDF viewers may also let you save the attachment to a file. After extracting it from the PDF file you have to rename it to source.7z.
    [Show full text]
  • Matrix Graph Grammars
    MATRIX GRAPH GRAMMARS by Pedro Pablo P´erez Velasco Version 1.2 arXiv:0801.1245v2 [cs.DM] 17 Nov 2009 c Copyright by Pedro Pablo P´erez Velasco 2007, 2008, 2009 To my family VII ACKNOWLEDGEMENTS These lines are particularly pleasant to write. After all those years, I have a quite long list of people that have contributed to this book in one way or another. Unfortunately, I will not be able to include them all. Apologizes for the absences. First of all my family. Gema, with neverending patience and love, always supports me in every single project that I undertake. My unbounded love and gratitude. Hard to return, though I’ll try. My two daughters, Sof´ıaand Diana, make every single moment worthy. I’m absolutely grateful for their existence. My brothers Alex´ and Nina, now living in Switzerland, with whom I shared so many moments and that I miss so much. My parents, always supporting also with patience and love, worried if this boy would become a man (am I?). Juan, my thesis supervisor, whose advice and interest is invaluable. He has been actively involved in this project despite his many responsibilities. Also, I would like to thank the people at the series of seminars on complexity theory at U.A.M., headed by Roberto Moriy´on, for their interest on Matrix Graph Grammars. Many friends have stoically stood some chats on this topic affecting interest. Thank you very much for your friendship. KikeSim, GinHz, Alvaro´ Iglesias, Jaime Guerrero, ... All those who have passed by are not forgotten: People at ELCO (David, Fabrizio, Juanjo, Juli´an, Lola, ...), at EADS/SIC (Javier, Sergio, Roberto, ...), at Isban, at Banco Santander.
    [Show full text]
  • Linux Information Sheet Linux Information Sheet
    Linux Information Sheet Linux Information Sheet Table of Contents Linux Information Sheet....................................................................................................................................1 Michael K. Johnson <[email protected]>.......................................................................................1 1.Introduction to Linux............................................................................................................................1 2.Linux Features......................................................................................................................................1 3.Hardware Issues....................................................................................................................................1 4.An Incomplete List of Ported Programs and Other Software...............................................................1 5.Who uses Linux?...................................................................................................................................1 6.Getting Linux........................................................................................................................................1 7.Legal Status of Linux............................................................................................................................2 8.News About Linux................................................................................................................................2 9.The Future.............................................................................................................................................2
    [Show full text]
  • Editor War - Wikipedia, the Free Encyclopedia Editor War from Wikipedia, the Free Encyclopedia
    11/20/13 Editor war - Wikipedia, the free encyclopedia Editor war From Wikipedia, the free encyclopedia Editor war is the common name for the rivalry between users of the vi and Emacs text editors. The rivalry has become a lasting part of hacker culture and the free software community. Many flame wars have been fought between groups insisting that their editor of choice is the paragon of editing perfection, and insulting the others. Unlike the related battles over operating systems, programming languages, and even source code indent style, choice of editor usually only affects oneself. Contents 1 Differences between vi and Emacs 1.1 Benefits of vi-like editors 1.2 Benefits of Emacs 2 Humor 3 Current state of the editor war 4 See also 5 Notes 6 References 7 External links Differences between vi and Emacs The most important differences between vi and Emacs are presented in the following table: en.wikipedia.org/wiki/Editor_war 1/6 11/20/13 Editor war - Wikipedia, the free encyclopedia vi Emacs Emacs commands are key combinations for which modifier keys vi editing retains each permutation of typed keys. are held down while other keys are Keystroke This creates a path in the decision tree which pressed; a command gets executed execution unambiguously identifies any command. once completely typed. This still forms a decision tree of commands, but not one of individual keystrokes. Historically, vi is a smaller and faster program, but Emacs takes longer to start up (even with less capacity for customization. The vim compared to vim) and requires more version of vi has evolved to provide significantly memory.
    [Show full text]
  • Szövegszerkesztés
    Szövegszerkesztés Wettl Ferenc 2006. október 1. Wettl Ferenc () Szövegszerkesztés 2006. október 1. 1 / 5 Tartalom 1 Szövegszerkesztők Típusai Mit kell tudnia? Wettl Ferenc () Szövegszerkesztés 2006. október 1. 2 / 5 pl.: vi (vim, cream), emacs (XEmacs, MicroEmacs), joe, pico, Notepad (Microsoft Windows default), SimpleText (Classic Mac OS default), TextEdit (Mac OS X default), gedit (Gnome), kate és kile (KDE), ld. még a wikipediában IDE (integrated development environment, integrated design environment, integrated debugging environment), dokumentumszerkesztő (word processor, document preparation system) pl.: AbiWord, KWord, OpenOffice.org Writer, Ted, a határon: GNU TeXmacs, LyX, üzleti: MS Word, online: Writely, . (Allin Cottrell: Word Processors: Stupid and Inefficient) szedő rendszer (electronic typesetting system) pl.: troff, Groff, TEX/LATEX. (WYSIWYG, WYSIWYM). DTP (Desktop publishing) pl.: QuarkXPress, Adobe InDesign, Scribus (szabad), Microsoft Publisher, Apple Pages. Szövegszerkesztés Szövegszerkesztők típusai szövegszerkesztő (text editor) – programkód, egyszerű szöveg, vagy ember által is olvashatóan kódolt (human-readable) dokumentum (pl. wiki) írására, Wettl Ferenc () Szövegszerkesztés 2006. október 1. 3 / 5 IDE (integrated development environment, integrated design environment, integrated debugging environment), dokumentumszerkesztő (word processor, document preparation system) pl.: AbiWord, KWord, OpenOffice.org Writer, Ted, a határon: GNU TeXmacs, LyX, üzleti: MS Word, online: Writely, . (Allin Cottrell: Word Processors: Stupid
    [Show full text]
  • A Distributed Toolkit for Supporting Multiple Group Editors
    DistEdit: A Distributed Toolkit for Supporting Multiple Group Editors Michael J. Knister and Atul Prakash Software Systems Research Laboratory Department of EECS U. of Michigan, Ann Arbor, MI 48109 ABSTRACT The purpose of our project is to provide toolkits for building applications that support collaboration between people in distributed environments. In this paper, we describe one such toolkit, called DistEdit, that can be used to build interactive group editors for distributed environments. This toolkit has the ability to support different editors simultaneously and provides a high degree of fault-tolerance against machine crashes. To evaluate the toolkit, we modified two editors to make use of the toolkit. The resulting editors allow users to take turns at making changes while other users observe the changes as they occur. We give an evaluation of the toolkit based on the development and use of these editors. Keywords: groupware, collaboration technology, group editors, distributed systems. INTRODUCTION Computers are now commonplace in work environments and are influencing the way people interact. Examples of computer-supported interaction mechanisms include electronic mail, newsgroups, and distributed file systems. These have opened up new ways to interact, but all support only non-interactive styles of communication. There are also “talk” programs that are more interactive but are generally restricted to two users and allow only very simple forms of interaction, such as the exchange of messages in different windows, In recent years, there has been a growing interest in providing collaboration tools to support more closely coupled interactions among a group of people [Abde88, Halo89, Elwa89, Stef87]. Our focus in this paper is on one type of collaboration tools, group editors, that allow several people to jointly edit a shared document in a distributed environment.
    [Show full text]
  • Micro Emacs Screen Editor Manual
    MicroEMACS Screen Editor Tutorial July 11, 1985 Copyright (C) 1985 Mark Williams Company 1430 West Wrightwood Avenue Chicago, Illinois 60614 Telephone: (312) 472-6659 This document conveys information that is the property of Mark Williams Company. It shall not be copied, reproduced or duplicated in whole or in part without the express written per- mission of Mark Williams Company. MWC68 is a trademark of Mark Williams Company. Mark Williams Company makes no warranty of any kind with respect to this material and disclaims any implied warranties of merchan- tability or fitness for any particular purpose. The information contained herein is subject to change without notice. Printed in U.S.A. MicroEMACS Screen Editor Tutorial Page i Table of Contents 1. Introduction 1 What is MicroEMACS? 1 Do the exercises 1 2. Basic Editing 2 Keystrokes--<esc>, <ctrl> 2 Becoming acquainted with MicroEMACS 3 Before you begin 4 Beginning a document 5 3. Moving the Cursor 7 Moving the cursor backwards 7 Moving the cursor forwards 8 From line to line 8 Moving up and down by a screenful of text 8 Moving to beginning or end of text 9 Cursor movement strategy 9 Saving text and quitting 10 4. Killing and Deleting 12 Deleting versus killing 12 Erasing text to the right 12 Erasing text to the left 13 Erasing lines of text 14 Yanking back (restoring) text 14 Killing and deleting--exercises 14 Quitting 15 5. Block Killing and Moving Text 16 Moving one line of text 16 Multiple copying of killed text 16 Kill and move a block of text 17 6.
    [Show full text]
  • Guide to Unix/ Commands 1
    Guide_on_Unix [email protected] PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Wed, 11 Nov 2009 14:39:13 UTC Contents Articles Guide to Unix/ Commands 1 Guide to Unix/ Commands/ Summary 2 Guide to Unix/ Commands/ Getting Help 9 Guide to Unix/ Commands/ File System Utilities 11 Guide to Unix/ Commands/ Finding Files 23 Guide to Unix/ Commands/ File Viewing 25 Guide to Unix/ Commands/ File Editing 29 Guide to Unix/ Commands/ File Compression 30 Guide to Unix/ Commands/ File Analysing 34 Guide to Unix/ Commands/ Multiuser Commands 35 Guide to Unix/ Commands/ Self Information 37 Guide to Unix/ Commands/ System Information 38 Guide to Unix/ Commands/ Networking 42 Guide to Unix/ Commands/ Process Management 47 Guide to Unix/ Commands/ Devices 49 Guide to Unix/ Commands/ Kernel Commands 50 Guide to Unix/ Commands/ compress Commands 51 Guide to Unix/ Commands/ Miscellaneous 51 Guide to Unix/ Environment Variables 55 Guide to Unix/ Files 58 Guide to Unix/ BSD/ Introduction 65 Guide to Unix/ BSD/ OpenBSD 67 Guide to Unix/ Explanations/ Shell Prompt 69 Guide to Unix/ Explanations/ Quoting and Filename Expansion 73 Guide to Unix/ Explanations/ Pipes and Job Control 76 Guide to Unix/ Explanations/ Signals 77 Bourne Shell Scripting/ Quick Reference 80 Guide to Unix/ Explanations/ Introduction to Editors 85 Learning the vi editor/ vi Reference 88 Guide to Unix/ GNU Free Documentation License 98 References Article Sources and Contributors 104 Article Licenses License 105 Guide to Unix/Commands 1 Guide to Unix/ Commands The Unix command line is often considered difficult to learn.
    [Show full text]
  • Risa/Asir ドリル, 2006
    Risa/Asir ドリル, 2006 高山信毅, 野呂正行 2006 年 (平成 18 年), 12 月 2 日 版: コメントは [email protected] または [email protected] まで 2 はじめに Risa/Asir ドリルは, 著者 (T) が徳島大学総合科学部および神戸大学理学部で数学系の学生におこ なってきた計算機プログラミングの入門講義および演習をたたきだいにして書いた本である. この講 義ではさまざまな言語 C, Pascal, 8086 の機械語, Ubasic, sm1, Mathematica 等を用いて実習してき たが, 利用するプログラム言語は異なっても基本的内容は同じであった. ちなみに本書の原稿のおお もとは, 1991 年に著者 (T) が学生に配布した, Mathematica の入門テキストである. 2000 年の秋に著者 (N) が富士通研究所より神戸大学へ転職してきたのを機会に, 著者 (T) はこの 年の計算機プログラミングの入門講義および演習を富士通研究所で著者 (N) が開発にたづさわって きた数式処理システム Risa/Asir を用いておこなうことにした. Risa/Asir は研究用システムとして すぐれた点を多くもつシステムであったが, 教育用途に利用するにはいろいろと不満な点もあった. 著者 (N) は, 著者 (T) およびいろいろと珍奇なことをやってくれる学生にのせられて Risa/Asir を 教育用途にも使えるよういろいろと改造した. 実習室用に CDROM をいれるだけで Windows 2000 で起動できる Asir, 初心者にやさしい入力エラーの取扱い, ファイル IO, 2 次元簡易グラフィックス, さらには教育用途のために, メモリを直接読み書きする peek, poke まで付けた (ちなみにこれはセ キュリティホールになるので普通は利用できない). この Risa/Asir をつかった実習は著者 (T) がお こなった他のいろいろな言語による実習のなかでも成功の部類にはいるものであり, 本として出版し てみようという気になったのである. さて前にもいったようにこの講義および演習は数学科の学生向けであった. 講義の目的は以下のと おりである (目標はそもそもなかなか達成できないものであるが...). 1. 高校数学 A, B, C の計算機に関する部分を教えられるような最低限の知識と技術を身につける. 2. 数学科の学生は卒業後, 計算機ソフトウエア関連の職業につくことが多いが, その基礎となるよ うな計算機科学の全体的な基礎知識を得る. 3. 計算数学が現代の科学技術のなかでどのように利用されているかおぼろげに理解してもらう. また計算数学が数学のなかの一つの研究分野であることを理解してもらい, とくに計算代数へ の入門を目指す. 4. 数学を活用する仕事 (含む数学者) についた場合に, 数式処理システム等を自由に使えるように する. この本では講義の内容に加えてさらに数学的アルゴリズムに関する特論的な内容や, Asir のライ ブラリプログラムを書くための方法, Asir に C のプログラムを組み込むための方法, 計算数学のシ ステムをたがいに接続する実験プロジェクトである, OpenXM を利用した分散計算法など, オープン ソースソフトとしてリスタートした, Risa/Asir のための情報も加筆した. この本が Risa/Asir の利 用者, 開発参加者にも役立つことを願っている. なお, この本は数学科の学生向けの講義をもとに書かれたが,
    [Show full text]
  • Reftex User Manual Support for Latex Labels, References, Citations and Index Entries with GNU Emacs Version 4.34 from 2009-08-09
    RefTEX User Manual Support for LaTEX labels, references, citations and index entries with GNU Emacs Version 4.34 from 2009-08-09 by Carsten Dominik This manual documents RefTEX (version 4.34 from 2009-08-09), a package to do labels, references, citations and indices for LaTeX documents with Emacs. Copyright c 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover texts being \A GNU Manual", and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled \GNU Free Documentation License" in the Emacs manual. (a) The FSF's Back-Cover Text is: \You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development." This document is part of a collection distributed under the GNU Free Docu- mentation License. If you want to distribute this document separately from the collection, you can do so by adding a copy of the license to the document, as described in section 6 of the license. Chapter 1: Introduction 1 1 Introduction RefTEX is a specialized package for support of labels, references, citations, and the index in LaTEX. RefTEX wraps itself round four LaTEX macros: \label, \ref, \cite, and \index. Using these macros usually requires looking up different parts of the document and searching through BibTEX database files.
    [Show full text]
  • M Icro EMACS Full Screen Text Editor Reference Manual
    M i c r o E M A C S Full Screen Text Editor Reference Manual ± Release Version Version 4.0 March 20, 1996 (C)Copyright 1988 ± 1996 by Daniel M. Lawrence Reference Manual (C)opyright 1988 ± 1996 by Brian Straight and Daniel M. Lawrence All Rights Reserved (C)Copyright 1988 ± 1996 by Daniel M. Lawrence MicroEMACS 4.0 can be copied and distributed freely for any non-commercial purposes. Commercial users may use MicroEMACS 4.0 inhouse. Shareware distributors may redistribute MicroEMACS 4.0 for media costs only. MicroEMACS 4.0 can only be incorporated into commercial software or resold with the permission of the current author. I n t r o d u c t i o n MicroEMACS is a tool for creating and changing documents, programs, and other text ®les. It is both relatively easy for the novice to use, but also very powerful in the hands of an expert. MicroEMACS can be extensively customized for the needs of the individual user. MicroEMACS allows several ®les to be edited at the same time. The screen can be split into different windows and screens, and text may be moved freely from one window on any screen to the next. Depending on the type of ®le being edited, MicroEMACS can change how it behaves to make editing simple. Editing standard text ®les, program ®les and word processing documents are all possible at the same time. There are extensive capabilities to make word processing and editing easier. These include commands for string searching and replacing, paragraph reformatting and deleting, automatic word wrapping, word move and deletes, easy case controlling, and automatic word counts.
    [Show full text]