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 Redirecting the Input in UNIX
Nice?
Vote!
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
redirection
1 Answer
Nice?
Vote!
We use the < symbol to redirect the input of a command.
The command sort alphabetically or numerically sorts a list. Type
% sort
Then type in the names of some vegetables. Press [Return] after each one.
carrot
beetroot
artichoke
^D (control d to stop)
The output will be
artichoke
beetroot
carrot
Using < you can redirect the input to come from a file rather than the keyboard. For example, to sort the list of fruit, type
% sort < biglist
and the sorted list will be output to the screen.
To output the sorted list to a file, type,
% sort < biglist > slist
Use cat to read the contents of the file slist
answered
1 year
ago
by
siva
(
10,720
points)
Related questions
Nice?
Vote!
1
answer
Explain about Redirecting the Output in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
redirection
Nice?
Vote!
1
answer
Explain about Redirection in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
redirection
Nice?
Vote!
1
answer
Explain about Searching the contents of a file in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
file
directory
Nice?
Vote!
1
answer
Explain about Displaying the contents of a file on the screen in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
file
directory
Nice?
Vote!
1
answer
Explain about Pipes in UNIX?
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
pipes