0% found this document useful (0 votes)
93 views1 page

OS UNIX Exercises-4 v1.0

The document provides a set of practice problems focused on advanced UNIX skills including writing shell scripts to log user logins and logouts, compare and synchronize directories, filter filenames by length, and use awk to find lines within a specific character length and calculate the total size of files owned by a user. It also includes questions testing knowledge of while loops and manipulating variables in shell scripts.

Uploaded by

Deepak Kr Singh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views1 page

OS UNIX Exercises-4 v1.0

The document provides a set of practice problems focused on advanced UNIX skills including writing shell scripts to log user logins and logouts, compare and synchronize directories, filter filenames by length, and use awk to find lines within a specific character length and calculate the total size of files owned by a user. It also includes questions testing knowledge of while loops and manipulating variables in shell scripts.

Uploaded by

Deepak Kr Singh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Course: Core Skills Module: Problem Solving Topic: UNIX - Advanced Associate Supporting Materials Practice Set 1. 2. 3. $. (. -. /. *. 2.

Explain whether these while loops will run: (i) while [5] (ii) while [x$1 != x] If x has a value 10, what is the value of (i) x$x$ (ii) $x$x ? Write a shell s ript that he !s an" reports on who lo#s in an" who lo#s out. Write a s ript that o%pares two "ire tories ar1 an" ar2 (supplie" as ar#u%ents) an" opies or overwrites to &ar1 fro% ar2 ever' file that is either not present in &ar1 or is newer than its na%esa!e in &ar1. )ou are %ovin# files to a han"hel" whi h a epts onl' *+3 t'pe filena%es. ,ro"u e a list of those files in 'our urrent "ire tor' that fail in this test. .ispla' the pro esses in the s'ste% ever' 30 se on"s five ti%es usin# a (i) while loop, (ii)for loop . ,rint onl' the o""0nu%&ere" lines of a file. 1se awk to lo ate lines lon#er than 100 an" s%aller than 1(0 hara ters. Write a shell s ript that uses awk to fin" the total si3e of all or"inar' files owne" &' a user, whose na%e is spe ifie" as ar#u%ent.

e!erences: "ooks: 1. UNIX Concepts & Applications, Sumitabha Das

You might also like