Login
Register
All Activity
Questions
Unanswered
Tags
Users
Ask a Question
About Us
986
Questions
785
Answers
Interview Preparation mode
beta
Funny Facebook Status
Enter your email address
All categories
SQL Server Interview Questions and Answers
(197)
SSIS Interview Questions and Answers
(54)
SSRS Interview Questions and Answers
(9)
SSAS Interview Questions and Answers
(29)
.NET Interview Questions and Answers
(186)
Oracle Interview Questions and Answers
(122)
Java Interview Questions and Answers
(32)
UNIX Interview Questions and Answers
(47)
Networking Interview Questions and Answers
(17)
MySQL Interview Questions and Answers
(30)
HR Interview Questions and Answers
(237)
General Interview Questions and Answers
(9)
Other Interview Questions and Answers
(8)
Job Openings
(3)
Greenplum Database Interview Questions and Answers
(5)
Explain about Pipes in UNIX?
Nice?
Vote!
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
pipes
1 Answer
Nice?
Vote!
To see who is on the system with you, type
% who
One method to get a sorted list of names is to type,
% who > names.txt
% sort < names.txt
This is a bit slow and you have to remember to remove the temporary file called names when you have finished. What you really want to do is connect the output of the who command directly to the input of the sort command. This is exactly what pipes do. The symbol for a pipe is the vertical bar |
For example, typing
% who | sort
will give the same result as above, but quicker and cleaner.
To find out how many users are logged on, type
% who | wc -l
Exercise 3b
a2ps -Phockney textfile is the command to print a postscript file to the printer hockney.
Using pipes, print all lines of list1 and list2 containing the letter 'p', sort the result, and print to the printer hockney.
answered
1 year
ago
by
R
(
19,530
points)
Related questions
Nice?
Vote!
1
answer
Explain about Killing a process in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
kill
process
Nice?
Vote!
1
answer
Explain about Listing suspended and background processes in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
file
process
Nice?
Vote!
1
answer
Explain about Processes and Jobs in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
file
process
job
Nice?
Vote!
1
answer
Explain about Changing access rights in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
file
security
Nice?
Vote!
1
answer
Explain about File system security (access rights) in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
file
security