Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7802053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:08:34+00:00 2026-06-02T01:08:34+00:00

I recently came across a shell command that looked like this: > outfile <

  • 0

I recently came across a shell command that looked like this: “> outfile < infile cat”, which appears to be functionally equivalent to “cat infile > outfile”. For that matter, the general form seems to be “> outfile < infile command arg1 … argN” becomes “command arg1 … argN infile > outfile”.

Anyway, I was wondering if anyone could elaborate on how the leading “>” achieves this effect, and if there are any practical uses for it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:08:36+00:00Added an answer on June 2, 2026 at 1:08 am

    The “Bash Reference Manual” says the following about the redirection operators:

    The following redirection operators may precede or appear anywhere within a simple command or may follow a command.

    So the following commands are all equivalent:

    ls -al > listing.txt
    > listing.txt ls -al
    ls > listing.txt -al
    

    Though I’d guess that the first is most common form.

    Note that the relative order of redirections is significant, so if you’re redirecting one file descriptor to another, for example, the following would be different:

    ls > listing.txt 2>&1   # both stdout and stderr go in to listing.txt
    
    ls 2>&1 > listing.txt   # only stdout goes to listing.txt, because stderr was made
                            #    a copy of stdout before the redirection of stdout
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently came across this blog post which basically says that we should not
I recently came across some code that looks something like this: <head> <?php /*
I recently came across some code that looked like: if(sizeof(var,2) == 4) { ...
I recently came across the pandas library for python, which according to this benchmark
I recently came across this website: http://studiostyles.info , which contains a list of color
I recently came across some functions where you can pass multiple enums like this:
I recently came across this blog post Yet another post about gamma correction which
I recently came across this interview question (posted in a forum somehwere... looks like
I recently came across an IE7 only bug that I thought I'd share so
I recently came across a ASP 1.1 web application that put a whole heap

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.