.
.

THIS SITE IS HOSTED ON A RASPBERRY PI 2 MODEL B COMPUTER

Linux-Apache2-MySQL-PHP5

.
.

Linux and Your Raspberry Pi Computer

FILE STRUCTURE

SUDO, ROOT and SU

Linux is a multiuser operating system; the general rule is that each user is in charge of their own files in their own space. Sometimes it is necessary to change system files or files created by other users. To do this you will need Root or Super User privilage.

Gaining Root or Super User privileges gives you the right to damage your Linux system, so use it with caution

SUDO
To temporarily gain Root privileges you use the SUDO command. Just type sudo before the command that requires the Root privilage. The firt time you use SUDO it will give you a warning and ask for your password. Example: sudo rm someFile.tar

ROOT
The Root user has access and control of everything on the system. If you need access to the Root user, you will need to set the Root password. To change the Root password type sudo root passwd it will ask you for the new password. Instead of logging in as Root you should use SUDO

SU
To gain access to Root for an extended period of time (NOT RECOMENDED) you will use SU. Just type SU at the prompt. It will ask for Roots password. If you didn't set up a password for Root, see ROOT above. Notice that the promt changes to root@youPIsName:/currentDirectory# To leave the Root user, just type exit and you should EXIT ROOT ASAP!!!!

BASIC LINUX COMMANDS FOR YOUR PI

THE APT PACKAGE MANAGER

The APT package manager keeps track of all packages on your system. When you install a new package it finds all required dependecies and installs them for you. When you uninstall a package it removes all dependent packages, but only the ones that are not use by other programs.

UPDATING APT
To update your APT cache type sudo apt-get update
To update your APT installed packages type sudo apt-get upgrade
To do a "smart" upgrade type sudo apt-get dist-upgrade
INSTALLING PACKAGES
To search for a package type sudo apt-cache search yourSearchCriteria
To install a software package just type sudo apt-get install YourPackageName
To see a list of installed packages type dpkg --list
UNINSTALLING PACKAGES
To remove a package type sudo apt-get remove packageName
To remove a package and all its config files type sudo apt-get purge packageName
To remove all packages that were installed to satisfy dependencies that are now not used type sudo apt-get autoremove
To remove all downloaded archive files type sudo apt-get clean To remove all downloaded archive files type that are no longer available sudo apt-get autoclean

SSH and RUNNING HEADLESS

If you want to connect to your Pi's terminal from another PC you can use SSH.
If you will only be using the terminal you can disconnect the monitor, keyboard and mouse
and just use a different PC to do your work via SSH

If you are using a Windows PC
You will need to install some sort of SSH client
PuTTY works great with the Raspberry Pi
Just download it and run it. Type in the IP of the PI and Log in, that easy.
If you are using a Linux PC
Just go to the terminal and type ssh thePisIPaddress -l thePiUserName
Then just log in

If you want to connect to the full GUI of your PI remotely just use Remote Desktop
It is preinstalled with most modern Windows versions.

USB STORAGE DEVICES

In Linux your external storage devices are not automatically made available to you
Before you can access it you must mount the device to a folder in the /media directory

SETTING UP YOUR WIFI

If you are using the new Raspberry Pi 3 then you are good to go. If not plug in a WiFi USB device.

.

Debian_Reference Debian_Admin_Handbook Debian_Manuals
.