Shell Language Processing: Unix Command Parsing for Machine Learning

Total Page:16

File Type:pdf, Size:1020Kb

Shell Language Processing: Unix Command Parsing for Machine Learning Shell Language Processing: Unix command parsing for Machine Learning Dmitrijs Trizna Department of Computer Science University of Helsinki [email protected] Abstract Complexity and malleability are key challenges in pre- processing shell commands. The structure has many In this article, we present a Shell Language intricate details, like aliases, different prefixes, and or- Preprocessing (SLP) library, which imple- der and values of the text, which make commands con- ments tokenization and encoding directed on densed and fast to input, but time-consuming when parsing of Unix and Linux shell commands. reading and interpreting them. We describe the rationale behind the need for In this paper, we present a Shell Language Process- a new approach with specific examples when ing (SLP)1 library, showing how it performs feature conventional Natural Language Processing extraction from raw shell commands and successfully (NLP) pipelines fail. Furthermore, we eval- use it as input for different machine learning models. uate our methodology on a security classifi- The shell command-specific syntax and challenges are cation task against widely accepted informa- discussed in Chapter 2, inner working, and features of tion and communications technology (ICT) our pipeline are covered in Chapter 3. Chapters 4 and tokenization techniques and achieve signifi- 5 discuss a specific application case and provides per- cant improvement of an F1-score from 0.392 formance evaluation of different encoding techniques. to 0.874. 2 Shell specific challenges 1 Introduction The syntax of shell commands depends on different One of the most common interfaces that system en- Linux binary implementations and the way they han- gineers and administrators use to manage computers dle input parameters. Standard techniques like the is the command line. Numerous interpreters called tokenize method from the nltk package would result shells allow applying the same operational logic across in wrong tokens since shell language heavily deviates various sets of operating systems. Bourne Shell (ab- from natural language. To start with, spaces do not breviated sh), Debian Almquist shell (dash), Z shell arXiv:2107.02438v1 [cs.LG] 6 Jul 2021 always separate different parts of the command. Some (zsh), and Bourne Again Shell (bash) are ubiquitous commands like sed take a raw regular expression as interfaces to operate Unix systems, known for speed, a parameter, space (and any other special character) efficiency, ability to automate and integrate the diver- will not necessarily mean the start of a next token: sity of tasks. sed 's/^chr//;s/\..* / /' filename Contemporary enterprises rely on auditd telemetry from Unix servers, including execve syscall data de- On the contrary, java takes flags without spaces at scribing executed shell commands. Generally, this all, knowing where its parameter name ends: data is analyzed using static, manually defined sig- natures for needs like intrusion detection. There is java -Xms256m -Xmx2048m -jar remoting.jar sparse evidence of the ability to use this information source efficiently by modern data analysis techniques, Such malleability in syntactic patterns possess a signif- like machine learning or statistical inference. Leading icant challenge for the successful parsing of shell com- ICT companies underline the relevance of the afore- mand lines. We know two libraries that attempt to ad- mentioned problem and perform internal research to address this issue [5]. 1https://github.com/dtrizna/slp Shell Language Processing dress such specifics for bash - bashlex 2 and bashlint 3, models in libraries like scikit-learn [1] or even AutoML however none of them does its job perfectly. We utilize realizations like TPOT [3]. As a result, every adminis- bashlex for our needs as a primary parsing source since trator, security analyst, or even non-technical manager it provides heuristics for tokenization of the most gen- working with a Unix-like system may parse shell data eral patterns of shell commands. Still, there are mul- for ML-based analytics using our library. Only ba- tiple problems in the bashlex library's original syntax sic Python coding skills and no knowledge of conven- analysis process, for example in the "command within tional Natural Language Processing (NLP) pipelines a command" case (known by shell syntax $(cmd) or are needed. `cmd` ) like in: export IP=$(dig +short example.com) 4 Experimental setup Such syntax is not handled by bashlex, where an em- Assessment of tokenization and encoding quality is bedded command is treated as a single element. There- done on the security classification problem, where we fore we implement additional syntactic logic wrapped train an ML model to distinguish malicious command around bashlex's object classes to handle this and samples from benign activity. Legitimate commands other problematic cases. consist from nl2bash dataset [4], which represents a shell commands collected from question-answering fo- 3 Encoding rums like stackoverflow.com or administratively fo- cused cheat-sheets. Subsequently, we decided to look forward to different We perform the collection of malicious samples by our- ways of representing data numerically. To produce ar- selves, accumulating harmful examples across penetra- rays out of textual data we implement (a) label, (b) tion testing and hacking resources that describe how one-hot, and (c) term frequency-inverse document fre- to perform enumeration of Linux targets and acquire quency (TF-IDF) encodings. Label encoding is built reverse shell connections from Unix hosts4. All com- on top of the scikit-learn [1], whereas the one-hot and mands within the dataset are normalized. Domain TF-IDF encodings are implemented natively. names are replaced by example.com and all IP ad- dresses with 1.1.1.1, since in our evaluation we want Having the tokenization and encoding now as oper- to focus on the command interpretability. We advice ational functionalities, we were ready to provide a to perform a similar normalization even in production user-friendly interface to utilize the underlying code. applications, otherwise ML model will overfit training Therefore, we created dedicated Python classes that data. formed the core of our interface library. The tok- enization interface is available via ShellTokenizer() For classification, we train a gradient boosting ensem- class. Besides bashlex, we utilized a Counter object ble of decision trees, with the specific realization from from the collections package to store unique tokens and XGBoost library [2]. During the analysis of tokeniza- their appearance count. The Counter allows working tion we do not implement a validation, ergo use full conveniently with the data concerning various visual- dataset for training and compute metrics on the same izations. Further encoding is available by ShellEn- data. Conversely, during the evaluation of encoding coder(), which class allows to generate different en- techniques, we implement a 10 fold cross-validation, coding methods and returns a scipy sparse array. Sub- so the resulting metrics are the mean across all valida- stantially, all preprocessing pipeline can be achieved tion passes. within four lines of code: st = ShellTokenizer() 5 Evaluation corpus, counter = st.tokenize(shell_commands) First experiments were conducted to assess the qual- se = ShellEncoder(corpus=corpus, ity of our tokenization. We have tokenized afore- token_counter=counter, mentioned dataset using our ShellTokenizer, with top_tokens=100) alternatives from NLTK WordPunctTokenizer, and X_enc = se.tfidf() WhiteSpaceTokenizer which are known to be used in ICT industry for log parsing. Then all the three At this stage X enc can be supplied to fit() method corpora are encoded using the same term frequency- of API-interface supported by machine learning (ML) inverse document frequency (TF-IDF) realization. 2https://github.com/idank/bashlex 4For example https://blog.g0tmi1k.com/2011/08/ 3https://github.com/skudriashev/bashlint basic-linux-privilege-escalation/ Dmitrijs Trizna Tokenizer AUC F1 Precision Recall ing techniques has a clear preference over the others. Therefore we implemented all three encoding types SLP (ours) 0.994 0.874 0.980 0.789 since even basic logic like label encoding can yield the WordPunct 0.988 0.392 1.0 0.244 best results on specific data types and problem state- WhiteSpace 0.942 0.164 1.0 0.089 ments. We encourage analysts to experiment with various shell preprocessing techniques to understand Table 1: Comparison of tokenization tecnhiques on se- which way benefits their pipelines. curity classification task: SLP, WordPunctTokenizer, WhiteSpaceTokenizer. 6 Conclusions In this article, we presented custom tokenization and encoding techniques focused on Unix shell commands. We describe the rationale of the dedicated tokenization approach, with specific shell command examples where conventional NLP techniques fail, and briefly cover the inner working of our library. To distinguish this tech- nique from known existing pipelines we evaluate the security classification task, with a custom dataset col- lected from real-world samples across the web and an efficient ensemble model. According to acquired met- rics, our model achieves a significant improvement of the F1-score. References [1] L. Buitinck, G. Louppe, M. Blondel, F. Pedregosa, A. Mueller, O. Grisel, V. Niculae, P. Prettenhofer, A. Gramfort, J. Grobler, R. Layton, J. VanderPlas, A. Joly, B. Holt, and G. Varoquaux. API design for machine learning software: experiences from the scikit-learn
Recommended publications
  • Beginning Portable Shell Scripting from Novice to Professional
    Beginning Portable Shell Scripting From Novice to Professional Peter Seebach 10436fmfinal 1 10/23/08 10:40:24 PM Beginning Portable Shell Scripting: From Novice to Professional Copyright © 2008 by Peter Seebach All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-1-4302-1043-6 ISBN-10 (pbk): 1-4302-1043-5 ISBN-13 (electronic): 978-1-4302-1044-3 ISBN-10 (electronic): 1-4302-1044-3 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Frank Pohlmann Technical Reviewer: Gary V. Vaughan Editorial Board: Clay Andres, Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan Gennick, Michelle Lowman, Matthew Moodie, Jeffrey Pepper, Frank Pohlmann, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Project Manager: Richard Dal Porto Copy Editor: Kim Benbow Associate Production Director: Kari Brooks-Copony Production Editor: Katie Stence Compositor: Linda Weidemann, Wolf Creek Press Proofreader: Dan Shaw Indexer: Broccoli Information Management Cover Designer: Kurt Krames Manufacturing Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013.
    [Show full text]
  • Introduction to Unix
    Introduction to Unix Rob Funk <[email protected]> University Technology Services Workstation Support http://wks.uts.ohio-state.edu/ University Technology Services Course Objectives • basic background in Unix structure • knowledge of getting started • directory navigation and control • file maintenance and display commands • shells • Unix features • text processing University Technology Services Course Objectives Useful commands • working with files • system resources • printing • vi editor University Technology Services In the Introduction to UNIX document 3 • shell programming • Unix command summary tables • short Unix bibliography (also see web site) We will not, however, be covering these topics in the lecture. Numbers on slides indicate page number in book. University Technology Services History of Unix 7–8 1960s multics project (MIT, GE, AT&T) 1970s AT&T Bell Labs 1970s/80s UC Berkeley 1980s DOS imitated many Unix ideas Commercial Unix fragmentation GNU Project 1990s Linux now Unix is widespread and available from many sources, both free and commercial University Technology Services Unix Systems 7–8 SunOS/Solaris Sun Microsystems Digital Unix (Tru64) Digital/Compaq HP-UX Hewlett Packard Irix SGI UNICOS Cray NetBSD, FreeBSD UC Berkeley / the Net Linux Linus Torvalds / the Net University Technology Services Unix Philosophy • Multiuser / Multitasking • Toolbox approach • Flexibility / Freedom • Conciseness • Everything is a file • File system has places, processes have life • Designed by programmers for programmers University Technology Services
    [Show full text]
  • Ardpower Documentation Release V1.2.0
    ardPower Documentation Release v1.2.0 Anirban Roy Das Sep 27, 2017 Contents 1 Introduction 1 2 Screenshot 3 3 Documentaion 5 3.1 Overview.................................................5 3.2 Installation................................................7 3.3 Usage................................................... 12 4 Indices and tables 13 i ii CHAPTER 1 Introduction Its a custom Oh-My-Zsh Theme inspired by many custom themes suited for a perfect ZSH Environment under Byobu with Tmux Backend. 1 ardPower Documentation, Release v1.2.0 2 Chapter 1. Introduction 3 ardPower Documentation, Release v1.2.0 CHAPTER 2 Screenshot 4 Chapter 2. Screenshot CHAPTER 3 Documentaion You can also find PDF version of the documentation here. Overview We will start with understanding the individual components of an entire CLI. Generally we don’t put much attention to what we do. We just fire up a terminal or some say sheel and start typing our commands and get the result. That’s all. But there are a lot of things that goes behind all this. Terminal The very first component is the Terminal. So what is a Terminal? A terminal emulator, terminal application, term, or tty for short, is a program that emulates a video ter- minal within some other display architecture. Though typically synonymous with a shell or text terminal, the term terminal covers all remote terminals, including graphical interfaces. A terminal emulator inside a graphical user interface is often called a terminal window.A terminal window allows the user access to a text terminal and all its applications such as command-line interfaces (CLI) and text user interface (TUI) applications.
    [Show full text]
  • Unix Shell Programming – by Dinesh Kumar S
    1 Unix Shell Programming – by Dinesh Kumar S PDF by http://www.k2pdf.com Contents Chapters Topic Page no. Chapter 1 Introduction 3 Chapter 2 SSH Client 4 Chapter 3 Unix Shells 8 Chapter 4 Text Editors 11 Chapter 5 A Beginning to Shell Scripting 19 Chapter 6 Operators 33 Chapter 7 Variables Manipulation (Advance) 39 Chapter 8 Conditional Statements 43 Chapter 9 Looping Statements 47 Chapter 10 Control Statements 74 Chapter 11 Functions 79 2 Unix Shell Programming – by Dinesh Kumar S Chapter 1 Introduction Linux : It is an operating system based on UNIX . Kernel : It is the backbone of Linux OS, which is used to manage resources of Linux OS like memory, I/O, software, hardware management processes. User Shell Script Kernel PC h/w User writes script. Script contains instructions. Kernel interprets the instruction in machine language. As per the instruction kernel controls the PC hardware. Shell script : It’s a collection of OS commands or instructions. Advantages of Shell Script : Script is always a platform independent. Performance will be faster than programming languages. Very easy to debug. 3 Unix Shell Programming – by Dinesh Kumar S Chapter 2 SSH Client Secure Shell (or) SSH is a network protocol that is used to exchange or share information between two different networks. This is used on Linux & UNIX systems to access SHELL accounts. All the information exchanged/transmitted between networks is encrypted . It uses public key cryptography to authenticate remote computer user. Free Serial, Telnet, and SSH client Putty Tera Term Putty : It is a terminal emulator application which acts as client for SSH, Telnet, rLogin.
    [Show full text]
  • Introduction to Unix
    Introduction to Unix BorisBoris KonevKonev [email protected] http://www.csc.liv.ac.uk/~konev Important information Instructor: – Boris Konev – Office: 1.12 – Email: [email protected] – Web resources: www.csc.liv.ac.uk/~konev/COMP110 NoNo lectureslectures onon Monday!!Monday!! Objectives • Basic structure of the operating system • What makes Unix special? • Unix System Design • Essential commands • Essential concepts • Shells • Shell programming • Text processing • Unix utilities Why Bother Studying Unix? • Most powerful computers (supercomputers) use the Unix operating system • Unix runs the Internet • Unix is used as an embedded system in hardware – networking, user appliances (DVD players) • A knowledge of Unix is likely to be helpful in your future career, regardless of where you pursue it. History of Unix 1960s “multics” project (MIT, GE, AT&T) 1970s AT&T Bell Labs 1970s/80s UC Berkeley 1980s DOS imitated many Unix ideas Commercial Unix fragmentation GNU Project 1990s Linux now Unix is widespread and available from many sources, both free and commercial Unix Systems • Commercial – SunOS/Solaris Sun Microsystems – Digital Unix (Tru64) Digital/Compaq – HP-UX Hewlett Packard – Irix SGI – UNICOS Cray – Mac OS X Apple – … • Free – NetBSD, FreeBSD, … – Linux – … What makes Unix so special? (1) • Portability (runs on almost every hardware) • Old and popular – it is easy to find information and get help • Simplicity, elegance & flexibility • Time-sharing: multi-tasking & multi-user environment • Unix is very stable – computers running
    [Show full text]
  • Augmented Unix Userland
    Project MXC-403 Augmented Unix Userland Major Qualifying Project Submitted to the Faculty of Worcester Polytechnic Institute in partial fulfillment of the requirements for the Degree in Bachelor of Science in Computer Science By Sam Abradi [email protected] Ian Naval [email protected] Fredric Silberberg [email protected] Submitted On: April 30, 2015 Project Advisor: Professor Michael Ciaraldi [email protected] This report represents work of WPI undergraduate students submitted to the faculty as evidence of a degree requirement. WPI routinely publishes these reports on its web site without editorial or peer review. For more information about the projects program at WPI, see http: // www. wpi. edu/ Academics/ Projects . Abstract The Unix philosophy has resulted in stringing together simple general purpose utili- ties to accomplish complex tasks. However, using text as a communication medium between these programs requires several formatting utilities to transform output from one program into valid input to another. These transformations can be very complicated and confusing. This project looked at two alternative shell designs that use different communication methods between programs, simplifying interprogram communication and leveraging existing technologies to make developing new utilities and shell scripts easier. i Contents Abstracti List of Figuresv List of Tables vi 1 Introduction1 1.1 AUU Terminology.............................1 1.2 Motivation.................................1 1.3 The AUU Project.............................3 2 JSON Shell4 2.1 Motivation: Why JSON?.........................4 2.2 JSON Protocol Design..........................4 Streams..................................4 Standards and Definitions........................5 Example Use Case: ps..........................6 2.3 Tributary.................................8 Tributary Selectors............................8 Using Tributary to Standardize Output.................9 2.4 Utilities Implemented..........................
    [Show full text]
  • A User's Guide to the Z-Shell
    A User’s Guide to the Z-Shell Peter Stephenson 2003/03/23 2 Contents 1 A short introduction 11 1.1 Other shells and other guides . 12 1.2 Versions of zsh . 13 1.3 Conventions . 14 1.4 Acknowledgments . 15 2 What to put in your startup files 17 2.1 Types of shell: interactive and login shells . 17 2.1.1 What is a login shell? Simple tests . 18 2.2 All the startup files . 19 2.3 Options . 21 2.4 Parameters . 21 2.4.1 Arrays . 23 2.5 What to put in your startup files . 24 2.5.1 Compatibility options: SH_WORD_SPLIT and others . 24 2.5.2 Options for csh junkies . 32 2.5.3 The history mechanism: types of history . 34 2.5.4 Setting up history . 36 2.5.5 History options . 37 2.5.6 Prompts . 39 2.5.7 Named directories . 42 2.5.8 ‘Go faster’ options for power users . 43 2.5.9 aliases . 45 2.5.10 Environment variables . 46 3 4 CONTENTS 2.5.11 Path . 47 2.5.12 Mail . 48 2.5.13 Other path-like things . 49 2.5.14 Version-specific things . 50 2.5.15 Everything else . 50 3 Dealing with basic shell syntax 51 3.1 External commands . 51 3.2 Builtin commands . 53 3.2.1 Builtins for printing . 53 3.2.2 Other builtins just for speed . 56 3.2.3 Builtins which change the shell’s state . 57 3.2.4 cd and friends . 59 3.2.5 Command control and information commands .
    [Show full text]
  • Linux Shells What Is Linux and Why Should We Use It?
    Linux Shells What is linux and why should we use it? Linux is a fast growing operating system, and it is inexpensive and flexible. Linux is also a major player in the small and mid-sized server field, and it’s an increasingly viable platform for workstation and desktop use as well. By understanding Linux, you’ll increase your standing in the job market... Linux is a clone of the UNIX operating system (OS) that has been popular in academia and many business environments for years. Formerly used exclusively on large mainframes, UNIX and Linux can now run on small computers. Because of its mainframe heritage, UNIX (and hence also Linux) scales well to perform today’s demanding scientific, engineering, and network server tasks. Linux consists of a Kernel, which is the core control software, and many libraries and utilities that rely on the Kernel to provide features with which user interact. The OS is available in many different distributions, which are collections of a specific Kernel with specific support programs. Command-Line Basics. Before you can do anything else with Linux, you should understand how to use a Linux shell. Several shells are available, but most of them provide similar capabilities. Understanding a few basics will take you a long way in your use of Linux, so I describe some of these techniques and commands. Linux Shell Options: Linux provides a range of options for shells. A complete list would be quite long so I only named the more common choices which include the following: bash – The GNU Bourne Again Shell (bash) is based on the earlier Bourne shell for UNIX but extends it in several ways.
    [Show full text]
  • Tip 36: Try a New Shell
    Tip 36: Try a new shell Ben Klemens 12 December 2011 level: command-line habitant purpose: get comfortable in your shell I started (Entry #082) this set of shell tips with a list I made up: the shell provides (1) facilities for interactive comfort, (2) history, (3) a ton of macro-like expansions, and (4) programming standards like for loops and if statements. I then gave you tips for parts (2), (3), and (4). Here’s my tip for item (1): try a new shell. There is no particular reason for the interactive features to stick to any one standard, because it is by definition not the programmable and scriptable part of things, so some shells provide much more user comfort than others. If some shell wants to have an animated paperclip in the corner kibbitzing your work, who’re they hurting? The shell you’re using now is probably bash, the Bourne-again shell, so named because it’s a variant of Stephen Bourne’s shell for the original UNIX. It is part of the GNU project, and so has very wide distribution. But wide distribution means that it can’t be too experimental with new features and comforts, because it has to run everywhere, and for every stupid quirk somebody has written a really important shell script that depends upon that quirk. I have my own complaints: GNU tools tend to provide half-hearted support for the vi keymap (which I have very much internalized), and the manual page is amazing for having absolutely no examples. If you are on a Mac with software a couple of years old, then you may be on a version of the C shell.
    [Show full text]
  • Introduction Configuring and Using the Z Shell
    Laboratory Assignment One 1 Due: February 3, 2014 CMPSC 440 Operating Systems Spring 2014 Laboratory Assignment One: Customizing and Using the Z Shell Introduction Computer scientists who use, configure, and implement an operating system (OS) often interact with the OS through the use of the shell. There are many operating system shells available for the Unix, Linux, and Mac OSX operating systems (i.e., sh, tcsh, bash, and fish). In this laboratory session, you will learn how to configure and use zsh, arguably the most advanced and customizable shell for the Linux operating system; learn more about it by visiting http://zsh.sourceforge.net. Configuring and Using the Z Shell To start using the Z shell, hereafter abbreviated as zsh, you must open a terminal window and type zsh. Try to navigate your file system and run a program through zsh. Do you notice any differences between this new shell and the one that you were using previously? What is the name of the shell that is the default for the Ubuntu operating system? Which do you like better? Why? Zsh can be quickly and easily configured with a community-driven configuration framework called oh-my-zsh. You can learn more about this framework by visiting the following Web site: https://github.com/robbyrussell/oh-my-zsh. Once you understand the basics of oh-my-zsh, please follow the instructions on the project's Web site to install it in your home account. After installing this framework, does your shell operate in a different way? If yes, then how? The oh-my-zsh framework supports a wide variety of themes for your shell.
    [Show full text]
  • Basic Bash Programming
    Basic Bash programming Simon Funke1;2 Hans Petter Langtangen1;2 Joakim Sundnes1;2 Ola Skavhaug3 Jonathan Feinberg Center for Biomedical Computing, Simula Research Laboratory1 Dept. of Informatics, University of Oslo2 Expert Analytics (formerly Dept. of Informatics, University of Oslo)3 Aug 25, 2015 1 Some more course information 2 Basic Bash programming We will use Piazza as a knowledge platform Allows students to ask and answer questions. Great discussion platform. Lecturers/teaching assistants will be active on the platform to help. Sign up: http://piazza.com/uio.no/fall2015/inf3331inf4331 Assignment 1 Deadline: 4st September. Make sure that you have your private INF3331 repository in your github account (you should have gotten an email with instructions). If not, visit the group session 1 today (14:15-16:00) or ask on Piazza. Download this and future assignments from the INF3331 website. http://www.uio.no/studier/emner/matnat/i/INF3331/h15 Good introductions to git A Quick intro to Git and GitHub: http://hplgit.github.io/teamods/bitgit/Langtangen_github.pdf A more extensive introduction to Git: https://git-scm.com/book/en/v2 (rst three chapters). 1 Some more course information 2 Basic Bash programming Overview of Unix shells The original scripting languages were (extensions of) command interpreters in operating systems Primary example: Unix shells Bourne shell (sh) was the rst major shell C and TC shell (csh and tcsh) had improved command interpreters, but were less popular than Bourne shell for programming Bourne Again shell (Bash/`bash`):
    [Show full text]
  • Linux/Unix Shell Intro Outline
    12/10/13 Linux/Unix Shell Intro Dr. Chokchai (Box) Leangsuksun Louisiana Tech University Original slides were created by Dr. deBry from uvu.edu 1 Outline Louisiana Tech University 2 2 1 12/10/13 USER Interface • Command Line Interface • Shell commands • C-shell, tsh-shell, bourne shell etc.. • Graphic User Interface • GNOME, KDE etc.. Louisiana Tech University 3 CLI or Shell • Command Line Interface • The shell is a command interpreter • It provides the interface between a user and the operating system via command line • Shell commands. Egshell. ls , cd, pwd etc • Various shells: C-shell, tsh-shell, bourne shell etc.. • When you log in to a Unix system, a shell starts running. You interact with the default shell 2 12/10/13 this is the shell prompt this is where the shell the SHELL environment variable tells program is located which shell is being used /bin/bash In MAC Louisiana Tech University 6 6 3 12/10/13 Various shell programs Shell name Program (Command) name rc rc Bourne Shell sh C Shell csh Bourne Again Shell bash Z shell zsh Korn Shell ksh TC tcsh you can change shells by typing the shell command return to the default shell by typing “exit” 4 12/10/13 The shell command line prompt shows command current directory. list of arguments ~ is your home directory The shell command line command options (usually preceded with a hyphen) 5 12/10/13 finger displays information for logged in users finger [options] user-list -l detailed listing -s brief listing How command line is interpreted ? What happens when you type a command? 1.
    [Show full text]