thunar ./hello.txt >/dev/null 2>&1 &
The >/dev/null sends stdout to nowhere while the 2>&1 send stderr to stdout
thunar ./hello.txt >/dev/null 2>&1 &
The >/dev/null sends stdout to nowhere while the 2>&1 send stderr to stdout
Yes — make a shell function/alias so you never retype it:
# in ~/.bashrc (or ~/.zshrc)
runbg() { "$@" >/dev/null 2>&1 & disown; }
alias tb='runbg thunar'
Then tb ./hello.txt launches Thunar in the background with all output silenced.
What's happening:
>/dev/null throws away stdout2>&1 redirects stderr to the same place& backgrounds itdisown removes it from the job table, so it survives closing the terminal (with plain &, closing the terminal can kill the app via SIGHUP)Tip: if you only want to see errors but not chatter, use >/dev/null without the 2>&1 part. And for apps that print to the journal instead, journalctl --user -f shows their logs after the fact.
all 3 comments