SlideShare a Scribd company logo
UOP POS 433 Week 4 File Processing Commands
Worksheet NEW
http://www.assignmentcloud.com/pos-433-
uop/pos-433-week-4-file-processing-
commands-worksheet-new
For more classes visit
http://www.assignmentcloud.com
1. How do you know how many number of users
currently logged into the system? (Not considering
if any user is logged more than one time) (1)
A. who | uniq | sort | wc -l
B. who | cut -d' ' –f1 | uniq | wc -l
C. who | sort | uniq | wc -l
D. who | cut -d' ' –f1 | sort -u | wc -l
E. who | cut -d' ' –f1 | uniq -d | wc -l
Ans:
2. Create a file “employees.txt” using vi editor or
pico.
(The file will have 6 fields, ID, Name, Designation,
Dept, D.O.B, Salary separated by pipe)
Enter these lines in the file and save it.
2133|charles smith |Manager|sales|12/12/56|
90000
9576|Rob Thomson|director |production|
03/12/50|130000
5778|David Blake |General Manager|marketing |
04/19/43| 85000
2765|Rick Martin|director|personnel |05/11/47|
120000
(Use cut command for the following questions A,B)
(in each one mark, ½ is for the command and ½
for the output)
A. Display the person's name, his designation and
salary in the above file.
Show the command and output
Ans:
B: Display first 20 characters on each line in the
above file.
Show the command and output
Ans:
3. How do you display the hour and minute from
date command using cut utility (1)
Show the command and output
( ½ is for the command and ½ for the output)
Ans:
4. What is the difference between the following
commands? (1)
$ who | grep 'mary'
and
$ who | grep '^mary'
Ans:
5. We know that all user information is stored
in /etc/passwd where fields are delimited by a
colon. Display only their userids using cut
command. (userid is the first field in /etc/passwd
file) Show only top 10 userids. (1)
Show the command and output
( ½ is for the command and ½ for the output)
Ans:
6. Create the following four files chapter1,
chapter2, chapter3, chapter4 in your current
directory and enter the following text:
Chapter1 :
This is the first line in this file
This chapter deals with the basic information of a
UNIX system.
Chapter2 :
This is the first line in this file
This chapter deals with Unix System info and shell
introduction.
Chapter3 :
This is the first line in this File System
This chapter deals with various Unix Systems.
Chapter4 :
This is the first line in this file
This chapter deals with kernel system.
The question is to search for a string "System" or
"system" in the above files. Use wild cards in both
pattern and file searching. (1)
Show the command and output
( ½ is for the command and ½ for the output)
Ans:
7. Show these commands and output:
A. Redirect man pages of ‘find’ command to a file
called, find_manpages in /tmp directory.
B. Display lines not having the word “version” in
the above file.(1)
(½ is for the command and ½ for the output)
Ans:
8. Which command of the following is correct ?
(Some may work but does not make sense). (1)
a. cat file file> file3 | wc -l
b. cut -d ":" filename
c. ls -l | grepunixmyfile
d. head filename | tail
e. find name "myfile.txt" -print
9. We know that ls -l command shows all the files
in the current directory. How do you display only
the directories, not files in the current directory.
(You have to use ls command, but not find
command) (1)
Ans:
10. How do you set only read permissions to user,
group and others in octal mode for a file
"myfile.txt" ? (1)
Ans:
11. You observed that some of your group
members are fiddling with your file "myfile" and
you wanted to remove the read permission to your
group. How do you do? (1)
Ans:
12. Here is the long listing of a file.
-rw-rw-rw- 2 Y435678 odms 22 Sep 02 12:03
myfile.txt
Is the above a file or a directory? To which group
does it belong? (1)
Regular file, Y435678
file, Y435678
file, odms
directory, odms
directory, Y435678
Ans :
13. Here is another long listing of a file. (1)
-rw-r----- 1 Y435678 odms 20 Sep 02 17:03 file.txt.
What are the owner permissions?
read, execute
read, write
write, execute
all since s/he is the owner
Ans:
14. The file users_data has the following contents :
(1)
Tom Smith 7.00 15 105.00
Rob Sheryl 8.00 20 160.00
Ken Bradman 7.00 13 91.00
Peter Smith 6.00 15 90.00
Dennis Smith 8.00 13 104.00
Tom Dave 9.00 12 108.00
How do you sort the above file and redirect the
output to another file called sortedusers
Ans :
15. How do you list only duplicate lines in a file
"myfile" (1)
Ans :

More Related Content

PPT
101 4.7 find system files and place files in the correct location
PPT
101 2.3 manage shared libraries
PPTX
File system node js
PPT
PPTX
Directory Commands - R.D.Sivakumar
PDF
Linux course fhs file hierarchy standard
PPT
4.6 create and change hard and symbolic links v2
DOCX
Linux midterm quiz
101 4.7 find system files and place files in the correct location
101 2.3 manage shared libraries
File system node js
Directory Commands - R.D.Sivakumar
Linux course fhs file hierarchy standard
4.6 create and change hard and symbolic links v2
Linux midterm quiz

What's hot (18)

PPTX
Data file operations in C++ Base
PDF
Unix files
PPT
Lpi lição 01 exam 101 objectives
PPTX
File Commands - R.D.Sivakumar
PDF
اسلاید دوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
PPTX
Commands and shell programming (3)
PPTX
Data Structures used in Linux kernel
PPT
Unix file systems 2 in unix internal systems
PDF
Unix commands in etl testing
PPT
101 4.6 create and change hard and symbolic links
ODP
File system hiearchy
PPTX
System calls operating system ppt by rohit malav
PPTX
Operating Systems - File Management
PPT
Chapter 10 - File System Interface
PPT
Unix Basics 04sp
PDF
Course 102: Lecture 2: Unwrapping Linux
PDF
Linux Directory Structure
Data file operations in C++ Base
Unix files
Lpi lição 01 exam 101 objectives
File Commands - R.D.Sivakumar
اسلاید دوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
Commands and shell programming (3)
Data Structures used in Linux kernel
Unix file systems 2 in unix internal systems
Unix commands in etl testing
101 4.6 create and change hard and symbolic links
File system hiearchy
System calls operating system ppt by rohit malav
Operating Systems - File Management
Chapter 10 - File System Interface
Unix Basics 04sp
Course 102: Lecture 2: Unwrapping Linux
Linux Directory Structure
Ad

Similar to Uop pos 433 week 4 file processing commands worksheet new (20)

DOCX
Introduction to Unix - POS420Unix Lab Exercise Week 3 ATopics.docx
PDF
Unix for Librarians
PPSX
Unix environment [autosaved]
PDF
AOS Lab 1: Hello, Linux!
PPTX
Unix training session 1
DOCX
Linux admin interview questions
PPT
Basic Linux day 1
PPT
Linux day 1
PPT
Unix(introduction)
PDF
Linux Notes-1.pdf
DOCX
Qbjective question linux
DOCX
lec1.docx
PPTX
Linux powerpoint
PPTX
Unix
PDF
Module 02 Using Linux Command Shell
PPS
QSpiders - Unix Operating Systems and Commands
PDF
POS 433 Effective Communication - tutorialrank.com
DOC
Foss manual (1)
DOCX
2. Assume that you are hired as the Network Administrator for a smal.docx
PDF
Unix command line concepts
Introduction to Unix - POS420Unix Lab Exercise Week 3 ATopics.docx
Unix for Librarians
Unix environment [autosaved]
AOS Lab 1: Hello, Linux!
Unix training session 1
Linux admin interview questions
Basic Linux day 1
Linux day 1
Unix(introduction)
Linux Notes-1.pdf
Qbjective question linux
lec1.docx
Linux powerpoint
Unix
Module 02 Using Linux Command Shell
QSpiders - Unix Operating Systems and Commands
POS 433 Effective Communication - tutorialrank.com
Foss manual (1)
2. Assume that you are hired as the Network Administrator for a smal.docx
Unix command line concepts
Ad

More from ElijahEthaan (20)

DOC
Stayer cis 413 week 10 assignment 2
DOC
Stayer cis 401 week 7 assignment 2
DOC
Stayer cis 401 week 3 assignment 1
DOC
Stayer cis 356 week 10 term paper
DOC
Stayer cis 356 week 6 assignment 2
DOC
Stayer cis 356 week 3 assignment 1
DOC
Chamberlain college of nursing nr 351 week 6 assignment professional paper in...
DOC
Uop law 421 final guide new
DOC
Uop psy 315 week 4 practice problem worksheet
DOC
Uop gsp 125 final exam guide new
DOC
Uop hrm 326 final exam guide
DOC
Gcu hlt 205
DOC
Gcu hlt 205 week 6 assignment benchmark assignment
DOC
Devry sbe 330 week 4 course project
DOC
Hwe 200 week 5 final project physical wellness new
DOC
Uop pos 433 week 3 linux
DOC
Uop pos 433 week 2 linux
DOC
Strayer cis 558 week 10 term paper managing an it infrastructure audit
DOC
Strayer cis 558 week 4 case study 1 mitigating cloud computing risks
DOC
Strayer cis 558 week 3 assignment 1 erm roadmap
Stayer cis 413 week 10 assignment 2
Stayer cis 401 week 7 assignment 2
Stayer cis 401 week 3 assignment 1
Stayer cis 356 week 10 term paper
Stayer cis 356 week 6 assignment 2
Stayer cis 356 week 3 assignment 1
Chamberlain college of nursing nr 351 week 6 assignment professional paper in...
Uop law 421 final guide new
Uop psy 315 week 4 practice problem worksheet
Uop gsp 125 final exam guide new
Uop hrm 326 final exam guide
Gcu hlt 205
Gcu hlt 205 week 6 assignment benchmark assignment
Devry sbe 330 week 4 course project
Hwe 200 week 5 final project physical wellness new
Uop pos 433 week 3 linux
Uop pos 433 week 2 linux
Strayer cis 558 week 10 term paper managing an it infrastructure audit
Strayer cis 558 week 4 case study 1 mitigating cloud computing risks
Strayer cis 558 week 3 assignment 1 erm roadmap

Recently uploaded (20)

PDF
Anesthesia in Laparoscopic Surgery in India
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Lesson notes of climatology university.
PPTX
Cell Types and Its function , kingdom of life
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
master seminar digital applications in india
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
RMMM.pdf make it easy to upload and study
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Anesthesia in Laparoscopic Surgery in India
A systematic review of self-coping strategies used by university students to ...
VCE English Exam - Section C Student Revision Booklet
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Microbial disease of the cardiovascular and lymphatic systems
Complications of Minimal Access Surgery at WLH
Lesson notes of climatology university.
Cell Types and Its function , kingdom of life
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Final Presentation General Medicine 03-08-2024.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
master seminar digital applications in india
Module 4: Burden of Disease Tutorial Slides S2 2025
102 student loan defaulters named and shamed – Is someone you know on the list?
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
human mycosis Human fungal infections are called human mycosis..pptx
RMMM.pdf make it easy to upload and study
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3

Uop pos 433 week 4 file processing commands worksheet new

  • 1. UOP POS 433 Week 4 File Processing Commands Worksheet NEW http://www.assignmentcloud.com/pos-433- uop/pos-433-week-4-file-processing- commands-worksheet-new For more classes visit http://www.assignmentcloud.com 1. How do you know how many number of users currently logged into the system? (Not considering if any user is logged more than one time) (1) A. who | uniq | sort | wc -l B. who | cut -d' ' –f1 | uniq | wc -l C. who | sort | uniq | wc -l D. who | cut -d' ' –f1 | sort -u | wc -l E. who | cut -d' ' –f1 | uniq -d | wc -l Ans: 2. Create a file “employees.txt” using vi editor or pico. (The file will have 6 fields, ID, Name, Designation, Dept, D.O.B, Salary separated by pipe) Enter these lines in the file and save it. 2133|charles smith |Manager|sales|12/12/56| 90000 9576|Rob Thomson|director |production|
  • 2. 03/12/50|130000 5778|David Blake |General Manager|marketing | 04/19/43| 85000 2765|Rick Martin|director|personnel |05/11/47| 120000 (Use cut command for the following questions A,B) (in each one mark, ½ is for the command and ½ for the output) A. Display the person's name, his designation and salary in the above file. Show the command and output Ans: B: Display first 20 characters on each line in the above file. Show the command and output Ans: 3. How do you display the hour and minute from date command using cut utility (1) Show the command and output ( ½ is for the command and ½ for the output) Ans: 4. What is the difference between the following commands? (1) $ who | grep 'mary'
  • 3. and $ who | grep '^mary' Ans: 5. We know that all user information is stored in /etc/passwd where fields are delimited by a colon. Display only their userids using cut command. (userid is the first field in /etc/passwd file) Show only top 10 userids. (1) Show the command and output ( ½ is for the command and ½ for the output) Ans: 6. Create the following four files chapter1, chapter2, chapter3, chapter4 in your current directory and enter the following text: Chapter1 : This is the first line in this file This chapter deals with the basic information of a UNIX system. Chapter2 : This is the first line in this file This chapter deals with Unix System info and shell introduction. Chapter3 : This is the first line in this File System This chapter deals with various Unix Systems.
  • 4. Chapter4 : This is the first line in this file This chapter deals with kernel system. The question is to search for a string "System" or "system" in the above files. Use wild cards in both pattern and file searching. (1) Show the command and output ( ½ is for the command and ½ for the output) Ans: 7. Show these commands and output: A. Redirect man pages of ‘find’ command to a file called, find_manpages in /tmp directory. B. Display lines not having the word “version” in the above file.(1) (½ is for the command and ½ for the output) Ans: 8. Which command of the following is correct ? (Some may work but does not make sense). (1) a. cat file file> file3 | wc -l b. cut -d ":" filename c. ls -l | grepunixmyfile d. head filename | tail e. find name "myfile.txt" -print 9. We know that ls -l command shows all the files in the current directory. How do you display only
  • 5. the directories, not files in the current directory. (You have to use ls command, but not find command) (1) Ans: 10. How do you set only read permissions to user, group and others in octal mode for a file "myfile.txt" ? (1) Ans: 11. You observed that some of your group members are fiddling with your file "myfile" and you wanted to remove the read permission to your group. How do you do? (1) Ans: 12. Here is the long listing of a file. -rw-rw-rw- 2 Y435678 odms 22 Sep 02 12:03 myfile.txt Is the above a file or a directory? To which group does it belong? (1) Regular file, Y435678 file, Y435678 file, odms directory, odms
  • 6. directory, Y435678 Ans : 13. Here is another long listing of a file. (1) -rw-r----- 1 Y435678 odms 20 Sep 02 17:03 file.txt. What are the owner permissions? read, execute read, write write, execute all since s/he is the owner Ans: 14. The file users_data has the following contents : (1) Tom Smith 7.00 15 105.00 Rob Sheryl 8.00 20 160.00 Ken Bradman 7.00 13 91.00 Peter Smith 6.00 15 90.00 Dennis Smith 8.00 13 104.00 Tom Dave 9.00 12 108.00 How do you sort the above file and redirect the output to another file called sortedusers Ans : 15. How do you list only duplicate lines in a file