Difference between revisions of "Linux Commands On Pi"

From OpenCircuits
Jump to navigation Jump to search
(Created page with "<pre> sudo raspi-config # still works as alternative to command line </pre>")
 
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
= Make Sure You are Up to Date =
 +
 
<pre>
 
<pre>
 +
 +
# remember to use >>
 +
sudo apt-get update
 +
 +
sudo apt-get upgrade
  
 
sudo raspi-config    # still works as alternative to command line  
 
sudo raspi-config    # still works as alternative to command line  
 +
 +
</pre>
 +
 +
= Software install =
 +
 +
Use the gui app or at command line
 +
 +
* apt-get
 +
* pip
 +
 +
= Misc Commands =
 +
 +
 +
*    ~  home directory
 +
*    ./ current directory
 +
*    ../ parent directory
 +
 +
* ls        list files, but may miss hidden ones then ???
 +
* cd
 +
 +
* chmod  +x  filename      +x  make executable
 +
* ps  -e      what is running ( -e all users??  without just current )
 +
 +
* top          info on running processes in a nano like window exit with ctrl c
 +
* kill          end a process using pid from above
 +
  
  
 +
cp                copy files
  
 +
 +
 +
 +
 +
 +
== Directories ==
 +
* mkdir            make directory
 +
* rmdir – Remove Directories
 +
 +
 +
== Files ==
 +
* rm – Remove Files
 +
 +
 +
* mv – Move Files
 +
 +
 +
* trash from command line not so easy may be hidden /home/pi/.local/share/Trash  may be a hint.
 +
 +
== Note ==
 +
<pre>
 +
 +
 +
mc – A Full File Manager
 +
Midnight Commander is one of many fully featured file managers you can use from the Linux terminal. It isn’t installed by default on most distributions; here’s the command you’ll need to install it on Ubuntu:
 +
 +
sudo apt-get install mc
  
 
</pre>
 
</pre>
 +
 +
= File Related =
 +
 +
== Editing ==
 +
* editing in gui leafpad file_name, or if protected sudo leafpad file_name
 +
* editing with no gui use nano same as above but a bit clunky, ctrl prefix to commands
 +
 +
== Config Files ==
 +
 +
=== interfaces ===
 +
 +
<pre>
 +
 +
#  sudo leafpad  /etc/network/interfaces
 +
 +
</pre>
 +
 +
=== for Keyboard ===
 +
 +
<pre>
 +
#  sudo leafpad  /etc/default/keyboard
 +
 +
XKBLAYOUT="us"
 +
</pre>
 +
 +
== for WiFi wpa_supplicant.conf ==
 +
 +
<pre>
 +
 +
# for info
 +
sudo iwlist wlan0 scan
 +
 +
</pre>
 +
 +
Go to the bottom of the file and add the following:
 +
 +
<pre>
 +
#  sudo leafpad /etc/wpa_supplicant/wpa_supplicant.conf
 +
# at bottom of file
 +
# ok to have 2
 +
 +
network={
 +
    ssid="The_ESSID_from_earlier"
 +
    psk="Your_wifi_password"
 +
 +
network={
 +
    ssid="The_ESSID_from_earlier"
 +
    psk="Your_wifi_password"
 +
}
 +
 +
</pre>
 +
 +
 +
 +
[[Category:Arduino/RaspberryPi]]

Latest revision as of 17:55, 8 December 2016

Make Sure You are Up to Date[edit]


# remember to use >>
sudo apt-get update

sudo apt-get upgrade 

sudo raspi-config     # still works as alternative to command line 

Software install[edit]

Use the gui app or at command line

  • apt-get
  • pip

Misc Commands[edit]

  • ~ home directory
  • ./ current directory
  • ../ parent directory
  • ls list files, but may miss hidden ones then ???
  • cd
  • chmod +x filename +x make executable
  • ps -e what is running ( -e all users?? without just current )
  • top info on running processes in a nano like window exit with ctrl c
  • kill end a process using pid from above


cp copy files




Directories[edit]

  • mkdir make directory
  • rmdir – Remove Directories


Files[edit]

  • rm – Remove Files


  • mv – Move Files


  • trash from command line not so easy may be hidden /home/pi/.local/share/Trash may be a hint.

Note[edit]



mc – A Full File Manager
Midnight Commander is one of many fully featured file managers you can use from the Linux terminal. It isn’t installed by default on most distributions; here’s the command you’ll need to install it on Ubuntu:

sudo apt-get install mc

File Related[edit]

Editing[edit]

  • editing in gui leafpad file_name, or if protected sudo leafpad file_name
  • editing with no gui use nano same as above but a bit clunky, ctrl prefix to commands

Config Files[edit]

interfaces[edit]


#  sudo leafpad  /etc/network/interfaces

for Keyboard[edit]

#  sudo leafpad  /etc/default/keyboard	

XKBLAYOUT="us"

for WiFi wpa_supplicant.conf[edit]


# for info
sudo iwlist wlan0 scan

Go to the bottom of the file and add the following:

#  sudo leafpad /etc/wpa_supplicant/wpa_supplicant.conf
# at bottom of file
# ok to have 2

network={
    ssid="The_ESSID_from_earlier"
    psk="Your_wifi_password"

network={
    ssid="The_ESSID_from_earlier"
    psk="Your_wifi_password"
}