![]() Entering ls alone shows the contents of the current directory. Relative paths are ‘relative’ to your working directory, which is /home/pi/ when you start. Most of the time you’ll also use the TAB button to quickly enter long file names (see ‘Tab completion’).Īs mentioned, file paths come in two types: relative and absolute. You can’t have spaces in file names, so you use a backslash followed by a space at the command line. The eagle-eyed reader may have noticed the weird backslash character: ‘\’. In here is another directory called pi (that’s you), and inside that is another directory called Documents, and inside that is one called Scratch Projects. Here you have a directory called home that contains all users. In the file path above, the first slash is the root of your hard drive. Your home folder contains a Documents directory, and inside that are three more folders: Blue J Projects, Greenfoot Projects, and Scratch Projects. In the visual GUI, you can see these as folders that you open, revealing files and more folders. Understanding paths in Terminalīefore going any further with directories, you need to understand the file path and the difference between a ‘relative’ and ‘absolute’ path.įiles are placed inside folders (which are called ‘directories’ in the command line). Here you’ll see the same directories (or folders) that are in the File Manager app: Desktop, Downloads, Documents, and so on. You view the files and directories inside the working directory using the list (ls) command: The home folder is the same one that appears by default when you open the File Manager app. This command is short for ‘print working directory’ and it tells you where you are. Enter the following command and press RETURN: The first thing you need to learn is how to find out where you are. Now when you reboot, you’ll start in the command line (enter startx to boot into the desktop). ![]() Change the Boot setting to ‘To CLI’ and click OK. Open Raspberry Pi Configuration (Menu > Preferences > Raspberry Pi Configuration). If you prefer the command line, you can boot Raspbian directly to the command line instead of the desktop. Each has its own login and operates independently. Additional virtual consoles can be accessed using CTRL ALT F2 to F6. You can get back to the desktop using CTRL ALT F7 and switch back to the virtual console using CTRL ALT F1. ![]() You can now use the command line in full-screen mode. If you are not automatically logged in, enter pi and press RETURN, then enter your password (raspberry by default). A black screen appears, displaying ‘Raspbian (or Debian) GNU/Linux 8 raspberry pi tty’ and below it, ‘raspberrypi login’. Press CTRL ALT F1 and the desktop will vanish. Most users get to the command line via the Terminal app, but there is another way known as ‘virtual console’. Below this is another $ prompt, ready to accept another command. Enter echo Hello World and press RETURN, you’ll see ‘Hello World’ printed on the line. You enter commands using the text interface. A window opens with a black background and some green and blue text. The fastest way to get access to the command line is through the Terminal app.Ĭlick on the Terminal icon in the top menu bar (or choose Menu > Accessories > Terminal). When you boot a Raspberry Pi, you start by default inside the desktop interface. Command line web browser: internet search from BASH terminal.With just a few commands, you can master the command line. ![]() The command line can be daunting for newcomers, but it really needn’t be. It’s a lot trickier, but you get far more control and feel like a proper driver. The command line is like switching to manual. If you’ve only ever used a GUI then you’re driving an automatic. You can do just about anything to your computer, and you can do it much faster. With the command line, you’re not locked into doing just what desktop applications enable you to do. There’s really nothing wrong with GUIs, and Raspbian comes with a rather fine one.īut beneath the icons sits a whole other world: the command line. Why learn to use Terminal and the Command Line? See! Get a free Raspberry Pi with a subscription to The MagPi magazine. Unless you grew up in the 1980s or earlier, the chances are that you are accustomed to using only GUIs (graphical user interfaces) and desktop environments. And Terminal is an essential tool for most maker projects. With Linux commands you can take full control of Rasbpian OS. ![]() Learning how to use Terminal and enter command line commands on a Raspberry Pi is an essential skill to master. ![]()
0 Comments
Leave a Reply. |