How to redirect and pipe in Fish

  • Redirection of stdin and stdout works just like in Bash:
$ ./a.out > out.txt
$ ./a.out < in.txt
  • Stdout can be piped just like in Bash:
$ ./a.out | less
  • Stderr can be redirected as:
$ ./a.out ^ out.txt
  • Stderr can be piped as:
$ ./a.out ^| less
  • To redirect both stdout and stderr:
$ ./a.out 2>&1 out.txt
  • To pipe both stdout and stderr:
$ ./a.out 2>&1 | less

Tried with: Fish 2.0.0 and Ubuntu 14.04

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s