'How do I pipe `file` after `which` in unix-like os

$which python
/usr/bin/python
$file /usr/bin/python
/usr/bin/python: Mach-O universal binary with 2 architectures ...

I tried to use which python | file but it won't work.



Solution 1:[1]

There are more than one way to do this. Off the top of my head here are a couple:

  1. file $(which python)
  2. which python | xargs file

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 WeyHan Ng