2

Usually, before beginning my coding duty I open the following:

  • google-chrome
  • nautilus
  • terminal
  • system monitor
  • gedit

Is there a way to open all of them with a single terminal command?

I use Ubuntu 18.04.

rsaavedra
  • 163

3 Answers3

2

Here's what I'd do:

for i in google-chrome nautilus gnome-terminal gedit ; do
    setsid "$i" >  /dev/null 2>&1 
done

setsid or nohup can be used to daemonize a process, with setsid being preferred because it starts each process as new session leader, effectively disconnecting it from terminal. See also, Difference between nohup, disown and &.

As for > /dev/null 2>&1 that just sends both normal and error streams from each program into /dev/null so that you can still use terminal normally. See also What does & mean exactly in output redirection? and What is the differences between &> and 2>&1

I don't remember command for system monitor off the top of my head, so I'll leave that up to you.

Feel free to turn this loop into either a function that can live in your ~/.bashrc or make a full-blown scripts. Up to you.

dessert
  • 40,956
1

Simplest way is to make a bash script with all the needed commands to start those programs.

You could even put that script in Startup Applications so it gets run on every bootup.

dessert
  • 40,956
fixit7
  • 3,399
1

To open all of the above applications at one, you could execute something like this:

chromium ; nautilus ; gnome-terminal ; gnome-system-monitor ; gedit

To make this startup every time you Log In, you could put this command into a .desktop file on the Exec= line.

Place this file into /usr/share/applications and open gnome-session-properties. Simply add your new application to the current list of startup applications. This should do the trick.