Probably your shell (on the raspberry) is GNU bash. So read the manual of GNU bash.
You probably want (once) to edit some Bash startup file (such as ~/.bashrc
) to define functions and aliases there, and you could add executable shell scripts somewhere in your $PATH
. I recommend having a $HOME/bin/
directory containing your scripts and executables, and have $HOME/bin/
early in your $PATH
.
I can’t do it in terminal because it gives me an error saying that it can’t initialize the window.
Perhaps you need some display server (such as Xorg or Wayland) running (with a desktop environment or a window manager). You could run Xorg
on your PC (on which you could install Linux) and connect to the raspberry using ssh -X
then remote applications running on your Raspberry are displayed on your PC. IF your Raspberry is directly connected to a screen (via HDMI) you might run some Xorg server on it.
Is there a way to run a command line command as a shortcut
Yes, by making a shell alias or shell function or shell script. You need to understand how they work and change or create some appropriate file using some source code editor (I recommend GNU emacs, but the choice is yours and you might use any other editor such as vim
, gedit
, etc...): functions and aliases could be defined in your ~/.bashrc
; shell scripts would usually have their own file with a shebang under your $HOME/bin/
...