Skip to main content
2 of 4
Typo...
Stephen Kitt
  • 482.8k
  • 60
  • 1.2k
  • 1.4k

xsel’s behaviour depends on whether its input or output is connected to a terminal, so redirecting to and from files does the right thing. As mentioned by codeforester, the solution in your case is to run

xsel -b > file 
Stephen Kitt
  • 482.8k
  • 60
  • 1.2k
  • 1.4k