UNIX ASSIGNMENT 1 TYBCA (Sem:V)

Similar documents
QUESTION BANK ON UNIX & SHELL PROGRAMMING-502 (CORE PAPER-2)

Introduction to the UNIX command line

Set 1 MCQ Which command is used to sort the lines of data in a file in reverse order A) sort B) sh C) st D) sort -r

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

Basic Unix Command. It is used to see the manual of the various command. It helps in selecting the correct options

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

M.C.A. (Sem.-lll) (CBCS) Examination November CCA-3003 Operating System and LinuxlUnix programming

Name: Tej. D. Shah Subject:CC-304 Linux Uni. Practical programme College :L.J. College Of Computer Application. Questions:

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.

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

Files

Lab Working with Linux Command Line

Linux & Shell Programming 2014

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

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

Basic UNIX Commands BASIC UNIX COMMANDS. 1. cat command. This command is used to create a file in unix. Syntax: $ cat filename

CS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 1

Linux Shell Script. J. K. Mandal

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

Unix Introduction to UNIX

Std: XI CHAPTER-3 LINUX

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

d. Permissions 600 on directory dir and 300 on file dir/foo. c. Permissions 700 on directory dir and 200 on file dir/foo.

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

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

Getting your department account

2) clear :- It clears the terminal screen. Syntax :- clear

Multiple Choice - 58 Questions - 10 of 15%

5/8/2012. Creating and Changing Directories Chapter 7

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Introduction to Linux Part 1. Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017

Useful Unix Commands Cheat Sheet

Part 1: Basic Commands/U3li3es

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

CSCI 2132 Software Development. Lecture 4: Files and Directories

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

Basic UNIX Commands BASIC UNIX COMMANDS. 1. cat command. This command is used to create a file in unix. Syntax: $ cat filename

Introduction to Linux

Linux & Shell Programming 2014

A Brief Introduction to the Linux Shell for Data Science

Week 2 Lecture 3. Unix

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages

CENG 334 Computer Networks. Laboratory I Linux Tutorial

LOG ON TO LINUX AND LOG OFF

WRITE COMMANDS USING sed or grep (1 mark each) 2014 oct./nov march/april Commands using grep or egrep. (1 mark each)

Chapter-3. Introduction to Unix: Fundamental Commands

UNIX Essentials Featuring Solaris 10 Op System

Introduction: What is Unix?

IBM AIX Basic Operations V5.

Introduction to Linux

5/20/2007. Touring Essential Programs

A Brief Introduction to Unix

Introduction to the Linux Command Line

5/8/2012. Exploring Utilities Chapter 5

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.

Outline. Structure of a UNIX command

Appendix B WORKSHOP. SYS-ED/ Computer Education Techniques, Inc.

Introduction to Linux Environment. Yun-Wen Chen

Introduction to Linux

CSCI 2132 Software Development. Lecture 5: File Permissions

CS4350 Unix Programming. Outline

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

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

Mills HPC Tutorial Series. Linux Basics I

Course 144 Supplementary Materials. UNIX Fundamentals

CISC 220 fall 2011, set 1: Linux basics

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

Practical Session 0 Introduction to Linux

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

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

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

ADVANCED LINUX SYSTEM ADMINISTRATION

Introduction to Unix: Fundamental Commands

CHAPTER 1 UNIX FOR NONPROGRAMMERS

for more :-

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

Lecture # 2 Introduction to UNIX (Part 2)

CSC209H Lecture 1. Dan Zingaro. January 7, 2015

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

Linux/Cygwin Practice Computer Architecture

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

The Directory Structure

(7) Get the total energy from the output (1 Hartree = kcal/mol) and label the structure with the energy.

AN INTRODUCTION TO UNIX

Files and Directories

SIEMENS UserAdmin Workshop TELEPERM XP Version 4 Chapter 1

Linux Training. for New Users of Cluster. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala

Introduction of Linux

File Commands. Objectives

Introduction to UNIX command-line

Introduction to UNIX command-line II

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Welcome to Linux. Lecture 1.1

Chapter 1. Getting started with UNIX

The Unix Shell & Shell Scripts

The Unix Shell. Pipes and Filters

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

Common UNIX Utilities Alphabetical List

Transcription:

UNIX ASSIGNMENT 1 TYBCA (Sem:V) Given Date: 06-08-2015 1. Explain the difference between the following thru example ln & paste tee & (pipeline) 2. What is the difference between the following commands a) wc lw < file1 b) wc lw file c) cat < file1 > file2 d) cat > file2 < file1 e) cat file2 > file1 f) cat file2 - > file1 3. What is the effect of the following commands? Where should these commands to be stored? a. set nu b. set showmode c. set ai d. set eb e. set ic 4. How will you perform the following deletions in vi? i) Character at cursor ii) One word from current cursor position iii) Current line iv) Next 4 lines v) Line to the left of the cursor vi) Line to the left of the cursor vii) Line to the right of the cursor b) What is the difference between the following vi commands i) :w ii) :q! iii) :wq iv) :zz v) :x 5. Which commands in vi would you use to perform the following operations? - Block copy

- Block move - Block delete 6. Construct pipelines to carry out the following jobs for the following options a. List all files whose names begins with a and also store them in a file called file1. b. Output of who should be stored and displayed on the screen along with the total number of users. The same output except the number of users should also be stored in a file called file1 c. Merge the contents of the files a.txt, b.txt and c.txt, sort them and display the sorted output on the screen page by page. d. Display only the owner of all the files which are existing in the current directory. 7. What will be the output of following command? a = * echo $a echo "$a" 8 How does the following command works (ls-l; who) > lsfile 9. How will you copy a file bca1.txt which is present in current directory to directory exam in parent directory? 10. What is the output of following statement? (1) Set who am i echo $.* (2)Set "who am i" echo $* (3) Set 'who am i ' echo $*. 11. What is the difference between commands? (a) cat < file1 > file2 (b) cat > file2 < file1 12. What does chmod 615 bca.txt commands does? 13. What command ls A do? 14. Create a file called which contains sample data as E0001 rajesh semp 78 E0002 Usha semr 96 The above file contains rollno, subjname, name create above files having at least 10 records Answer the following: a. Display the contents of the file sorted according to marks in descending order b. Display the names of students in alphabetical order ignoring the case c. display the student who have scored marks between 50 and 80 d. display the list of students and thier roll no e. sort the field according to field 3 and dump into file x.txt 15 create an file emp and answer the question

Above files have empno,name,dept,salary e0001:manish:mktg:5000 e0002 :Brijesh:acct:7000 Add 10 records for above file a. sort the file on employee department and display the name of the employee and department b. List the employees who earn between 4000 and 8000 c. sort the file on employee name in reverse order and extract their empno and name d. list the duplicate records and dump into a file bb1.txt e. sort the files on employee no and display basic and names of non duplicate lines 16 Display the permissions of the group for the files whose names begin with "a" 17 List the names of the files according to their last access time along with creation date and time/ 18 what is the command to be given if we want to display the entire text of file into upper case? 19 Find the output of the following commands (a) expr 10 % -4 (b) expr xyz123q : '.*' (c) echo "Files:" 'ls' # ls is enclosed within back quotes (d) ls[?0-9]?[a-z]* (e) ls -l grep '^d' wc - l (f) expr "abcdefg" : '.*(..\)' (g) echo ${x}x Assume that x is having value 12 20 Write a command to perform following task a. To delete all files whose 1 st character is digit b. To display content of the file available in variable X c. To delete a file name as x*y d. To delete 3 consecutive lines from the current line of a file open in vi editor e. To display only those line whose line shave only capital alphabets f. To copy file x1 into x2 do not make use of cp command g. To display number of lines in file do not use wc command h. To display lines that start and end with a STRING OS i. To send a message to terminal tty1 using echo command j. To display all files in the parent directory from wroking directory k. To display contents of top 3 largest file in current directory l. Match all filenames not beginning with a dot(.) m. To delete all special character from the file x1 21 Write a command to list all files in current directory whose second character is digit 22 Write UNIX command to obtain the count of user logged into system 23 How would you identity whether a given file is an executable file or not without executing it? 24 How will you copy a file "aaa.c" present in current directory to directory "ddd" present in parent directory?

25 create a file and then all permission to the owner and remove all permission from other. 26 How will you forcibly remove a file to which you don't have write permission? 27 What will be the output of following statements? Statement: set shadow of ignorance echo "$*" echo "$@" 28 what is the difference between the commands? wc - l < file1 wc -l file1 29 what will be the output of the following statements? Statement: Set only God is in position to look down upon someone echo $10 $11 $* 30 Search all lines in file which end with a semicolon 31 Select lines 3 through 13 of a file 32 write a command to count no of blank lines in a file 33 What is the output of the following Unix commands (1) n = "ask me" echo $n echo "$n" echo '$n' (2) a = b b = c d =c echo $$b echo $$$d 34 What will be the output of the following (1) z = 'expr -2% 7' echo $z (2) z = 'expr 5% 2' echo $z 35 which command is useful in VI editor to combine two consecutive lines into single 36 what happen when cd command is run without argument 37 what is the importance of /tmp directory 38 what does /etc/passed contains 39 what are the requirements to remove a directory successfully 40 what will happened for the command cat X1 > X2 when file x1 exists but do not have read permission? 41 Write a command to count no of characters in first five lines of file x1 42 Display files of current directory whose 1 st character is not digit 43 What does following command do a. cat x1 > x2 2 > &1 b. nice 5 x1 c. chmod go=x x1 d. ls [^a-z]

e. cd? 44 how will you return back to your home directory without using home directory name as an argument to that command 45 list the two ways of knowing your shell 46 which command display attributes to file 47 what does directory entry store 48 While rename a file which permissions a file must have 49 What is the purpose of /etc and /bin directory in UNIX 50 Write commands of vi to scroll half a screen 51 Write a command of vi for not to display numbers before Lines. 52 Which command is used to change the file timestamp? 53 Write the appropriate command for following (1) To copy x**y file in a parent directory (2) To display content of file x1 on terminal as well as in file name y1 (3) To display calendar of current year (4) To open last modified file for editing purpose (5) To display all filename having last character as digit 54 which command is used in VI editor to insert blank line before the current line and after the current line 55 write the command for following a. To remove a file name as -x ( i.e character followed by x) b. To display command lines in file x1 and x2 c. To display last 10 line of file x1 d. To display no of login users e. To divide file x1 into 3 files each contains 20 lines f. To create a 0 byte file name y1 in your current directory 56 What is the difference between following Command a. (cd dirl, pwd) b. { cd dirl; pwd;} 57 Write a command to display all filename containing only digits in a filenme 58 Which are the two ways to delete a current line in vi 59 Write Unix command which is similar to Ms DOS command of del *.*/p 60 Write a vi editor command to move two lines from the beginning of a line to the end. 61 Write the appropriate Commands for following (i)display no of words and lines of files whose file name start with x (ii) Replace word mkics with MKICS between 7 th to 12 th lines including both (iii) Remove all leading space from file a1 (iv) Display only regular files of working directory (v) Move file of current directory beginning with x to /usr/bca01 (vi) Display lines 10 to 15 th line from file x1 62 What will happen for the commandcat X1 > x2 when file x2 exits and when file x2 does not exits

63 Which permission of working directory is necessary for executing rmdir command successfully? 64 What is the size of newly created directory in your working directory? 65 Write a command to display file name in working directory having first and last character must be alphabet. 66 Write a command to list users logged in more than once 67 Write a command to display filename having length greater than or equal to 25 character. 68 Write a command to display system process. 69 Change the modification time of file x to June 30 10.30 am 70 display the files that have been modified in less than 2 days 71 display all the files in current directory where the first character is numeric and last character is not numeric. 72 Extract the names of the user from /etc passwd after ignoring the first entries. 73 Find out the number of times the character? occurs in a file 74 What does the following commands does a. Head n 5 file.txt tee file1.out b. ls *. [!co] 75 write a command which is similar to MS DOS command del*.*/p 76 how you can copy a file while preserving the attributes? 77 write a command to move all files beginning with digit from parent directory to current directory 78 write a vi command to move two lines from the beginning of a file to the end of file 79 Give 4 Operation which we can use Uniquley with directories only 80 What are the three stamp maintained in the indoe and how do you display two of them for the file abc.txt 81 In which shell variable the current shell process id contained 82 What is the purpose of export command? 83 List the default fine as well as directory permission when masking has been set by the command as umask 333 84 Differentiate between rm r dir1 and rmdir dir1 command 85 Display all the files of current directory whose ist character is not a special character 86 Count the frequency of users who are logged in from more than 1 terminal 87 Select those files that contain only digits 88 Count frequency of each word in text file 89 In vi how to do following things a. Copies all lines from current line to end of line b. Repeat last editing instruction 90 what is the difference between scheduling processing using batch command and using at command? 91 Display content of last modified file 92 display attributes of directory dir1 present in current directory search in current directory downwars all files which have more than 5 links 92 which command to use to split existing window in vi editor in two separate window?

93 create empty file in /usr/dir1 directory from current directory 94 Write a command to display total number of words and lines of files for which file name starts with m 95 Write a command to display decimal number 192 to hexadecimal 96 Write a command to display unique words of file f1 97 which attribute change when you copy a file from another user 98 Write the command for the following a. Forcefully delete each file from directory tybca/mywork b. Show all hidden file from mydir/tybca c. Sort filename by last accesstime from directory tybca/mywork d. Rename file chap1 to unit1 e. Find out number of lines of file chap01 f. Find out the node no of file chap01 g. To print first 3 lines of file tybca h. To print field no 1 to 6 from file tybca i. To print unique line of tybca j. To print frequency of each line from tile tybca k. To find the file having size grater than 50