Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From the terminal, I like launching my standard working applications ... gedit with my todo-list, firefox and chromium.

To save time, I (1) chain this command into one line, (2) silence all error messages from stderr and stdout with 2&>1 >/dev/null and (3) background the processes with & to regain a clean terminal:

gedit ~/Desktop/todo.txt 2&>1 > /dev/null & firefox 2&>1 > /dev/null & chromium-browser 2&>1 > /dev/null &

It seems to work fine except for one small detail. Gedit opens the todo file as well as a new textfile with the name 2. Are the pipes misplaced?

share|improve this question
The correct code is: gedit ~/Desktop/todo.txt > /dev/null 2>&1 & firefox > /dev/null 2>&1 & chromium-browser > /dev/null 2>&1 & – somethis Jan 8 '13 at 18:36
up vote 5 down vote accepted

I tend to see >/dev/null 2>&1 and not 2>&1 >/dev/null

Then > is probably key here since the next options for gedit is (a) filename(s).

Man page for gedit states for filename(s):

Specifies the file to open when gedit starts - if this is not specified, gedit will load a blank file with an Untitled label. Multiple files can be loaded if they are separated by spaces. gedit also supports handling of remote files. For example, you can pass the location of a webpage to gedit, like "", or load a file from a FTP server, like "".

If I read this correctly: the 2 is seen as a filename since a space preceeds it. That would suggest you need the > to tell gedit that it is not a filename that comes next.

I myself would create a script and have the commands on separate lines.

share|improve this answer
I chose this one as the accepted answer because it helped me see that I mistyped 2&>1 instead of 2>&1 as supplied by you. Duh! :) The correct code is: gedit ~/Desktop/todo.txt > /dev/null 2>&1 & firefox > /dev/null 2>&1 & chromium-browser > /dev/null 2>&1 & – somethis Jan 8 '13 at 18:35

Quick answer:

gedit -b wallet.pem > /dev/null 2>&1

The -b option put gedit in background.

Longer answer:

For a task like this one I'd put these applications in the startuo of your Desktop Environment.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.