BSCIT – SEM V Linux System Administration MCQ 1. Which of the Following Is Not a Type of Shell? A. the C Shell B. the Korn

Total Page:16

File Type:pdf, Size:1020Kb

BSCIT – SEM V Linux System Administration MCQ 1. Which of the Following Is Not a Type of Shell? A. the C Shell B. the Korn BSCIT – SEM V Linux System Administration MCQ 1. Which of the following is not a type of shell? A. The C Shell B. The Korn Shell C. The Bourne Shell D. The Perl Shell 2. Which of the following is true about shell? A. A Shell provides you with an interface to the Unix system. B. Shell gathers input from you and executes programs based on that input. C. Shell is an environment in which we can run our commands, programs, and shell scripts. D. All of the above 3. What will be the output of $date? A. Yesterday date B. Current date C. Current date and time D. Tomarrow date and time 4. The original Unix shell was written in the mid ________. A. 1960s B. 1970s C. 1980s D. 1990s 5. The original Unix shell was written by __________. A. Stephen R. Bourne B. Stephen R. Korn C. Stephen R. C. D. Stephen Watson 6. On a UNIX system, there can be ____ shells running simultaneously. A. 2 B. 3 C. 4 D. Many 7. The prompt issued by the shell is called ______ A. prompt B. command translator C. command prompt D. command executor 8. In UNIX there are ___ major types of shells. A. 2 B. 3 C. 4 D. 5 9. What is the default symbol for command prompt in Bourne shell? A. ! B. # C. $ D. @ 10. Which shell is the most common and best to use? A. Korn shell B. C shell C. Bourne shell D. Bash Shell 11. Which symbol is used for taking input from standard input? A. & B. % C. - D. $ 12. Which of the following symbol(s) can be used to redirect the output to a file or another program? A. | B. > C. >> D. All of the above 13. The >> symbol is used to overwrite the existing file if it exists and | is used to give input to another program. A. True, False B. True, True C. False, True D. False, False 14. We can redirect the error message to file named newfile using __________ command. A. cat foo errorfile B. cat foo >errorfile C. cat errorfile>foo D. cat foo 2>errorfile 15. Which symbol is used to redirect error messages to /dev/null? A. < B. > C. % D. $ 16. Which command saves one copy of character stream in a file and store the other to standard output? A. who B. tee C. ls D. wc 17. Which of the following is not true about tee command? A. it is a feature of the shell B. it is an external command C. tee command duplicates its input D. tee is an internal command 18. A _______ is used to redirect input into an interactive shell script or program. A. document B. here C. here document D. who 19. What is the use of pgm < file command? A. Output of pgm is redirected to file B. Program pgm reads its input from file C. Output of pgm is appended to file D. Takes output from one program, or process, and sends it to another 20. What is the use of n >& m command? A. Merges output from stream n with stream m B. Merges input from stream n with stream m C. Both A and B D. None of the above 21. The name of a variable can contain ________. A. numbers B. letters C. underscore character D. All of the above 22. Unix shell variables will have their names in _____. A. Uppercase B. Lowercase C. First character Uppercase and all other character Lowercase D. First character Lowercase and all other character Uppercase 23. Whch of the following is invalid variable names? A. VAR_1 B. _ALI C. VAR1 D. VAR_A! 24. Shell variables are of ____ types. A. 3 B. 4 C. 2 D. 5 25. Which of the following command is used to display the environment variables only? A. sh B. set C. env D. var .
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]
  • SOAP / REST and IBM I
    1/11/18 SOPA / REST and IBM i Tim Rowe- [email protected] Business Architect Application Development © 2017 International Business Machines Corporation Using a REST API with Watson https://ibm-i-watson-test.mybluemix.net/ 2 © 2017 International Business Machines Corporation 1 1/11/18 ™ What is an API - Agenda •What is an API •What is a Web Service •SOAP vs REST – What is SOAP – What is REST – Benefits – Drawbacks 3 © 2017 International Business Machines Corporation ™ Connections Devices There Here Applications 4 © 2017 International Business Machines Corporation 2 1/11/18 ™ 5 © 2017 International Business Machines Corporation ™ 6 © 2017 International Business Machines Corporation 3 1/11/18 ™ 7 © 2017 International Business Machines Corporation ™ 8 © 2017 International Business Machines Corporation 4 1/11/18 ™ API Definition Application Programming Interface 9 © 2017 International Business Machines Corporation ™ API Definition 10 © 2017 International Business Machines Corporation 5 1/11/18 ™ APIs - Simple Simple way to connect endpoints. Send a request and receive a response. 11 © 2017 International Business Machines Corporation ™ Example Kitchen 12 © 2017 International Business Machines Corporation 6 1/11/18 ™ 13 © 2017 International Business Machines Corporation ™ Not just a buzz-word, but rather the evolution of services- oriented IT. Allows users, businesses & partners the ability to interact in new and different ways resulting in the growth (in some cases the revolution) of business. 14 © 2017 International Business Machines Corporation
    [Show full text]
  • Shell Variables
    Shell Using the command line Orna Agmon ladypine at vipe.technion.ac.il Haifux Shell – p. 1/55 TOC Various shells Customizing the shell getting help and information Combining simple and useful commands output redirection lists of commands job control environment variables Remote shell textual editors textual clients references Shell – p. 2/55 What is the shell? The shell is the wrapper around the system: a communication means between the user and the system The shell is the manner in which the user can interact with the system through the terminal. The shell is also a script interpreter. The simplest script is a bunch of shell commands. Shell scripts are used in order to boot the system. The user can also write and execute shell scripts. Shell – p. 3/55 Shell - which shell? There are several kinds of shells. For example, bash (Bourne Again Shell), csh, tcsh, zsh, ksh (Korn Shell). The most important shell is bash, since it is available on almost every free Unix system. The Linux system scripts use bash. The default shell for the user is set in the /etc/passwd file. Here is a line out of this file for example: dana:x:500:500:Dana,,,:/home/dana:/bin/bash This line means that user dana uses bash (located on the system at /bin/bash) as her default shell. Shell – p. 4/55 Starting to work in another shell If Dana wishes to temporarily use another shell, she can simply call this shell from the command line: [dana@granada ˜]$ bash dana@granada:˜$ #In bash now dana@granada:˜$ exit [dana@granada ˜]$ bash dana@granada:˜$ #In bash now, going to hit ctrl D dana@granada:˜$ exit [dana@granada ˜]$ #In original shell now Shell – p.
    [Show full text]
  • UNIX X Command Tips and Tricks David B
    SESUG Paper 122-2019 UNIX X Command Tips and Tricks David B. Horvath, MS, CCP ABSTRACT SAS® provides the ability to execute operating system level commands from within your SAS code – generically known as the “X Command”. This session explores the various commands, the advantages and disadvantages of each, and their alternatives. The focus is on UNIX/Linux but much of the same applies to Windows as well. Under SAS EG, any issued commands execute on the SAS engine, not necessarily on the PC. X %sysexec Call system Systask command Filename pipe &SYSRC Waitfor Alternatives will also be addressed – how to handle when NOXCMD is the default for your installation, saving results, and error checking. INTRODUCTION In this paper I will be covering some of the basics of the functionality within SAS that allows you to execute operating system commands from within your program. There are multiple ways you can do so – external to data steps, within data steps, and within macros. All of these, along with error checking, will be covered. RELEVANT OPTIONS Execution of any of the SAS System command execution commands depends on one option's setting: XCMD Enables the X command in SAS. Which can only be set at startup: options xcmd; ____ 30 WARNING 30-12: SAS option XCMD is valid only at startup of the SAS System. The SAS option is ignored. Unfortunately, ff NOXCMD is set at startup time, you're out of luck. Sorry! You might want to have a conversation with your system administrators to determine why and if you can get it changed.
    [Show full text]
  • Bash Guide for Beginners
    Bash Guide for Beginners Machtelt Garrels Garrels BVBA <tille wants no spam _at_ garrels dot be> Version 1.11 Last updated 20081227 Edition Bash Guide for Beginners Table of Contents Introduction.........................................................................................................................................................1 1. Why this guide?...................................................................................................................................1 2. Who should read this book?.................................................................................................................1 3. New versions, translations and availability.........................................................................................2 4. Revision History..................................................................................................................................2 5. Contributions.......................................................................................................................................3 6. Feedback..............................................................................................................................................3 7. Copyright information.........................................................................................................................3 8. What do you need?...............................................................................................................................4 9. Conventions used in this
    [Show full text]
  • Configuring Your Login Session
    SSCC Pub.# 7-9 Last revised: 5/18/99 Configuring Your Login Session When you log into UNIX, you are running a program called a shell. The shell is the program that provides you with the prompt and that submits to the computer commands that you type on the command line. This shell is highly configurable. It has already been partially configured for you, but it is possible to change the way that the shell runs. Many shells run under UNIX. The shell that SSCC users use by default is called the tcsh, pronounced "Tee-Cee-shell", or more simply, the C shell. The C shell can be configured using three files called .login, .cshrc, and .logout, which reside in your home directory. Also, many other programs can be configured using the C shell's configuration files. Below are sample configuration files for the C shell and explanations of the commands contained within these files. As you find commands that you would like to include in your configuration files, use an editor (such as EMACS or nuTPU) to add the lines to your own configuration files. Since the first character of configuration files is a dot ("."), the files are called "dot files". They are also called "hidden files" because you cannot see them when you type the ls command. They can only be listed when using the -a option with the ls command. Other commands may have their own setup files. These files almost always begin with a dot and often end with the letters "rc", which stands for "run commands".
    [Show full text]
  • Rc the Plan 9 Shell
    Rc ߞ The Plan 9 Shell Tom Duff [email protected]−labs.com ABSTRACT Rc is a command interpreter for Plan 9 that provides similar facilities to UNIXߣs Bourne shell, with some small additions and less idiosyncratic syntax. This paper uses numerous examples to describe rcߣs features, and contrasts rc with the Bourne shell, a model that many readers will be familiar with. 1. Introduction Rc is similar in spirit but different in detail from UNIXߣs Bourne shell. This paper describes rcߣs principal features with many small examples and a few larger ones. It assumes familiarity with the Bourne shell. 2. Simple commands For the simplest uses rc has syntax familiar to Bourne-shell users. All of the fol­ lowing behave as expected: date cat /lib/news/build who >user.names who >>user.names wc <file echo [a−f]*.c who | wc who; date vc *.c & mk && v.out /*/bin/fb/* rm −r junk || echo rm failed! 3. Quotation An argument that contains a space or one of rcߣs other syntax characters must be enclosed in apostrophes (’): rm ’odd file name’ An apostrophe in a quoted argument must be doubled: echo ’How’’s your father?’ 4. Patterns An unquoted argument that contains any of the characters *?[is a pattern to be matched against file names. A * character matches any sequence of characters, ? matches any single character, and [class] matches any character in the class, unless the first character of class is ~, in which case the class is complemented. The class may ­ 2 ­ also contain pairs of characters separated by −, standing for all characters lexically between the two.
    [Show full text]
  • Shell Scripting, Globs, and Ranges
    SHELL SCRIPTING AND CUSTOMIZATION GPI F20 · Emmanuel & Sayan PET TAX Carole Bashkin! Ran her program, bashed it Can’t convince her that bash isn’t awesome Pipin’, globbin’, multitaskin’ What’s happen? Carole Bashkin! WHAT IS A SHELL? ● A shell is the outermost layer that allows a user to interact with the operating system. ● For a programmer, it is the program that powers your terminal. ● We will focus on Unix shells, command-line interpreters for Unix-like operating systems. ● They come in many flavors. ○ zsh, bash, fish, etc. COMMAND CENTER ● Show contents of a file cat path ● Show contents of a directory ls ● Change directories cd path ● Remove a file rm src ● Move/rename a file mv src dst ● Copy a file cp src new_name ● Execute a binary ./name ● Print something echo “Hello, world!” OVER, OVER, AND OVER AGAIN ● Sometimes, you want to run the same set of commands multiple times. ○ Compiling and testing your code ○ Renaming a bunch of files ○ Initializing your git repos with a .gitignore ○ Archiving your new favorite xkcd comics ○ Setting up your dev environment on a new machine ● Shell scripts allow you to run a sequence of shell commands from a file. WRITE YOUR OWN SHELL SCRIPT ● Each script begins with a shebang followed by the commands you want to execute. ○ #!/bin/zsh ○ #!/bin/bash ○ #!/usr/bin/env python3 ● Add executable permissions to your file. ○ chmod +x script.sh ○ This changes the mode of the file to an executable. ● Run the script! ○ ./script.sh FUNCTIONS ARE SHELL SCRIPTS ● Apart from interfacing with the operating system, they support other programming constructs as well.
    [Show full text]
  • An Introduction to the C Shell
    -- -- An Introduction to the C shell William Joy (revised for 4.3BSD by Mark Seiden) Computer Science Division Department of Electrical Engineering and Computer Science University of California, Berkeley Berkeley, California 94720 ABSTRACT Csh is a newcommand language interpreter for UNIX†systems. It incorporates good features of other shells and a history mechanism similar to the redo of INTERLISP. While incorporating manyfeatures of other shells which makewriting shell programs (shell scripts) easier,most of the features unique to csh are designed more for the interac- tive UNIX user. UNIX users who have read a general introduction to the system will find a valuable basic explanation of the shell here. Simple terminal interaction with csh is possible after reading just the first section of this document. The second section describes the shell’s capabilities which you can explore after you have begun to become acquainted with the shell. Later sections introduce features which are useful, but not necessary for all users of the shell. Additional information includes an appendix listing special characters of the shell and a glossary of terms and commands introduced in this manual. Introduction A shell is a command language interpreter. Csh is the name of one particular command interpreter on UNIX.The primary purpose of csh is to translate command lines typed at a terminal into system actions, such as invocation of other programs. Csh is a user program just likeany you might write. Hopefully, csh will be a very useful program for you in interacting with the UNIX system. In addition to this document, you will want to refer to a copyofthe UNIX User Reference Manual.
    [Show full text]
  • Monitoring Malicious Powershell Usage Through Log Analysis
    Monitoring malicious PowerShell usage through log analysis Jesper Magnusson Computer Science and Engineering, master's level 2019 Luleå University of Technology Department of Computer Science, Electrical and Space Engineering (This page is intentionally left almost blank) Abstract Security has become a hot topic around the world but focuses more on the perime- ter than inside networks which opens up vulnerabilities. Directed cyber-attacks towards the energy sector which leverages this fact has increased and can have dis- astrous effect, even on national level. To counter this, a solution to monitor the usage of the most powerful and popular built-in tool among attackers - PowerShell - was implemented. A test-bed was set up reflecting a corporate network with two separate active directory domains, one for office clients and one for critical infrastructure. It was shown that attackers only needed to overtake the office active directory domain in order for gain easy access to the critical active directory domain. To simulate attacks of this type, a collection of malicious scripts was gathered from which a number of possible scenarios for taking over the office active directory domain via PowerShell was created. Windows has several options for logging executions of PowerShell commands on machines. The one used and deemed most beneficiary was "Module logging" with the addition of a filtered result of process creation logs. To monitor the logs created on the office client from PowerShell executions, a system based on the "ELK stack" was set up. This system gathered, processed, stored and visualized logs along with the result of their analysis. The system analyzed logs with the aid of a custom software called "ESPSA" which based on different parameters and contexts assigned every execution with a risk value indicating the level of maliciousness.
    [Show full text]
  • A Shell with Higher-Order Functions Paul Haahr ± Adobe Systems Incorporated Byron Rakitzis ± Network Appliance Corporation
    Es: A shell with higher-order functions Paul Haahr ± Adobe Systems Incorporated Byron Rakitzis ± Network Appliance Corporation ABSTRACT In the fall of 1990, one of us (Rakitzis) re-implemented the Plan 9 command interpreter, rc, for use as a UNIX shell. Experience with that shell led us to wonder whether a more general approach to the design of shells was possible, and this paper describes the result of that experimentation. We applied concepts from modern functional programming languages, such as Scheme and ML, to shells, which typically are more concerned with UNIX features than language design. Our shell is both simple and highly programmable. By exposing many of the internals and adopting constructs from functional programming languages, we have created a shell which supports new paradigms for programmers. Although most users think of the shell as an At a super®cial level, es looks like most UNIX interactive command interpreter, it is really a pro- shells. The syntax for pipes, redirection, background gramming language in which each statement runs a jobs, etc., is unchanged from the Bourne shell. Es's command. Because it must satisfy both the interac- programming constructs are new, but reminiscent of tive and programming aspects of command execu- rc and Tcl[6]. tion, it is a strange language, shaped as much by Es is freely redistributable, and is available by history as by design. anonymous ftp from ftp.white.toronto.edu. Ð Brian Kernighan & Rob Pike [1] Using es Introduction Commands A shell is both a programming language and For simple commands, es resembles other the core of an interactive environment.
    [Show full text]
  • Tivoli Storage Manager Using the Application Program Interface
    Tivoli Storage Manager Using the Application Program Interface Version 5 Release 1 GC32-0793-00 Tivoli Storage Manager Using the Application Program Interface Version 5 Release 1 GC32-0793-00 Note Before using this information and the product it supports, read the general information in “Appendix F. Notices” on page 237. First Edition (March 2002) This edition applies to version 5, release 1, modification 0 of the Tivoli Storage Manager Using the Application Program Interface (5698-SPM) and to all subsequent releases and modifications until otherwise indicated in new editions. This edition replaces SH26–4123–01. © Copyright International Business Machines Corporation 1993, 2002. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Figures ...............v Accessing Across Nodes and Across Owners . 25 Managing Filespaces ...........26 Tables ...............vii Associating a Management Class With Objects. 28 Query Management Classes ........29 Querying the TSM System .........30 About This Book...........ix An Example .............32 Who Should Read This Manual ........ix Sending Data to a Server ..........34 Conventions Used in This Manual .......ix The Transaction Model .........34 Reading Syntax Diagrams ..........x File Aggregation............34 Related Information ...........xii Sending Objects to the Server ........35 Accessing Publications Online .......xii Understand Backup And Archive Objects . 35 How to Contact Us ...........xiii Compression .............36 Summary of Code Changes .........xiv Reading State Diagrams and Flowcharts .....36 Version 5 Release 1 Level 0 March 2002....xiv An Example .............39 Version 4 Release 2 Level 1 November 2001 . xv File Grouping .............41 Version 4 Release 2 Level 0 June 2001 ....xv Receiving Data from a Server ........43 Version 4 Release 1 Level 0 July 2000 ....xvi Perform a Partial Object Restore or Retrieve .
    [Show full text]