I would like to execute the shell command "cmatrix" whenever I open a terminal. How to go about achieving this?
You can add
cmatrix command in your
~/.bashrc file located at home folder:
echo 'cmatrix' >> ~/.bashrc
NOTE: Please ensure that you use
>>, the append operator. If you use
>, it will replace your whole
Because you tagged your question with
gnome-terminal, you can also use a a custom command for your
The advantage, the command is executed only for a specific profile and not always when the bash is started somewhere.
But first install
dconf-editor. If you make a mistake in the steps below, you will need this tool
sudo apt-get install dconf-editor
gnome-terminal and edit your profile settings and use this command
sh -c "cmatrix;bash"
as you can see in the screenshot below. If you don't use the bash, replace
bash with your shell.
If you made a mistake and
gnome-terminal is unusable, use use
dconf-editor to correct your problem:
dconf-editor and navigate to the settings of GNOME terminal and change the values for
use-custom-command in the settings for your
I'm using Fedora with XFCE desktop. I encountered problems when Fedora boots, by using the solution provided by @snoop, and the solution provided by @AB gave me the "Failed to execute child process (no such file or directory)" error. Searching for a solution, finally I used a script saved as
~/bin/cmatrix_launcher.sh with this content:
#!/bin/bash cmatrix -baC cyan /bin/bash
throwing then it as a custom command in the
xfce4-terminal settings (screenshot attached)