Todos os posts de pablo

npm install – erro “VCBuild.exe”

Se você usa windows, tentou instalar um package nodejs e teve o seguinte erro:

Eu resolvi da seginte forma:

1º instale o .NET Framework 2.0 SDK

2º instale também o Visual Studio 2005

Por ultimo abra o prompt de comamando com administrador e execute o seguinte código: npm install –global –production windows-build-tools

Espere a instalção finalizar (tenha paciência… vai demorar um pouco)




Using ACR122u on Windows

First you need to install Libnfc:
  1. Installing TDM-GCC MinGW CompilerGoto and download the TDM-GCC MinGW Compiler.
    For example: tdm64-gcc-4.7.1-3.exe
    More information about this compiler:
    Note: MinGW = Minimalist GNU for Windows
  2. Double click the executable and press the Create button.TDM-GCC setup
  3. Select “MinGW-w64/TDM64 Experimental (32-bit and 64-bit)” and press Next button.Note:
    You need to install this version instead of “MinGW/TDM (32 bit)”.
    The “MinGW-w64/TDM64 Experimental” version will run on 32-bit and 64-bit operating systems.Select MinGW-w64/TDM64 Experimental( 32-bit and 64-bit) edition
  4. Select TDM-GCC installation directory, for example C:\tools\MinGW64 and press Next button.Select TDM-GCC installation directory
  5. Select your nearest TDM-GCC download server and press Next button.Select TDM-GCC download server
  6. Choose “TDM-GCC Recommended, All Packages” and press Install button.Choose TDM-GCC components to be installed
  7. Wait until TDM-GCC is installed and press Next button.Installing TDM-GCC components
  8. Presh Finish button to complete the TDM-GCC setup.Finish the TDM-GCC setupMore information needed about TDM-GCC, read the README-gcc-tdm64.txt file.
  9. Installing libusb-win32Goto and download libusb-win32.
    For example:
    More information about this library:
  10. Download and unzip the file, for example: C:\tools\libusb-win32-bin-
    No further action is required.
  11. Installing PCRE for WindowsGoto and download the PCRE setup wizard (Perl-compatible regular-expression).
    For example: pcre-7.0.exe
    More information about PCRE:
  12. Double click the executable and press the “Next” button.PCRE setup wizard
  13. Accept the agreement and press the “Next” button.PCRE accept agreement
  14. Select PCRE installation directory, for example C:\tools\GnuWin32 and press Next button.PCRE installation location
  15. Select “Full installation” and press Next button.PCRE components
  16. Enter PCRE shortcut in Start menu and press Next button.PCRE shortcut
  17. Select additional tasks to be performed and press Next button.PCRE additional tasks
  18. Press Install button.PCRE install
  19. Press Finish button.PCRE finish
  20. Installing CMakeGoto and download CMake binary distribution for Windows platform (Win32 Installer). CMake is a cross-platform, open-source build system.
    For example: cmake-
  21. Double click the executable and press the “I Agree” button.CMake setup
  22. Select “Add CMake to the system PATH for current user” and press “Next” button.CMake install options
  23. Select CMake installation directory, for example C:\tools\CMake 2.8 and press Next button.Select CMake installation directory
  24. Choose start menu folder and press Install button.Choose start menu folder
  25. Wait until CMake is installed and press Next button.Installing CMake
  26. Presh Finish button to complete the CMake setup.Finish the CMake setup
  27. Installing DoxygenGoto and download doxygen.
    For example: doxygen-1.8.4-setup.exeNote:
    It is not required to install Doxygen.
    If not installed, Doxygen warning messages will be displayed when you configure libnfc using CMake.
    You can ignore these warning messages.
  28. Double click the executable and press the “Next” button.Doxygen setup
  29. Accept the agreement and press the “Next” button.Doxygen accept agreement
  30. Select Doxygen installation directory, for example C:\tools\doxygen and press Next button.Doxygen installation location
  31. Select “Full installation” and press Next button.Doxygen components
  32. Enter Doxygen shortcut in Start menu and press Next button.Doxygen shortcut
  33. Press Install button.Doxygen install
  34. Doxygen is installing.Doxygen is installing
  35. Read Doxygen information and press Next button.Doxygen information
  36. Press Finish button.Doxygen finish
  37. Installing libnfcGoto and download the free Near Field Communication library (libnfc).
    For example: ibnfc-1.7.0-rc7.tar.gzAnd unpack the file.
    For example: C:\tools\libnfc-1.7.0-rc7More information about this library:

  38. Configure libnfcLibnfc currently only supports communication over UART, using any inexpensive USB to UART adapter like the FTDI Tool. Before compiling you will need to configure libnfc to include support for UART and the PN532 chipset.Make the following changes:
    • Due to a bug you will get the error message below when you later use the command “mingw32-make”.C:\libnfc-build\windows\libnfc.rc:25:37: warning: missing terminating ” character [enabled by default] Edit file: C:\tools\libnfc-1.7.0-rc7\CMakeLists.txt Change:MACRO (GET_CURRENT_YEAR RESULT)
      STRING(REGEX REPLACE “.*(..)/(..)/(….).*” “\\3” ${RESULT} ${${RESULT}})


         STRING(REGEX REPLACE “\n” “” ${RESULT} ${${RESULT}})
         STRING(REGEX REPLACE “.*(..)/(..)/(….).*” “\\3” ${RESULT} ${${RESULT}})

    • The default timeouts in the pn532 driver are not long enough and unless you patch the driver, the NFC reader will not show up.
      It is important to wait a time long enough to pass the pn532 wake up sequence, so do send a 0x55, 0x55 followed by some 30 0x00.Edit file: C:\tools\libnfc-1.7.0-rc7\libnfc\drivers\pn532_uart.c Change:const uint8_t pn532_wakeup_preamble[] = { 0x55, 0x55, 0x00, 0x00, 0x00 }; into

      const uint8_t pn532_wakeup_preamble[] = { 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; 

    • If you copy c:\tools\libnfc-1.7.0-rc7\libnfc.conf.sample into c:\toolslibnfc-1.7.0-rc7\libnfc.conf, this file will not be read. Do not copy libnfc.conf.sample. Here is an alternative way.Edit file: C:\tools\libnfc-1.7.0-rc7\libnfc\nfc-internal.c Change:res->allow_intrusive_scan = false; into

      res->allow_intrusive_scan = true; 

  39. Set Windows System PathOpen the Windows “System Properties” window:
    • Press the windows “Start” button
    • Right click Computer
    • Select Properties
    • Click “Advanced system settings” which opens the “System Properties” window and press “Environment Variables…”Windows system properties
    • In the “System variables” subwindow select variable “Path” and press “Edit…” buton.Windows environment variables
    • Edit your System variable “Path”. Add the following paths (if they were not already created) at the end:
      • C:\tools\doxygen\bin;      (Only if you installed Doxygen)
      • C:\tools\MinGW64\bin;
      • C:\tools\MinGW64\x86_64-w64-mingw32\lib32;
      • C:\tools\MinGW64\x86_64-w64-mingw32\include;
      • C:\tools\CMake 2.8\bin;
      • C:\tools\GnuWin32\bin;

      Windows edit system variable PATH

  40. To test if all required software/libraries are installed and the System PATH is set correctly, open a Dos window and type: cmakeYou should see:cmake version
    cmake [options] <path-to-source>
    cmake [options] <path-to-existing-build>
    :See the complete cmake output.
  41. Configure CMake libnfc project
    • Create a folder libnfc-build.
      For example: c:\libnfc-build
    • Open a dos window and goto folder “libnfc-build”.
      Type: cmake-gui .CMake is used to configure and generate build files for software projects.
      The basic steps for configuring a project are as follows:

      • Select the source directory for the project.
        This should contain the CMakeLists.txt files for the project.
        In this tutorial the libnfc source directory is: C:\tools\libnfc-1.7.0-rc7
      • Select the build directory for the project.
        This is the directory where the project will be built.
        It can be the same or a different directory than the source directory.
        For easy clean up, a separate build directory is recommended.
        CMake will create the directory if it does not exists.
        In this tutorial the build directory is: c:\libnfc-buildConfigure CMake libnfc project
      • Once the source and binary directories are selected, it is time to press the Configure button.
        A window will open:

        • Select the “MinGW Makefiles” generator.
        • Select option: Use default native compilers.
        • Press Finish button.

        Select MinGW Makefiles generator

        This will cause CMake to read all of the input files and discover all the variables used by the project. The first time a variable is displayed, it will be in Red. Users should inspect red variables making sure the values are correct.
        For some projects the Configure process can be iterative, so continue to press the Configure button until there are no red entries.

        Errors shown when pressing configure button

        To fix the errors mentioned above:

        • Click on the PCRE_INCLUDE_DIRS value and goto:
        • Click on the PCRE_LIBRARIES value and select file:
        • And press the Configure button again.

        Errors shown when pressing configure button again

        To fix the errors mentioned above:

        • Click on the LIBUSB_INCLUDE_DIRS value and goto:
        • Click on the LIBUSB_LIBRARIES value and select file:
          C:\tools\libusb-win32-bin-\lib\gcc\libusb.a By doing the above, you are building a 32bit application.
          For 64bit system, either 32bit application or 64bit application will work.
          64bit application can not work on 32bit Windows OS.For a 64bit system, you need to use a 64bit driver.
          A 32bit driver will not work under 64 bit system, and vice versa,
          64bit driver will not work under 32bit system.

          • 32bit MinGW GCC
          • 64bit MinGW GCC
            directly link to libusb0.dll or create your own import lib
          • 32bit MSVC (=Microsoft Visual C++)
          • 64bit MSVC
          • 64bit MSVC for IA64
          • Borland C (32bit only)
          • Other compiler, use dynamic
        • And press the Configure button again.

        No errors shown when pressing configure button again

      • Once there are no longer red entries, configure libnfc according to your need.
        In my situation I will later connect an Adafruit PN532 RFID/NFC Shield to an FTDI board to a laptop running Windows Vista.
        Because libnfc currently only supports communication over UART I make the final changes:

        • Set CMAKE_BUILD_TYPE=Debug
        • Set CMAKE_INSTALL_PREFIX=C:/tools/libnfc-1.7.0-rc7
        • Set all LIBNFC_DRIVER_NNN=OFF
        • Set LIBNFC_SYSCONFDIR=C:/tools/libnfc-1.7.0-rc7/config

        Press Generate button

        Click the Configure button and then the Generate button.
        This will create files to the build directory: c:\libnfc-build

    • Build windows executable files and libnfc.dll with mingw32-make
      • Goto folder C:\libnfc-build and type: mingw32-makemingw32-make creates executablesSee the complete mingw32-make outputExecutables (.exe) are created and can be found in the folders:C:\libnfc-build\utils
        • nfc-emulate-forum-tag4.exe
        • nfc-list.exe
        • nfc-mfclassic.exe
        • nfc-mfultralight.exe
        • nfc-read-forum-tag3.exe
        • nfc-relay-picc.exe
        • nfc-scan-device.exe


        • nfc-anticol.exe
        • nfc-dep-initiator.exe
        • nfc-dep-target.exe
        • nfc-emulate-forum-tag2.exe
        • nfc-emulate-tag.exe
        • nfc-emulate-uid.exe
        • nfc-mfsetuid.exe
        • nfc-poll.exe
        • nfc-relay.exe

        File C:\libnfc-build\libnfc\libnfc.dll is also created.

    • Copy libnfc.dll to C:\Windows\System32If you run the above mentioned executables, for example:C:\libnfc-build\utils\nfc-list.exethe following error message is shown:This application has failed to start because libnfc.dll was not found. Re-installing the application may fix this problem. 

      libnfc.dll not found

      To fix this error copy the generated C:\libnfc-build\libnfc\libnfc.dll to
      Do this each time if you use the command “mingw32-make”.

Using Microsoft Access as a Front-end to MySQL

Using Microsoft Access as a Front-end to MySQL

You can use Microsoft Access as a front end to MySQL by linking tables within your Microsoft Access database to tables that exist within your MySQL database. When a query is requested on a table within Access, ODBC is used to execute the queries on the MySQL database.

To create a linked table:

  1. Open the Access database that you want to link to MySQL.
  2. On the External Data tab, choose ODBC Database.

    Figure 6.12 External Data: ODBC Database

    Content is described in the surrounding text.
  3. In the Get External Data dialog box that appears, choose Link to the data source by creating a linked table and click OK.

    Figure 6.13 Get External Data: Link To ODBC Database Option Chosen

    Shows the "Get External Data" dialog with two options: Import the source data into a new table in the current database, and Link to the data source by creating a linked table (selected).
  4. The Select Data Source dialog box appears; it lists the defined data sources for any ODBC drivers installed on your computer. Click either the File Data Source or Machine Data Source tab, and then double-click the Connector/ODBC DSN you want to link your table to. To define a new DSN for Connector/ODBC instead, click New and follow the instructions in Section 5.3, “Configuring a Connector/ODBC DSN on Windows”; double click the new DSN after it has been created.

    Figure 6.14 Selecting An ODBC Database

    Shows the Select Data Source dialog with two tabs: "File Data Source" and "Machine Data Source." The Machine Data Source tab is selected and displays three columns: Data Source Name, Type, Description. The selected row has "MySQL 5.7" defined as the Data Source Name, and "System" as the Type.

    If the ODBC data source that you selected requires you to log in, enter your login ID and password (additional information might also be required), and then click OK.

  5. Microsoft Access connects to the MySQL server and displays the list of tables that you can link to. Choose the tables you want to link to (or click Select All), and then click OK.

    Figure 6.15 Link Tables Dialog: Selecting Tables to Link

    Content is described in the surrounding text.

    • If no tables show up for you to select, it might be because you did not choose the Database to connect to when you defined or logged in to the DSN. Reconfigure the DSN and specify the Databaseto connect to (see Section 5.3, “Configuring a Connector/ODBC DSN on Windows” for details), or choose a Database when you log in to the DSN.
    • If your database on Access already has a table with the same name as the one you are linking to, Access will append a number to the name of the new linked table.
  6. If Microsoft Access is unable to determine the unique record identifier for a table automatically, it will ask you to choose a column (or a combination of columns) to be used to uniquely identify each row from the source table. Select the column[s] to use and click OK.

    Figure 6.16 Linking Microsoft Access Tables To MySQL Tables, Choosing Unique Record Identifier

    Shows the "Select Unique Record Identifier" dialog with a list of fields in the selected table. In this example, the table name is cats2 and the unique fields are CatID, CatName, OwnerID, and Birthday. The available buttons are "OK" and "Cancel".

Once the process has been completed, you can build interfaces and queries to the linked tables just as you would for any Access database.

Use the following procedure to view links or to refresh them when the structures of the linked tables have changed.

To view or refresh links:

  1. Open the database that contains links to MySQL tables.
  2. On the External Data tab, choose Linked Table Manager.

    Figure 6.17 External Data: Linked Table Manager

    Shows "Linked Table Manager" under the "External Data" tab in Microsoft Access. Underneath are two panes: The All Access Objects pane shows the available tables, and the second pane shows data from the table. The "cats2" table is selected.
  3. The Linked Table Manager appears. Select the check box for the tables whose links you want to refresh. Click OK to refresh the links.

    Figure 6.18 External Data: Linked Table Manager Dialog

    Shows the "Linked Table Manager" dialog with the cats2 table selected with its associated checkbox selected.

    If the ODBC data source requires you to log in, enter your login ID and password (additional information might also be required), and then click OK.

Microsoft Access confirms a successful refresh or, if the tables are not found, returns an error message, in which case you should update the links with the steps below.

To change the path for a set of linked tables (for pictures of the GUI dialog boxes involved, see the instructions above for linking tables and refreshing links) :

  1. Open the database that contains the linked tables.
  2. On the External Data tab, choose Linked Table Manager.
  3. In the Linked Table Manager that appears, select the Always Prompt For A New Location check box.
  4. Select the check box for the tables whose links you want to change, and then click OK.
  5. The Select Data Source dialog box appears. Select the new DSN and database with it.


Como configurar as Portas (COM e LPT) do Windows 10

Pressione as teclas Windows + X e clique em Gerenciador de dispositivos;


Em Gerenciado de dispositivos clique em Ação e Adicionar hardware herdado;


Na janela aberta clique em Avançar;


Na próxima janela selecione em Procurar e instalar automaticamente o hardware (recomendável) e clique emAvançar;


Na janela seguinte será apresentado uma lista, encontre e selecione a opção Portas (COM e LPT) e clique emAvançar; 



Na tela seguinte na coluna Fabricante deixe selecionado (Tipo de porta padrão) e em modelo Porta de comunicação e clique em Avançar;



Agora clique em Concluir.

Configurando o Arduino no Windows

Configurando o Arduino no Windows

Como conectar o Arduino no seu computador Windows e rodar o seu primeiro programa

Este tutorial foi traduzido e adaptado das instruções de instalação do site oficial do Arduino, e é disponibilizado sob uma licença Creative Commons CC BY-SA 3.0.

Você deve seguir os seguintes passos:

  1. Obter uma placa Arduino e um cabo USB
  2. Fazer o download do ambiente de desenvolvimento do Arduino
  3. Conectar a placa
  4. Instalar os drivers
  5. Executar o aplicativo do Arduino
  6. Abrir o exemplo “Blink”
  7. Selecionar a sua placa
  8. Selecionar a porta serial
  9. Fazer upload do programa

1. Obter uma placa Arduino e um cabo USB

Neste tutorial, assumimos que você está usando um Arduino Uno, Arduino Duemilanove, Nano, Arduino Mega 2560, Diecimila ou então um Alevino com o Nanoshield USB. Se você tem alguma outra placa, veja o tutorial correspondente na página do produto.

Você também vai precisar de um cabo USB padrão (conector A para conector B): o tipo de cabo que você conectaria a uma impressora USB, por exemplo. Para o Arduino Nano ou o Alevino com Nanoshield USB, você vai precisar, no entanto, de um cabo com conector A para Mini-B.

2. Fazer o download do ambiente de desenvolvimento do Arduino

Obtenha a última versão da página de download.

Quando o download teminar, descompacte o arquivo baixado, garantindo que a estrutura das pastas seja mantida. Dê um duplo clique na pasta para abrí-la. Deve haver alguns arquivos e sub-pastas dentro.

3. Conectar a placa

O Arduino Uno, Mega, Duemilanove, Arduino Nano e o Alevino com Nanoshield USB obtêm energia automaticamente seja da conexão USB ou de um fonte de alimentação externa. Se você está usando um Arduino Diecimila, é preciso configurar a placa para obter energia da conexão USB. A fonte de energia da placa é selecionada com um jumper, uma pequena peça de plástico que se encaixa em dois dos três pinos que ficam entre os conectores USB e de energia. Verifique que ele está nos dois pinos mais próximos da porta USB.

Conecte o Arduino ao seu computador usando o cabo USB. O LED verde de energia (marcado como PWR) deve acender.

4. Instalar os drivers

Instalando drivers para o Arduino Uno ou Arduino Mega 2560 no Windows7, Vista, ou XP:

  • Conecte a sua place e aguarde até que o Windows inicie o processo de instalação de drivers. Depois de alguns instantes, o processo irá falhar.
  • Clique no menu iniciar e vá até o Painel de Controle
  • Selecione Sistema e Segurança > Sistema > Gerenciador de Dispositivos.
  • Procure na seção “Portas (COM e LPT)”. Você deverá encontrar um porta aberta chamada “Arduino UNO (COMxx)”.
  • Clique com o botão direito na porta “Arduino UNO (COMxx)” e selecione “Atualizar Driver…”.
  • Depois selecione a opção “Procurar software de driver no computador”.
  • Finalmente, navegue até a pasta “drivers” dentro do aplicativo do Arduino, na pasta que foi descompactada anteriormente, e selecione o arquivo “arduino.inf”.
  • A partir daí, o Windows completará a instalação dos drivers.

Instalando drivers para o Arduino Duemilanove, Nano, Diecimila ou Alevino com Nanoshield USB no Windows7, Vista, ou XP:

Quando você conectar a placa, o Windows deve iniciar o processo de instalação dos drivers, caso você ainda não tenha usado o computador com um Arduino antes.

A janela “Adicionar novo hardware” irá aparecer:

  • Nessa janela, selecione “Não, não agora” e clique em avançar.
  • Selecione “Instalar o driver de uma lista ou um lugar especifico (avançado)” e clique em avançar.
  • Verifique que “Procurar o melhor driver nesses lugares especifícos” está selecionado; deselecione “Procurar em mídias removiveis”; selecione “Incluir este lugar na procura” e vá até o diretório “drivers” do Arduino, dentro da pasta que você descompactou anteriormente (a versão mais atual dos drivers pode ser encontrada no site da FTDI). Depois, clique em avançar.
  • O Windows irá procurar pelo driver e dizer que um “USB Serial Converter” foi encontrado. Clique em finalizar.
  • A janela “Adicionar novo hardware” aparecerá novamente. Siga os mesmos passos, selecionando as mesmas opções e o mesmo diretório. Dessa vez, uma “USB Serial Port” será encontrada.
  • Você pode verificar que os drivers foram instalados clicando no menu iniciar e depois em Painel de Controle > Sistema e Segurança > Sistema > Gerenciador de Dispositivos. Procure por uma “USB Serial Port” na seção “Portas (COM e LPT)”.

5. Executar o aplicativo do Arduino

Dê um clique duplo no aplicativo do Arduino. Se o software do Arduino abrir no idioma errado, você pode mudá-lo na janela de preferências (File > Preferences ou Arquivo > Preferências) – veja essa página do Arduino para mais detalhes. Daqui por diante vamos assumir que o idioma escolhido é o português do Brasil.

6. Abrir o exemplo “Blink”

Abra o programa de exemplo “Blink”: File > Exemplos > 1.Basics > Blink.

7. Selecionar a sua placa

Você precisa selecionar a opção do menu Ferramentas > Placa que corresponde ao seu tipo de Arduino.

Para o Alevino com Nanoshield USB, use Arduino Nano w/ ATmega328. Para placas Duemilanove com um ATmega328 (veja o texto no chip da placa), selecione Arduino Duemilanove or Nano w/ ATmega328. Anteriormente, as placas Arduino vinham com um ATmega168; para elas, selecione Arduino Diecimila, Duemilanove, or Nano w/ ATmega168 (detalhes das opções do menu de placas estão disponíveis nessa página do Arduino).

8. Selecionar a porta serial

Selecione o dispositivo serial correspondente à placa do Arduino no menu Ferramentas > Porta Serial. É provável que ele seja COM3 ou maior (COM1 e COM2 são normalmente reservados para portas seriais nativas, e não por USB). Para descobrir, você pode desconectar o seu Arduino e reabrir o menu; a opção que desaparecer deve ser a da placa do Arduino. Reconecte a placa e selecione a porta serial.

9. Fazer upload do programa

Agora, simplesmente clique o botão “Carregar” no ambiente de desenvolvimento. Espere alguns segundos – você deve ver os LEDs RX e TX na placa piscando. Se o upload for bem sucedido, a mensagem “Transferência concluída.” vai aparecer na barra de status. (Nota: Se você possui um Arduino Mini, NG, ou outra placa não mencionada aqui, você pode ter que pressionar fisicamente o botão de reset na placa imediatamente antes de apertar o botão de upload).

Alguns segundos após o upload terminar, você deve ser o LED do pino 13 na placa começar a piscar. Se isso aconteceu, parabéns! Você conseguiu configurar o Arduino e rodar o seu primeiro programa.

Se você tiver problemas, verifique a página de resolução de problemas do site do Arduino.



Auto-run LXTerminal from LXDE desktop at startup

The script may be running to completion and the terminal closes before you see it. Test to see if it works using a script that waits for input, so the terminal will stay open until you close it.

Create a test script. I just named it “”, make it executable.

sudo chmod +x filename.ext



 read -n1 -rsp $'Press any key to close the terminal...\n'

echo Script is running


Then edit the autostart file


nano ~/.config/lxsession/LXDE-pi/autostart

Add this line at the bottom


lxterminal -e /path/to/

Then log out and back in, or reboot. When the desktop starts you should see the terminal open in the middle of the screen, waiting for you to press a key. That will confirm everything’s working, then edit the autostart file and replace “/path/to/” with the script you want to use.

inspirational quotes:

Linux commands


The ls command lists the content of the current directory (or one that is specified). It can be used with the -l flag to display additional information (permissions, owner, group, size, date and timestamp of last edit) about each file and directory in a list format. The -a flag allows you to view files beginning with . (i.e. dotfiles).


Using cd changes the current directory to the one specified. You can use relative (i.e. cd directoryA) or absolute (i.e. cd /home/pi/directoryA) paths.


The pwd command displays the name of the present working directory: on a Raspberry Pi, entering pwd will output something like /home/pi.


You can use mkdir to create a new directory, e.g. mkdir newDir would create the directory newDir in the present working directory.


To remove empty directories, use rmdir. So, for example, rmdir oldDir will remove the directory oldDir only if it is empty.


The command rmremoves the specified file (or recursively from a directory when used with -r). Be careful with this command: files deleted in this way are mostly gone for good!


Using cp makes a copy of a file and places it at the specified location (this is similar to copying and pasting). For example, cp ~/fileA /home/otherUser/would copy the file fileA from your home directory to that of the user otherUser (assuming you have permission to copy it there). This command can either take FILE FILE (cp fileA fileB), FILE DIR(cp fileA /directoryB/) or -r DIR DIR (which recursively copies the contents of directories) as arguments.


The mv command moves a file and places it at the specified location (so where cp performs a ‘copy-paste’, mv performs a ‘cut-paste’). The usage is similar to cp. So mv ~/fileA /home/otherUser/ would move the file fileA from your home directory to that of the user otherUser. This command can either take FILE FILE (mv fileA fileB), FILE DIR (mv fileA /directoryB/) or DIR DIR (mv /directoryB /directoryC) as arguments. This command is also useful as a method to rename files and directories after they’ve been created.


The command touch sets the last modified time-stamp of the specified file(s) or creates it if it does not already exist.


You can use cat to list the contents of file(s), e.g. cat thisFile will display the contents of thisFile. Can be used to list the contents of multiple files, i.e. cat *.txt will list the contents of all .txt files in the current directory.


The head command displays the beginning of a file. Can be used with -n to specify the number of lines to show (by default ten), or with -c to specify the number of bytes.


The opposite of headtail displays the end of a file. The starting point in the file can be specified either through -b for 512 byte blocks, -c for bytes, or -n for number of lines.


You would normally use chmod to change the permissions for a file. The chmodcommand can use symbols u (user that owns the file), g (the files group) , and o (other users) and the permissions r (read), w (write), and x (execute). Using chmod u+x *filename* will add execute permission for the owner of the file.


The chown command changes the user and/or group that owns a file. It normally needs to be run as root using sudo e.g. sudo chown pi:root *filename* will change the owner to pi and the group to root.


ssh denotes the secure shell. Connect to another computer using an encrypted network connection. For more details see SSH (secure shell)


The scp command copies a file from one computer to another using ssh. For more details see SCP (secure copy)


The sudo command enables you to run a command as a superuser, or another user. Use sudo -s for a superuser shell. For more details see Root user / sudo


The dd command copies a file converting the file as specified. It is often used to copy an entire disk to a single file or back again. So, for example, dd if=/dev/sdd of=backup.img will create a backup image from an SD card or USB disk drive at /dev/sdd. Make sure to use the correct drive when copying an image to the SD card as it can overwrite the entire disk.


Use df to display the disk space available and used on the mounted filesystems. Use df -h to see the output in a human-readable format using M for MBs rather than showing number of bytes.


The unzip command extracts the files from a compressed zip file.


Use tar to store or extract files from a tape archive file. It can also reduce the space required by compressing the file similar to a zip file.

To create a compressed file, use tar -cvzf *filename.tar.gz* *directory/* To extract the contents of a file, use tar -xvzf *filename.tar.gz*


A pipe allows the output from one command to be used as the input for another command. The pipe symbol is a vertical line |. For example, to only show the first ten entries of the ls command it can be piped through the head command ls | head


Use the tree command to show a directory and all subdirectories and files indented as a tree structure.


Run a command in the background with &, freeing up the shell for future commands.


Download a file from the web directly to the computer with wget. So wget download this file to your computer as


Use curl to download or upload a file to/from a server. By default, it will output the file contents of the file to the screen.


Show the manual page for a file with man. To find out more, run man man to view the manual page of the man command.



Use grep to search inside files for certain search patterns. For example, grep "search" *.txt will look in all the files in the current directory ending with .txt for the string search.

The grep command supports regular expressions which allows special letter combinations to be included in the search.


awk is a programming language useful for searching and manipulating text files.


The find command searches a directory and subdirectories for files matching certain patterns.


Use whereis to find the location of a command. It looks through standard program locations until it finds the requested command.



The ping utility is usually used to check if communication can be made with another host. It can be used with default settings by just specifying a hostname (e.g. ping or an IP address (e.g. ping It can specify the number of packets to send with the -c flag.


nmap is a network exploration and scanning tool. It can return port and OS information about a host or a range of hosts. Running just nmap will display the options available as well as example usage.


The hostname command displays the current hostname of the system. A privileged (super) user can set the hostname to a new one by supplying it as an argument (e.g. hostname new-host).


Use ifconfig to display the network configuration details for the interfaces on the current system when run without any arguments (i.e. ifconfig). By supplying the command with the name of an interface (e.g. eth0 or lo) you can then alter the configuration: check the manual page for more details.