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 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