Working on my Raspberry Pi project. I’m doing a lot in its OS directly on the command line, since it’s easier and faster than using the Raspbian GUI (kind of a slow connection using remote desktop). In addition to working with bash shortcuts, I’ve learned some other things about bash scripting. Here are some of the things I’ve learned, as well as a general reference for useful commands working with a Raspberry Pi.
~$ ssh email@example.com
Ctrl + C
pi:~ $ sudo raspi-config
pi:~ $ vncserver -help
pi:~ $ vncserver :1 -geometry 1920x1080 -depth 24
pi:~ $ vncserver -kill :1
The remote desktop operates like a second screen, even if the Pi is not plugged in to make use of a first screen. So you may as well turn the first screen off—this saves memory and you’re not using it anyway.
pi:~ $ sudo service lightdm stop
This article gives a pretty good overview of how to figure out what processes are running (or hanging up) so that you can kill them if needed. The main useful things I learned are:
The default way to see all running processes:
There is also a more robust option available called
htop which can be installed on Mac with:
$ brew install htop
For either one, press
ctrl + C to exit.
This article is a comprehensive rundown of using the
scp commands to work with remote servers.
ssh lets you connect and manage a remote server, while
scp let’s you copy files or directories from the remote server. I was focusing on
$ scp -rp firstname.lastname@example.org:/home/pi/Desktop/test\ images/timelapse-test-2/images2/ .
To break this down:
-rflag means recursive: all files in the selected directory will be copied. Alternative is to use an asterisk
*at the end of the path
pflag means to preserve file information
email@example.com the user & server location. IP address should be changed to whatever server you’re accessing
pathneeds to be from the server user root and must exist!
.at the end means copy the files to your present local directory, so make sure you’re in the place you want to copy the files to before running the command
sudo apt-get install awscli
Caveat from raspberry-projects.com: Amazon recommends using the pip package manager to install its awscli. However we prefer to keep things simple and have all our packages installed with one package manager APT. AWS states the awscli package is available in repositories for other package managers such as APT and yum, but it is not guaranteed to be the latest version unless you get it from pip or use the bundled installer. So use pip if you want the absolute latest, but APT is fine otherwise.