SANJAY GHODAWAT POLYTECHNIC

Size: px
Start display at page:

Download "SANJAY GHODAWAT POLYTECHNIC"

Transcription

1 EXPERIMENT NO. 01 Name of Experiment Implement following commands with their options: ps and kill. df and du mount and umount. (4 Hours) Prerequisite of. / execution of Basic knowledge about linux command. Linux Operating System. Open shell terminal Set ps command and get information of process. Set $ ps ag command for real time process monitoring. Use kill command to kill process by ID $kill 1020 Use killall command to kill all processes. Kill with process name $killall processname Stop all process $kill 0 Df command is used to check disk available space. $df $df h The du command shows the disk usage for a specific directory (by default, the current directory). $du c $du h Mount Command mount -t vfat /dev/sdb1 /media/disk Unmount Command $umount Check command result and notice that results. Do not kill system processes. Note down all results after command execution. Describe Linux file structure in details.

2 EXPERIMENT NO. 02 Name of Experiment Implement grep and tar commands. (4 Hours) Prerequisite of. / execution of Open Linux shell Before performing grep command need files for searching data Type in shell Create sample files in linux in home directory $cat file1 One two three four $man grep Check grep manual and performing operating $grep two file Use different attributes Use tar command for archiving file $man tar $tar cvf test.tar /test1/test2 Use different parameters and attributes in grep and tar command examples. Note down result of different attributes used in examples Explain grep and tar commands with 4 examples.

3 EXPERIMENT NO. 03 Name of Experiment Prerequisite of. / execution of Implement setting of global and local environment variable, shell environment variables. (4 Hours) Open Linux shell $ echo $SHELL would give you the name of the current shell you are using. To see a list of the environment variables that are already set on your machine, type the following- $ env Display current environment variables- $set Printing shell, environment variables $printenv $env VAR1="blahblah" command_to_run command_options Creating Environment variables $test_var=testing $echo test_var $export test_var $echo $test_var e.g $export PATH=${PATH}:/home/cse/bin Removing Environment Variables $unset test_var Seting PATH variable $ PATH=$PATH:/home/rich/test Setting Shell variables $test_var='cse' To define a temporary value to a shell variable use the command: $set variable_name=value Use different parameters and attributes in shell commands Note down result of different attributes used in examples

4 EXPERIMENT NO. 04 Name of Experiment Create users, groups.set permissions and ownership. View the /etc/passwd file and describe its syntax. View the /etc/shadow file and describe its syntax. View the /etc/group file and describe its syntax. (4 Hours) Prerequisite of. Equipment/ Instrumentation Adding a new user Open Linux shell # /usr/sbin/useradd D You can test this by creating a new user account using the default system parameters # /usr/sbin/useradd test Changing the default values is a snap: # useradd -D -s /bin/tsch Removing a user # /usr/sbin/userdel -r test Modifying a user Usermod passwd and chpasswd # passwd test The chpasswd command reads a list of login name and password pairs (separated by a colon) from the standard input, and automatically encrypts the password and sets it for the user account. chsh, chfn, and chage # chfn test # finger rich # chfn test # finger test The /etc/group file Creating new groups # /usr/sbin/groupadd shared # /usr/sbin/usermod -G shared test Modifying groups # /usr/sbin/groupmod -n sharing shared Default file permissions $ touch newfile $ ls -al newfile $ umask Changing permissions Format: chmod options mode file

5 $ chmod 760 newfile $ ls -l newfile $ chmod o+r newfile Changing ownership The format of the chown command is: chown options owner[.group] file # chown dan newfile # ls -l newfile The /etc/passwd file $man passwd $ cat /etc/passwd The /etc/shadow file The /etc/shadow file contains one record for each user account on the system. A record looks like this: rich:$1$.ffck0ns$f1ugiyhq25wrb/hykcn020:11627:0:99999:7::: In between check Points Use ls command to check system result of operation. during / execution of Note down result of different attributes used in examples.

6 EXPERIMENT NO. 05 Name of Experiment Prerequisite of. / execution of Implement setting up and releasing of special permissions (SGID, SUID and sticky bit) and state their effects. (4 Hours) Open Linux shell The set user id (SUID): When a file is executed by a user, the program runs under the permissions of the file owner. The set group id (SGID): For a file, the program runs under the permissions of the file group. For a directory, new files created in the directory use the directory group as the default group. The sticky bit: The file remains (sticks) in memory after the process ends. to create a shared directory that always sets the directory group for all new files, all you need to do is set the SGID bit for the directory: $ mkdir testdir $ ls l $ chgrp shared testdir $ chmod g+s testdir $ ls l $ umask 002 $ cd testdir $ touch testfile $ ls -l Use different parameters and attributes in shell commands Note down result of different attributes used in examples

7

8 EXPERIMENT NO. 06 Name of Experiment Implement I/O Redirection and Pipes. (4 Hours) Prerequisite of. Output redirection The most basic type of redirection is sending output from a command to a file. The bash shell uses the greater-than symbol for this: command > outputfile $ date > test6 $ ls -l test6 $ cat test6 Now the contents of the test6 file contain the output from the who command. $ who > test6 $ cat test6 $ date >> test6 $ cat test6 The test6 file still contains the original data from the who command processed earlier, plus now it contains the new output from the date command. Input redirection The input redirection symbol is the less-than symbol (<): command < inputfile $ wc < test6 The wc command provides a count of text in the data. The inline input redirection symbol is the double less-than symbol (<<). Besides this symbol, you must specify a text marker that delineates the beginning and end of the data used for input. command << marker $ wc << EOF > test string 1 > test string 2 > test string 3 > EOF Pipes There are times when you need to send the output of one command to the input of another command. This process is called piping. The pipe symbol is the bar operator ( ): command1 command2 Now, using piping you can easily pipe the output of the rpm command directly to the sort

9 command to produce your results: $ rpm -qa sort / execution of Use different parameters and attributes in shell commands Note down result of different attributes used in examples Subject Teacher (Mr. Pise S. P ) HOD (Mr. Patil P.R.)

10 EXPERIMENT NO. 07 Name of Experiment Write shell script to demonstrate use of conditional and loop control statements. Write a shell script that shows effects of quotes on the Output of a variable. Write a shell script that looks through all the files in the current directory for the string POSIX and then prints the name of these files to the standard output. (6 Hours) Prerequisite of. Here The syntax expressed the how to use loops: if [ expression ] then Statement(s) to be executed if expression is true fi If else if [ expression ] then Statement(s) to be executed if expression is true else Statement(s) to be executed if expression is not true fi While Loop while command do Statement(s) to be executed if command is true Done For Loop for var in word1 word2... wordn do Statement(s) to be executed for every word. done try this Code for standard output #finding name of files echo current working directory files

11 find. print find. -name POSIX ls > search.txt ls > find. name POSIX #find name \*.txt.posix.txt ls > search.txt / execution of Use different parameters and attributes in shell commands Note down result of different attributes used in examples Subject Teacher (Mr. Pise S. P ) HOD (Mr. Patil P.R.)

12 EXPERIMENT NO. 08 Name of Experiment Write shell script to implement following test commands : For string comparisons. For numeric comparisons. For file comparisons (6 Hours) Prerequisite of. String Comparison Example 1: $ cat > test9b # testing string sort order val1=testing val2=testing if [ $val1 \> $val2 ] then echo "$val1 is greater than $val2" else echo "$val1 is less than $val2" fi $ sh test9b Testing is less than testing $ sort testfile Numeric Comparison Example 1: $ cat > test5 # using numeric test comparisons val1=10 val2=11 if [ $val1 -gt 5 ] then echo "The test value $val1 is greater than 5" fi if [ $val1 -eq $val2 ] then echo "The values are equal" else echo "The values are different" fi

13 echo The first test condition: if [ $val1 -gt 5 ] echo tests if the value of the variable val1 is greater than 5. The second test condition: if [ $val1 -eq $val2 ] echo There is a limitation to the test numeric conditions though. Try this script: #sh test5 File Comparison Example 1: $ cat > test11 # look before you leap if [ -d $HOME ] then echo "Your HOME directory exists" cd $HOME ls -a else echo "There s a problem with your HOME directory" fi $ sh test11 / execution of Use different parameters and attributes in shell commands Note down result of different attributes used in examples Subject Teacher (Mr. Pise S. P ) HOD (Mr. Patil P.R.)

14 EXPERIMENT NO. 09 Name of Experiment Write shell script that : Uses command line parameters. Counts number of parameters. Implements shift command. Implements processing option with parameter values. (6 Hours) Prerequisite of. Command Line Parameter Example 1 $ cat > test4 # handling lots of parameters total=$[ ${10} * ${11} ] echo The tenth parameter is ${10} echo The eleventh parameter is ${11} echo The total is $total $ sh test Counting Parameters Example 1 $ cat > test8 # getting the number of parameters echo There were $# parameters supplied. $ sh test8 There were 0 parameters supplied. $ sh test There were 5 parameters supplied. $ sh test There were 10 parameters supplied. $ sh test8 "Rich Blum" There were 1 parameters supplied. $ Shift Command

15 / execution of Example 2 $ cat > test14 # demonstrating a multi-position shift echo "The original parameters: $*" shift 2 echo "Here s the new first parameter: $1" $ sh test Use different parameters and attributes in shell commands Note down result of different attributes used in examples Subject Teacher (Mr. Pise S. P ) HOD (Mr. Patil P.R.)

16 EXPERIMENT NO. 10 Name of Experiment Write shell script : To implement redirection of Input script. For redirecting file descriptors. Creating input file descriptor. (6 Hours) Prerequisite of. Redirecting Input in Scripts Example 1 $ cat test12 # redirecting file input exec 0< testfile count=1 while read line do echo "Line #$count: $line" count=$[ $count + 1 ] done $./test12 Redirecting file descriptors Example 1 $ cat test14 # storing STDOUT, then coming back to it exec 3>&1 exec 1>test14out echo "This should store in the output file" echo "along with this line." exec 1>&3 echo "Now things should be back to normal" $./test14 Now things should be back to normal $ cat test14out This should store in the output file along with this line. $

17 / execution of Creating input file descriptors Example 1 $ cat test15 # redirecting input file descriptors exec 6<&0 exec 0< testfile count=1 while read line do echo "Line #$count: $line" count=$[ $count + 1 ] done exec 0<&6 read -p "Are you done now? " answer case $answer in Y y) echo "Goodbye";; N n) echo "Sorry, this is the end.";; esac $./test15 Use different parameters and attributes in shell commands Note down result of different attributes used in examples Subject Teacher (Mr. Pise S. P ) HOD (Mr. Patil P.R.)

18 EXPERIMENT NO. 11 Name of Experiment Practice sed editor and gawk utility. (6 Hours) Prerequisite of. Sed The format for using the sed command is: sed options script file $ echo "This is a test" sed s/test/big test/ This is a big test $ Using multiple editor commands in the command line To execute more than one command from the sed command line, just use the -e option: $ sed -e s/brown/green/; s/dog/cat/ data1 Reading editor commands from a file $ cat script1 s/brown/green/ s/fox/elephant/ s/dog/cat/ $ sed -f script1 data1 Gawk The gawk command format The basic format of the gawk program is: gawk options program file Reading the program script from the command line $ gawk {print "Hello John!"} Using data field variables $ cat data3 One line of test text. Two lines of test text. Three lines of test text. $ gawk {print $1} data3 Using multiple commands in the program script $ echo "My name is Rich" gawk {$4="Dave"; print $0} My name is Dave $ Reading the program from a file $ cat script2

19 / execution of { print $5 " s userid is " $1 } $ gawk -F: -f script2 /etc/passwd Running scripts before processing data $ gawk BEGIN {print "Hello World!"} Hello World! $ $ gawk BEGIN {print "Hello World!"} {print $0} Running scripts after processing data $ gawk BEGIN {print "Hello World!"} {print $0} END {print "byebye"} $ cat script4 BEGIN { print "The latest list of users and shells" print " Userid Shell" print " " FS=":" } { print $1 " " $7 } END { print "This concludes the listing" } $ Use different parameters and attributes in shell commands Note down result of different attributes used in examples Subject Teacher (Mr. Pise S. P ) HOD (Mr. Patil P.R.)

20 EXPERIMENT NO. 12 Name of Experiment Write a shell script using functions. Modify it to handle function with parameters, function returning values. Write shell script for handling array variables. Write shell script that uses function returning true or false result. (6 Hours) Prerequisite of. Returning a Value Example 1 $ cat test4 # testing the exit status of a function func1() { echo "trying to display a non-existent file" ls -l badfile } echo "testing the function:" func1 echo "The exit status is: $?" $./test4 Example 2 $ cat test5 # using the return command in a function function dbl { read -p "Enter a value: " value echo "doubling the value" return $[ $value * 2 ] } dbl echo "The new value is $?" $ Passing parameters to a function $ cat badtest1 # trying to access script parameters inside a function function badfunc1 { echo $[ $1 * $2 ] } if [ $# -eq 2 ] then

21 / execution of value=`badfunc1` echo "The result is $value" else echo "Usage: badtest1 a b" fi $./badtest1 Usage: badtest1 a b $./badtest /badtest1: * : syntax error: operand expected (error token is "* ") The result is $ Passing arrays to functions $ cat test10 # array variable to function test function testit { local newarray newarray=(`echo "$@"`) echo "The new array value is: ${newarray[*]}" } myarray=( ) echo "The original array is ${myarray[*]}" testit ${myarray[*]} $./test10 Use different parameters and attributes in shell commands Note down result of different attributes used in examples Subject Teacher (Mr. Pise S. P ) HOD (Mr. Patil P.R.)

22 EXPERIMENT NO. 13 Name of Experiment Write a shell script which checks disk space and store the value to the variable and display it. Write a shell script that tests connectivity with the PCs whose IPs are provided as command line parameters. (6 Hours) Prerequisite of. / execution of Use different parameters and attributes in shell commands Note down result of different attributes used in examples Subject Teacher (Mr. Pise S. P ) HOD (Mr. Patil P.R.)

Linux Essentials Objectives Topics:

Linux Essentials Objectives Topics: Linux Essentials Linux Essentials is a professional development certificate program that covers basic knowledge for those working and studying Open Source and various distributions of Linux. Exam Objectives

More information

5/20/2007. Touring Essential Programs

5/20/2007. Touring Essential Programs Touring Essential Programs Employing fundamental utilities. Managing input and output. Using special characters in the command-line. Managing user environment. Surveying elements of a functioning system.

More information

Useful Unix Commands Cheat Sheet

Useful Unix Commands Cheat Sheet Useful Unix Commands Cheat Sheet The Chinese University of Hong Kong SIGSC Training (Fall 2016) FILE AND DIRECTORY pwd Return path to current directory. ls List directories and files here. ls dir List

More information

CSCM98 Lab Class #5 Getting familiar with the command line

CSCM98 Lab Class #5 Getting familiar with the command line CSCM98 Lab Class #5 Getting familiar with the command line Lab Class Description. Unix has some powerful commands that can be combined inside shell scripts. Today we will have a look at various commands

More information

TestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103

TestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103 TestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103 CompTIA Linux+ Powered by LPI LX0-103 Objectives The Linux+ Powered by LPI Exam: LX0-103 exam covers the following topics. #

More information

Chapter 9. Shell and Kernel

Chapter 9. Shell and Kernel Chapter 9 Linux Shell 1 Shell and Kernel Shell and desktop enviroment provide user interface 2 1 Shell Shell is a Unix term for the interactive user interface with an operating system A shell usually implies

More information

Part 1: Basic Commands/U3li3es

Part 1: Basic Commands/U3li3es Final Exam Part 1: Basic Commands/U3li3es May 17 th 3:00~4:00pm S-3-143 Same types of questions as in mid-term 1 2 ls, cat, echo ls -l e.g., regular file or directory, permissions, file size ls -a cat

More information

LPIC-1 System Administrator

LPIC-1 System Administrator LPIC-1 System Administrator The world s largest and most recognized Linux Certification LPIC-1 is the first certification in LPI s multi-level Linux professional certification program. The LPIC-1 will

More information

UNIX System Programming Lecture 3: BASH Programming

UNIX System Programming Lecture 3: BASH Programming UNIX System Programming Outline Filesystems Redirection Shell Programming Reference BLP: Chapter 2 BFAQ: Bash FAQ BMAN: Bash man page BPRI: Bash Programming Introduction BABS: Advanced Bash Scripting Guide

More information

Linux Shell Scripting. Linux System Administration COMP2018 Summer 2017

Linux Shell Scripting. Linux System Administration COMP2018 Summer 2017 Linux Shell Scripting Linux System Administration COMP2018 Summer 2017 What is Scripting? Commands can be given to a computer by entering them into a command interpreter program, commonly called a shell

More information

Advanced Unix Programming Module 03 Raju Alluri spurthi.com

Advanced Unix Programming Module 03 Raju Alluri spurthi.com Advanced Unix Programming Module 03 Raju Alluri askraju @ spurthi.com Advanced Unix Programming: Module 3 Shells & Shell Programming Environment Variables Writing Simple Shell Programs (shell scripts)

More information

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description:

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: This course provides Bioinformatics students with the

More information

Linux Command Line Primer. By: Scott Marshall

Linux Command Line Primer. By: Scott Marshall Linux Command Line Primer By: Scott Marshall Draft: 10/21/2007 Table of Contents Topic Page(s) Preface 1 General Filesystem Background Information 2 General Filesystem Commands 2 Working with Files and

More information

UNIX Quick Reference

UNIX Quick Reference UNIX Quick Reference This card represents a brief summary of some of the more frequently used UNIX commands that all users should be at least somewhat familiar with. Some commands listed have much more

More information

Unix Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : December, More documents are freely available at PythonDSP

Unix Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : December, More documents are freely available at PythonDSP Unix Guide Meher Krishna Patel Created on : Octorber, 2017 Last updated : December, 2017 More documents are freely available at PythonDSP Table of contents Table of contents i 1 Unix commands 1 1.1 Unix

More information

Computer Systems and Architecture

Computer Systems and Architecture Computer Systems and Architecture Introduction to UNIX Stephen Pauwels University of Antwerp October 2, 2015 Outline What is Unix? Getting started Streams Exercises UNIX Operating system Servers, desktops,

More information

Shell Programming Systems Skills in C and Unix

Shell Programming Systems Skills in C and Unix Shell Programming 15-123 Systems Skills in C and Unix The Shell A command line interpreter that provides the interface to Unix OS. What Shell are we on? echo $SHELL Most unix systems have Bourne shell

More information

UNIT V. Dr.T.Logeswari. Unix Shell Programming - Forouzan

UNIT V. Dr.T.Logeswari. Unix Shell Programming - Forouzan UNIT V UNIX SYSTEM COMMUNICATION Dr.T.Logeswari 1 Electronic mail or email is easiest way of communication on unix. Fast and cheap Used to exchange graphics, sound and video files 2 3 Elements of a communication

More information

Computer Systems and Architecture

Computer Systems and Architecture Computer Systems and Architecture Stephen Pauwels Computer Systems Academic Year 2018-2019 Overview of the Semester UNIX Introductie Regular Expressions Scripting Data Representation Integers, Fixed point,

More information

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs Summer 2010 Department of Computer Science and Engineering York University Toronto June 29, 2010 1 / 36 Table of contents 1 2 3 4 2 / 36 Our goal Our goal is to see how we can use Unix as a tool for developing

More information

Shell Scripting. With Applications to HPC. Edmund Sumbar Copyright 2007 University of Alberta. All rights reserved

Shell Scripting. With Applications to HPC. Edmund Sumbar Copyright 2007 University of Alberta. All rights reserved AICT High Performance Computing Workshop With Applications to HPC Edmund Sumbar research.support@ualberta.ca Copyright 2007 University of Alberta. All rights reserved High performance computing environment

More information

Lab 2A> ADDING USERS in Linux

Lab 2A> ADDING USERS in Linux Lab 2A> ADDING USERS in Linux Objective In this lab, student will learn how to create user accounts using the Linux operating system. Scenario The XYZ Company has just installed a server running Linux.

More information

Perl and R Scripting for Biologists

Perl and R Scripting for Biologists Perl and R Scripting for Biologists Lukas Mueller PLBR 4092 Course overview Linux basics (today) Linux advanced (Aure, next week) Why Linux? Free open source operating system based on UNIX specifications

More information

On successful completion of the course, the students will be able to attain CO: Experiment linked. 2 to 4. 5 to 8. 9 to 12.

On successful completion of the course, the students will be able to attain CO: Experiment linked. 2 to 4. 5 to 8. 9 to 12. CIE- 25 Marks Government of Karnataka Department of Technical Education Bengaluru Course Title: Linux Lab Scheme (L:T:P) : 0:2:4 Total Contact Hours: 78 Type of Course: Tutorial, Practical s & Student

More information

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

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers Review of the Linux File System and Linux Commands 1. Introduction Becoming adept at using the Linux OS requires gaining familiarity

More information

More Raspian. An editor Configuration files Shell scripts Shell variables System admin

More Raspian. An editor Configuration files Shell scripts Shell variables System admin More Raspian An editor Configuration files Shell scripts Shell variables System admin Nano, a simple editor Nano does not require the mouse. You must use your keyboard to move around the file and make

More information

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words More Linux Commands 1 wc The Linux command for acquiring size statistics on a file is wc. This command provides the line count, word count and number of bytes in a file. Open up a terminal, make sure you

More information

Users, Groups and Permission in Linux

Users, Groups and Permission in Linux Users, Groups and Permission in Linux A small company is using Linux as the main operating and has hired you as a consultant. You completed a site walk through and also met with various individuals for

More information

Essential Unix (and Linux) for the Oracle DBA. Revision no.: PPT/2K403/02

Essential Unix (and Linux) for the Oracle DBA. Revision no.: PPT/2K403/02 Essential Unix (and Linux) for the Oracle DBA Revision no.: PPT/2K403/02 Architecture of UNIX Systems 2 UNIX System Structure 3 Operating system interacts directly with Hardware Provides common services

More information

DAVE LIDDAMENT INTRODUCTION TO BASH

DAVE LIDDAMENT INTRODUCTION TO BASH DAVE LIDDAMENT INTRODUCTION TO BASH @daveliddament FORMAT Short lectures Practical exercises (help each other) Write scripts LEARNING OBJECTIVES What is Bash When should you use Bash Basic concepts of

More information

bash startup files Linux/Unix files stty Todd Kelley CST8207 Todd Kelley 1

bash startup files Linux/Unix files stty Todd Kelley CST8207 Todd Kelley 1 bash startup files Linux/Unix files stty Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 midterms (Feb 27 and April 10) bash startup files More Linux Files review stty 2 We customize our

More information

Exam Linux-Praxis - 1 ( From )

Exam Linux-Praxis - 1 ( From  ) Exam Linux-Praxis - 1 ( From http://www.linux-praxis.de ) (1)Which of the following commands results in mailing the content of the current directory to Bob? A. mail Bob < ls B. ls > mail Bob C. ls mail

More information

Basic Linux (Bash) Commands

Basic Linux (Bash) Commands Basic Linux (Bash) Commands Hint: Run commands in the emacs shell (emacs -nw, then M-x shell) instead of the terminal. It eases searching for and revising commands and navigating and copying-and-pasting

More information

5/8/2012. Encryption-based Protection. Protection based on Access Permission (Contd) File Security, Setting and Using Permissions Chapter 9

5/8/2012. Encryption-based Protection. Protection based on Access Permission (Contd) File Security, Setting and Using Permissions Chapter 9 File Security, Setting and Using Permissions Chapter 9 To show the three protection and security mechanisms that UNIX provides To describe the types of users of a UNIX file To discuss the basic operations

More information

Introduction to the shell Part II

Introduction to the shell Part II Introduction to the shell Part II Graham Markall http://www.doc.ic.ac.uk/~grm08 grm08@doc.ic.ac.uk Civil Engineering Tech Talks 16 th November, 1pm Last week Covered applications and Windows compatibility

More information

User & Group Administration

User & Group Administration User & Group Administration David Morgan Users useradd/userdel /home/ /etc/passwd is the user database /etc/shadow has passwords (relocated from passwd) /etc/group whoami su / sudo / SUID process

More information

hash Remember the full pathname of a name argument head Output the first part of file(s) history Command History hostname Print or set system name

hash Remember the full pathname of a name argument head Output the first part of file(s) history Command History hostname Print or set system name LINUX Commands alias Create an alias apropos Search Help manual pages (man -k) awk Find and Replace text, database sort/validate/index break Exit from a loop builtin Run a shell builtin bzip2 Compress

More information

Last Time. on the website

Last Time. on the website Last Time on the website Lecture 6 Shell Scripting What is a shell? The user interface to the operating system Functionality: Execute other programs Manage files Manage processes Full programming language

More information

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2 CSE Linux VM For Microsoft Windows Based on opensuse Leap 42.2 Dr. K. M. Flurchick February 2, 2017 Contents 1 Introduction 1 2 Requirements 1 3 Procedure 1 4 Usage 3 4.1 Start/Stop.................................................

More information

Lecture 02: Linux Command Line

Lecture 02: Linux Command Line BI296: Linux and Shell Programming Lecture 02: Linux Command Line Maoying,Wu ricket.woo@gmail.com Dept. of Bioinformatics & Biostatistics Shanghai Jiao Tong University Spring, 2017 Quick Recaps Decimal/Binary/Octal/Hexadecimal

More information

Files (review) and Regular Expressions. Todd Kelley CST8207 Todd Kelley 1

Files (review) and Regular Expressions. Todd Kelley CST8207 Todd Kelley 1 Files (review) and Regular Expressions Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 midterms (Feb 11 and April 1) Files and Permissions Regular Expressions 2 Sobel, Chapter 6 160_pathnames.html

More information

EECS2301. Example. Testing 3/22/2017. Linux/Unix Part 3. for SCRIPT in /path/to/scripts/dir/* do if [ -f $SCRIPT -a -x $SCRIPT ] then $SCRIPT fi done

EECS2301. Example. Testing 3/22/2017. Linux/Unix Part 3. for SCRIPT in /path/to/scripts/dir/* do if [ -f $SCRIPT -a -x $SCRIPT ] then $SCRIPT fi done Warning: These notes are not complete, it is a Skelton that will be modified/add-to in the class. If you want to us them for studying, either attend the class or get the completed notes from someone who

More information

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1 Linux Essentials Smith, Roderick W. ISBN-13: 9781118106792 Table of Contents Introduction xvii Chapter 1 Selecting an Operating System 1 What Is an OS? 1 What Is a Kernel? 1 What Else Identifies an OS?

More information

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen Introduction to Unix The Windows User perspective Wes Frisby Kyle Horne Todd Johansen What is Unix? Portable, multi-tasking, and multi-user operating system Software development environment Hardware independent

More information

System Administration

System Administration User and Group Management All processes on the system run under by a user. Users can be collected into groups which can be given common attributes Users and groups are represented by the system using unique

More information

Unix Introduction to UNIX

Unix Introduction to UNIX Unix Introduction to UNIX Get Started Introduction The UNIX operating system Set of programs that act as a link between the computer and the user. Developed in 1969 by a group of AT&T employees Various

More information

RedHat. Rh202. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs)

RedHat. Rh202. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs) RedHat Rh202 Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs) http://killexams.com/exam-detail/rh202 QUESTION: 156 Who ever creates the files/directories on /data group owner should be automatically

More information

RH-202. RedHat. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs)

RH-202. RedHat. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs) RedHat RH-202 Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs) Download Full Version : https://killexams.com/pass4sure/exam-detail/rh-202 QUESTION: 159 Install the dialog-* Questions asking

More information

List of Linux Commands in an IPm

List of Linux Commands in an IPm List of Linux Commands in an IPm Directory structure for Executables bin: ash cpio false ln mount rm tar zcat busybox date getopt login mv rmdir touch cat dd grep ls perl sed true chgrp df gunzip mkdir

More information

Presented by Bill Genske Gary Jackson

Presented by Bill Genske Gary Jackson Quintessential School Systems Session C Linux Presented by Bill Genske Gary Jackson Copyright Quintessential School Systems, 2009 All Rights Reserved 867 American Street --- Second Floor --- San Carlos,

More information

Lab 2: Linux/Unix shell

Lab 2: Linux/Unix shell Lab 2: Linux/Unix shell Comp Sci 1585 Data Structures Lab: Tools for Computer Scientists Outline 1 2 3 4 5 6 7 What is a shell? What is a shell? login is a program that logs users in to a computer. When

More information

Introduction to Linux Workshop 1

Introduction to Linux Workshop 1 Introduction to Linux Workshop 1 The George Washington University SEAS Computing Facility Created by Jason Hurlburt, Hadi Mohammadi, Marco Suarez hurlburj@gwu.edu Logging In The lab computers will authenticate

More information

A shell can be used in one of two ways:

A shell can be used in one of two ways: Shell Scripting 1 A shell can be used in one of two ways: A command interpreter, used interactively A programming language, to write shell scripts (your own custom commands) 2 If we have a set of commands

More information

Assume that username is cse. The user s home directory will be /home/cse. You may remember what the relative pathname for users home directory is: ~

Assume that username is cse. The user s home directory will be /home/cse. You may remember what the relative pathname for users home directory is: ~ Introduction to Open Source Software Development Spring semester, 2017 School of Computer Science and Engineering, Pusan National University Joon-Seok Kim LINUX: COMMANDS Review Lab #1 2 Create Directories

More information

Bashed One Too Many Times. Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009

Bashed One Too Many Times. Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009 Bashed One Too Many Times Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009 What is a Shell? The shell interprets commands and executes them It provides you with an environment

More information

Unix as a Platform Exercises + Solutions. Course Code: OS 01 UNXPLAT

Unix as a Platform Exercises + Solutions. Course Code: OS 01 UNXPLAT Unix as a Platform Exercises + Solutions Course Code: OS 01 UNXPLAT Working with Unix Most if not all of these will require some investigation in the man pages. That's the idea, to get them used to looking

More information

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers A Big Step Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Copyright 2006 2009 Stewart Weiss What a shell really does Here is the scoop on shells. A shell is a program

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Mukesh Pund Principal Scientist, NISCAIR, New Delhi, India History In 1969, a team of developers developed a new operating system called Unix which was written using C Linus Torvalds,

More information

Contents. xxvii. Preface

Contents. xxvii. Preface Preface xxvii Chapter 1: Welcome to Linux 1 The GNU Linux Connection 2 The History of GNU Linux 2 The Code Is Free 4 Have Fun! 5 The Heritage of Linux: UNIX 5 What Is So Good About Linux? 6 Why Linux Is

More information

Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX

Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX 15th Jan. 2000 / 3:55 am Part 1: Working with files and rights ------------------------------------- cp

More information

Operating Systems Lab 1 (Users, Groups, and Security)

Operating Systems Lab 1 (Users, Groups, and Security) Operating Systems Lab 1 (Users, Groups, and Security) Overview This chapter covers the most common commands related to users, groups, and security. It will also discuss topics like account creation/deletion,

More information

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

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions Welcome to getting started with Ubuntu 12.04 Server. This System Administrator Manual guide to be simple to follow, with step by step instructions with screenshots INDEX 1.Installation of Ubuntu 12.04

More information

client X11 Linux workstation

client X11 Linux workstation LPIC1 LPIC Linux: System Administrator LPIC 1 LPI command line LPIC-1 Linux LPIC-1 client X11 Linux workstation Unix GNU Linux Fundamentals Unix and its Design Principles FSF and GNU GPL - General Public

More information

ScazLab. Linux Scripting. Core Skills That Every Roboticist Must Have. Alex Litoiu Thursday, November 14, 13

ScazLab. Linux Scripting. Core Skills That Every Roboticist Must Have. Alex Litoiu Thursday, November 14, 13 Linux Scripting Core Skills That Every Roboticist Must Have Alex Litoiu alex.litoiu@yale.edu 1 Scazlab Topics Covered Linux Intro - Basic Concepts Advanced Bash Scripting - Job scheduling - File system

More information

Scripting. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

Scripting. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Scripting Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Adapted from Practical Unix and Programming Hunter College Copyright 2006 2009 Stewart Weiss What a shell

More information

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

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018 GNU/Linux 101 Casey McLaughlin Research Computing Center Spring Workshop Series 2018 rccworkshop IC;3df4mu bash-2.1~# man workshop Linux101 RCC Workshop L101 OBJECTIVES - Operating system concepts - Linux

More information

22-Sep CSCI 2132 Software Development Lecture 8: Shells, Processes, and Job Control. Faculty of Computer Science, Dalhousie University

22-Sep CSCI 2132 Software Development Lecture 8: Shells, Processes, and Job Control. Faculty of Computer Science, Dalhousie University Lecture 8 p.1 Faculty of Computer Science, Dalhousie University CSCI 2132 Software Development Lecture 8: Shells, Processes, and Job Control 22-Sep-2017 Location: Goldberg CS 127 Time: 14:35 15:25 Instructor:

More information

LING 408/508: Computational Techniques for Linguists. Lecture 5

LING 408/508: Computational Techniques for Linguists. Lecture 5 LING 408/508: Computational Techniques for Linguists Lecture 5 Last Time Installing Ubuntu 18.04 LTS on top of VirtualBox Your Homework 2: did everyone succeed? Ubuntu VirtualBox Host OS: MacOS or Windows

More information

CSCI 211 UNIX Lab. Shell Programming. Dr. Jiang Li. Jiang Li, Ph.D. Department of Computer Science

CSCI 211 UNIX Lab. Shell Programming. Dr. Jiang Li. Jiang Li, Ph.D. Department of Computer Science CSCI 211 UNIX Lab Shell Programming Dr. Jiang Li Why Shell Scripting Saves a lot of typing A shell script can run many commands at once A shell script can repeatedly run commands Help avoid mistakes Once

More information

User accounts and authorization

User accounts and authorization User accounts and authorization Authentication vs authorization Authentication: proving the identity of someone Authorization: allowing a user to access certain resources 1 Government authorization documents

More information

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University Unix/Linux Basics 1 Some basics to remember Everything is case sensitive Eg., you can have two different files of the same name but different case in the same folder Console-driven (same as terminal )

More information

Shells & Shell Programming (Part B)

Shells & Shell Programming (Part B) Shells & Shell Programming (Part B) Software Tools EECS2031 Winter 2018 Manos Papagelis Thanks to Karen Reid and Alan J Rosenthal for material in these slides CONTROL STATEMENTS 2 Control Statements Conditional

More information

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

UNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo UNIX COMMANDS AND SHELLS UNIX Programming 2015 Fall by Euiseong Seo What is a Shell? A system program that allows a user to execute Shell functions (internal commands) Other programs (external commands)

More information

INd_rasN SOME SHELL SCRIPTING PROGRAMS. 1. Write a shell script to check whether the name passed as first argument is the name of a file or directory.

INd_rasN SOME SHELL SCRIPTING PROGRAMS. 1. Write a shell script to check whether the name passed as first argument is the name of a file or directory. 1. Write a shell script to check whether the name passed as rst argument is the name of a le or directory. Ans: #!/bin/bash if [ -f $1 ] echo "$1 is a le" echo "$1 is not a le" 2. Write a shell script

More information

Assignment clarifications

Assignment clarifications Assignment clarifications How many errors to print? at most 1 per token. Interpretation of white space in { } treat as a valid extension, involving white space characters. Assignment FAQs have been updated.

More information

Shell programming. Introduction to Operating Systems

Shell programming. Introduction to Operating Systems Shell programming Introduction to Operating Systems Environment variables Predened variables $* all parameters $# number of parameters $? result of last command $$ process identier $i parameter number

More information

Essentials for Scientific Computing: Bash Shell Scripting Day 3

Essentials for Scientific Computing: Bash Shell Scripting Day 3 Essentials for Scientific Computing: Bash Shell Scripting Day 3 Ershaad Ahamed TUE-CMS, JNCASR May 2012 1 Introduction In the previous sessions, you have been using basic commands in the shell. The bash

More information

Chapter-3. Introduction to Unix: Fundamental Commands

Chapter-3. Introduction to Unix: Fundamental Commands Chapter-3 Introduction to Unix: Fundamental Commands What You Will Learn The fundamental commands of the Unix operating system. Everything told for Unix here is applicable to the Linux operating system

More information

LOG ON TO LINUX AND LOG OFF

LOG ON TO LINUX AND LOG OFF EXPNO:1A LOG ON TO LINUX AND LOG OFF AIM: To know how to logon to Linux and logoff. PROCEDURE: Logon: To logon to the Linux system, we have to enter the correct username and password details, when asked,

More information

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management Student Name: Lab Section: Linux User and Group Management 1 Due Date - Upload to Blackboard by 8:30am Monday April 2, 2012 Submit the completed lab to Blackboard following the Rules for submitting Online

More information

Exercise 1: Basic Tools

Exercise 1: Basic Tools Exercise 1: Basic Tools This exercise is created so everybody can learn the basic tools we will use during this course. It is really more like a tutorial than an exercise and, you are not required to submit

More information

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

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island Embedded Linux Systems Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island Generic Embedded Systems Structure User Sensors ADC microcontroller

More information

Unix Tools / Command Line

Unix Tools / Command Line Unix Tools / Command Line An Intro 1 Basic Commands / Utilities I expect you already know most of these: ls list directories common options: -l, -F, -a mkdir, rmdir make or remove a directory mv move/rename

More information

Shell Scripting. Todd Kelley CST8207 Todd Kelley 1

Shell Scripting. Todd Kelley CST8207 Todd Kelley 1 Shell Scripting Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 If we have a set of commands that we want to run on a regular basis, we could write a script A script acts as a Linux command,

More information

UNIX. Basic UNIX Command

UNIX. Basic UNIX Command UNIX Basic UNIX Command Command List ls mkdir mv chmod groupadd hostname kill head top compress/ uncompress pwd Cat find chown useradd id ioscan pdf sar cd more grep chgrp passwd mount dmesg netstat tar

More information

Open up a terminal, make sure you are in your home directory, and run the command.

Open up a terminal, make sure you are in your home directory, and run the command. More Linux Commands 0.1 wc The Linux command for acquiring size statistics on a file is wc. This command can provide information from line count, to bytes in a file. Open up a terminal, make sure you are

More information

for more :-

for more :- JNTU ONLINE EXAMINATIONS [Mid 1 - UNIX] 1. C programmers in the unix environment has complete access to the entire system call library as well as the a. static library functions b. dynamic library functions

More information

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

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester Linux Essentials Programming and Data Structures Lab M Tech CS First Year, First Semester Adapted from PDS Lab 2014 and 2015 Login, Logout, Password $ ssh mtc16xx@192.168.---.--- $ ssh X mtc16xx@192.168.---.---

More information

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

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical

More information

Introduction to remote command line Linux. Research Computing Team University of Birmingham

Introduction to remote command line Linux. Research Computing Team University of Birmingham Introduction to remote command line Linux Research Computing Team University of Birmingham Linux/UNIX/BSD/OSX/what? v All different v UNIX is the oldest, mostly now commercial only in large environments

More information

Shell. SSE2034: System Software Experiment 3, Fall 2018, Jinkyu Jeong

Shell. SSE2034: System Software Experiment 3, Fall 2018, Jinkyu Jeong Shell Prof. Jinkyu Jeong (Jinkyu@skku.edu) TA -- Minwoo Ahn (minwoo.ahn@csl.skku.edu) TA -- Donghyun Kim (donghyun.kim@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu

More information

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

PASS4TEST. IT Certification Guaranteed, The Easy Way!   We offer free update service for one year PASS4TEST IT Certification Guaranteed, The Easy Way! \ http://www.pass4test.com We offer free update service for one year Exam : 117-101 Title : Lpi Level 1 Exam 101(with rpm) Vendors : Lpi Version : DEMO

More information

Introduction to Linux

Introduction to Linux Introduction to Linux January 2011 Don Bahls User Consultant (Group Leader) bahls@arsc.edu (907) 450-8674 Overview The shell Common Commands File System Organization Permissions Environment Variables I/O

More information

CS/CIS 249 SP18 - Intro to Information Security

CS/CIS 249 SP18 - Intro to Information Security Lab assignment CS/CIS 249 SP18 - Intro to Information Security Lab #2 - UNIX/Linux Access Controls, version 1.2 A typed document is required for this assignment. You must type the questions and your responses

More information

NETW 110 Lab 5 Creating and Assigning Users and Groups Page 1

NETW 110 Lab 5 Creating and Assigning Users and Groups Page 1 NETW 110 Lab 5 Creating and Assigning Users and Groups Page 1 Objective At the conclusion of this lab, the student will be able to add and delete users, create and assign users to groups, and assign users

More information

Defensie Exercises preparing for the exam.

Defensie Exercises preparing for the exam. Defensie Exercises preparing for the exam. 1. Stuur de inhoud van het bestand /etc/passwd naar het bestand /tmp/gebruikers en zorg dat het bestand /tmp/gebruikers gesorteerd is in omgekeerde volgorde 2.

More information

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p. Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p. 2 Conventions Used in This Book p. 2 Introduction to UNIX p. 5 An Overview

More information

Roll No. :... Invigilator's Signature : UNIX AND SHELL PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

Roll No. :... Invigilator's Signature : UNIX AND SHELL PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 Name : Roll No. :... Invigilator's Signature :. CS/BCA/SEM-5/BCA-502/2011-12 2011 UNIX AND SHELL PROGRAMMING Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates

More information

Bash command line for Linux. adduser Add a user to the system. addgroup Add a group to the system. Create an alias

Bash command line for Linux. adduser Add a user to the system. addgroup Add a group to the system. Create an alias Bash command line for Linux. adduser Add a user to the system addgroup Add a group to the system alias Create an alias apropos Search Help manual pages (man -k) apt-get Search for and install software

More information

COMP 4/6262: Programming UNIX

COMP 4/6262: Programming UNIX COMP 4/6262: Programming UNIX Lecture 12 shells, shell programming: passing arguments, if, debug March 13, 2006 Outline shells shell programming passing arguments (KW Ch.7) exit status if (KW Ch.8) test

More information