Raspberry Pi (2): Terminal Commands and Navigation

Reference: https://pythonprogramming.net/terminal-navigation-raspberry-pi-tutorials/?completed=/remote-access-raspberry-pi-tutorials/

Code – Use

  1. pwd – print working directory  defacult is /home/pi, also is ~
  2. cd – change directory: cd /home ; cd ~ ; cd / tab (help to fill possible command) ; cd .. (go back one level of directory); cd ../../ (go back two levels of directories)
  3. ls – list contents of directory
  4. mkdir – make directory: mkdir exemple (make example folder)

Test Python

  1. nano test.py
  2. print (‘hi’)
  3. ctrl+x; Y
  4. python test.py

Download from Internet

  1. wget https://www.pythonprogramming.net/static/images/categories/3D-Matplotlib.png
  2. sudo apt-get install git
  3. sudo apt-get autoremove
  4. git clone https://github.com/vinta/awesome-python

Remove file/directory

  1. rm 3D-Matplotlib.png (case sensitive)
  2. rmdir new
  3. rmdir awesome-python
  4. rm -r awesome-python (force removing)

ls

  1. ls -a ; ls -all (show all contents, including hidden contents)
  2. ls -l (contents in list format)
  3. ls -al (combine the above attributes)
  4. flag: – for short hand and — for full word
  5. ls –help

reboot and shut down raspberry pi

  1. sudo reboot
  2. sudo shutdown -h now
  3. sudo shutdown -r now

Raspberry Pi (1) – Install and Remote Setup

terminal command

  • ctrl + alt + t to open terminal
  • sudo apt-get upgrade
  • sudo apt-get dist-upgrade
  • remove wolfram-engine
  • sudo nano/ etc/apt/sources.list
  • sudo apt-get purge wolfram-engine
  • sudo apt-get autoremove

pythonprogramming.net

Access Raspberry Pi Remotely

  1. Connect via shell SSH
    1. Ctrl+Alt+t
    2. type ifconfig
    3. inet addr
    4. sudo raspi-config
    5. Interfacing Option
    6. P2 SSH
    7. $ ssh pi@192.168.0.103
    8. vncserver
    9. default username: pi password:raspberry
    10. sudo apt-get remove xrdp vnc4server tightvncserver
    11. sudo apt-get install tightvncserver
  2. Putty

 

 

ODS Listing

ODS Tips

Output to text file

[code lang=text]
ODS LISTING file='C:\Users\david\Documents\My SAS Files(32)\9.3\ods\sample.lst';
OPTIONS NONUMBER NODATE;
PROC PRINT DATA=SASHELP.cars(OBS=100);
VAR make model type origin drivetrain msrp invoice enginesize cylinders horsepower mpg_city mpg_highway;
RUN;
OPTIONS DATE;
PROC FREQ DATA=SASHELP.cars;
TABLES make type origin drivetrain enginesize cylinders ;
RUN;
proc means data=sashelp.cars mean median min max skew;
class type origin;
var msrp enginesize horsepower mpg_city mpg_highway weight wheelbase length;
run;
ODS LISTING CLOSE;
[/code]

  • .lst file can be opened in SAS by dragging the file to the program edit window.

  • click file in the file explorer window will launch sas enterprise guide

  • ods listing can be used for record keeping and to check the validity of the sas programming.