In this entry I would document some interesting linux commands to use in the raspberry pi

  • To see the history of commands you typed
    history
    
  • Different for sudo and user
    crontab -e
    
  • To connect to the raspberry pi remotely from other laptop through ssh
    ssh user@ipofthehost
    
  • Correr el script y guardar el output en output.log
    nohup python /path/to/test.py > output.log &
    
  • Ver que PID tiene el script de python
    ps ax | grep test.py
    
  • Matar el proceso (PID = el numero)
    kill PID
    
  • list of devices
    dmesg
    
  • list of USB devices
    lsusb
    
  • kernel of linux used
    uname -r
    
  • look for “8192” in /
    find / -name "8192" -print
    
  • check loaded modules
    lsmod
    
  • mount network device need cifs-utils needs root
    mount -t cifs -o username=juan //server /localfolder
    
  • change samba password of osmc user
    smbpasswd -a osmc
    
  • delete folder and its content
    rm -r foldername
    rm -rf foldername // Use f to force deleting
    
  • Download file from ssh server
    scp pi@pisalamanca:/home/pi/ovpns/jfdzar_mobile.ovpn jfdzar_mobile.ovpn
    
  • Check the disk usage of a directory
    du -h --max-depth=1 /Media/
    
⤧  Next post Create a Wifi Access Point ⤧  Previous post Create a Backup or Restore SD Card