Skip to content

5000+ Great Articles

Best Articles & Essays: Interesting Articles to Read Online

  • Make your Devices Read Out Text, With Text to Speech How-To
  • 4 best 4chan apps for Android and iOS 2023 How-To
  • Change How Windows Prompts for Admin Approval Mode Windows 7
  • Android Chrome Browser Supports Dark Theme How-To
  • How to Whisper on Twitch 2021 Gaming
  • How to Fix If Starbucks app not working? Smartphones
  • What Is “Other” Storage on Android And How to Clean It Up ? Smartphones
  • How to check if iphone is unlocked iPhone

Ten most useful Raspberry Pi commands

Posted on May 20, 2023May 21, 2023 By blog_786 No Comments on Ten most useful Raspberry Pi commands

Ten most useful Raspberry Pi commands.

Getting started with the Raspberry Pi can be tricky. Even if you find a good guide to follow when setting up your Pi for the first time, there is still a lot to learn. The Raspberry Pis runs on Linux, and if you’ve never used a Linux operating system before, it might seem strange and daunting.

How To Update Raspberry Pi(Opens in a new browser tab)

While you already know how to perform basic tasks like viewing folders and files on your PC or Mac, doing these tasks on your Pi works differently, especially if you’re using a version that doesn’t have a graphical user interface (GUI). Below, we’ll introduce you to the common Raspberry Pi Linux terminal commands you need to know in order to use your Pi.

Ten most useful Raspberry Pi commands

1. Listing the Contents of the Current Directory

The ls command stands for “enumeration”. This is the simplest Linux command that you will use on your Pi. Type ls into terminal, hit Enter and it will return a list of all files and folders in the current directory.

Ten most useful Raspberry Pi commands

2. Changing Your Pi’s Password

The passwd command should probably be one of the first Linux commands you use on your Raspberry Pi. You’re not using the Pi with the default password, are you? This is not good. To change your Pi’s password, enter the password in the terminal.

You will be prompted for your current password, enter it and press Enter. Then enter your new password and press Enter. Then it will ask you to confirm the new password. Re-enter it, hit Enter and you’ve successfully changed your Pi’s password.

Ten most useful Raspberry Pi commands

3. Restarting or Shutting Down Your Pi

Root access is required to restart or shutdown your Pi, so you need to use the sudo command. Sudo is a Linux command that stands for SuperuserDo. It allows you to execute an elevated Raspberry Pi Linux command that you will need for things like installing programs or rebooting your machine. To use sudo type sudo followed by the command you want to run.

Beginner’s Guide to the Windows Command Prompt(Opens in a new browser tab)

To shutdown the Pi, enter sudo shutdown. When you hit Enter, it will ask you for the root Pi password. This command will turn off your Pi after one minute. Use sudo shutdown 0 for immediate shutdown.

Ten most useful Raspberry Pi commands

To restart pi, use sudo shutdown -r. By default, your Pi will restart in one minute. If you want it to restart instantly, you can use sudo shutdown -r 0, where 0 means zero minutes or right now .

4. Changing Directories

The cd command means – you guessed it – change directory. It changes the current working directory, that is, the directory you are currently in. Enter cd / [ the path to the directory you want to change to ] . Here’s an example: cd / usr / lib. Typing this command in a terminal will take you to the user / lib folder on your Pi.

Ten most useful Raspberry Pi commands

Alternatively, you can enter cd .., which will move you one directory up in the folder hierarchy. Or you can use cd ~. This will move you to the home directory of the logged in user, and cd / will move you to the root folder. Finally, cd – takes you to the previous folder you were in. Think of this command as canceling the previous cd command.

5. Copying Files on Your Pi

The cp command copies files and directories. In general, a Raspberry Pi Linux command would look like this: cp [source file location] [destination file location].

When you copy files, you can rename them at the same time. If you want to copy a file named test.txt to the current directory and rename it to test2.txt, the command will be cp test.txt test2.txt. Both the original file and the renamed copy of the file will be in the current directory. Use the ls command to see the new file.

Ten most useful Raspberry Pi commands

How to Get Started with the Raspberry Pi 3 Model B(Opens in a new browser tab)

6. Renaming Files on Your Pi

To rename the file, use the mv command. For example, if you use the command mv test.txt test2.txt, the renamed file will be located in the current directory.

Ten most useful Raspberry Pi commands

7. Moving Files or Folders

Moving a file from one folder to another works in the same way as renaming a file. Enter mv [file name] [destination folder]. This assumes that the file you want to move is in the current directory. Here’s an example: mv test.txt ~ /. This command will move the test.txt file from the current directory to the user’s home folder. As usual, if you get a “Permission denied” message, add sudo to the beginning of the command.

Ten most useful Raspberry Pi commands

If the file you want to move is not in the current directory, you can use a command like this: mv /usr/lib/test.txt ~ /. This command will move the test.txt file from the usr / lib directory to the user’s home directory.

By the way, you can also rename the file when is moved. Enter mv ~ / test.txt /usr/lib/test2.txt. In this example, we renamed the text.txt file to test2.txt and moved it from the home directory to the usr / lib folder.

Ten most useful Raspberry Pi commands

8. Editing Text Documents

The Linux command line text editor is called nano. To start nano, enter nano [path to the text file you want to open or create]. Some folders require permission to create or edit a file. In this case, use sudo nano [filepath]. (If you need permission, the editor will tell you so you can close it and rerun the command with sudo.)

If you use nano to open an existing file, it will open the file for editing. you if create a new file, Linux will open an empty editor with no text. You can use the arrow keys and keyboard to type whatever you want. Note that there is a command menu at the bottom of the terminal window. They all start with the ^ character. On Linux, this means that you must hold down the Ctrl key while using this command.

Ten most useful Raspberry Pi commands

Press ctrl + o to save the file. You can change the file name if you like. Pressing Enter will save the file. If you want to exit, press ctrl + x. If you exit and there are changes that you have not saved, you will be prompted to save them. Select save by typing y and pressing Enter. Or you can type n and press Enter to discard your changes.

Ten most useful Raspberry Pi commands

9. Finding the Location of an Installed Program

To find the installed software on the Pi, use the whereis command. This command finds any installed package. Enter whereis [package name].

For example, if you are looking for a C ++ compiler called gcc, you must type whereis gcc and the terminal will display the full path to the executable anywhere on your computer. In the screenshot below, the package was found in two places. If the package is not found anywhere, gcc: will be displayed.

Ten most useful Raspberry Pi commands

10. Apt-Get

This is one of the funniest Raspberry Pi Linux commands. The apt-get command will find the package you want, download it and install it – all with one command. Sweet! You will need elevated permissions to install the files, so enter sudo apt-get install [the name of the package you want to install].

Here is the command, if you want to install htop (an interactive process monitor that will display your Pi’s CPU usage, memory usage, etc.), you must enter sudo apt-get install htop.

Ten most useful Raspberry Pi commands

BONUS: How to Copy Text and Paste It Into Your Pi’s Terminal Window

Windows shortcuts for copy and paste do not work on Linux. Let’s say you’re connected to the Pi remotely from your computer and want to copy the Pi’s password from the Windows password manager. You can’t just choose a password, use CTRL + C to copy it, and CTRL + V to paste it into the Pi’s terminal.

However, you can use CTRL + C to copy the password from Windows and then right-click in the terminal window. This single right-click pastes text from the clipboard into the terminal. Then press Enter.

Be warned: you won’t see any evidence that you inserted something into the terminal, but there certainly is!

–

Ten most useful Raspberry Pi commands

Ten most useful Raspberry Pi commands.

What You Need to Know About the Raspberry Pi 4(Opens in a new browser tab)

Share this:

  • Twitter
  • Facebook
Linux Tips Tags:Apt Get, BONUS How to Copy Text and Paste It Into Your Pi’s Terminal Window, Changing Directories, Changing Your Pi’s Password, Copying Files on Your Pi, Editing Text Documents, Finding the Location of an Installed Program, Listing the Contents of the Current Directory, Moving Files or Folders, Renaming Files on Your Pi, Restarting or Shutting Down Your Pi, Ten most useful Raspberry Pi commands

Post navigation

Previous Post: How to Find Your Raspberry Pi’s IP Address?
Next Post: SMSS.exe Windows process – What is it?

Related Posts

  • How To Quit Frozen Programs In Linux Linux Tips
  • 10 Cool Linux Terminal Commands You Have to Try Linux Tips
  • What is Sudo in Linux command? Linux
  • 5 Ways to Automate a File Backup in Linux Linux Tips
  • Create and Edit Zip Files In Linux Using The Terminal Linux Tips
  • An Introduction to Linux for Beginners Linux Tips

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • March 2021
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • December 2019
  • July 2019
  • May 2019
  • April 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018

Categories

  • AI Tools & Guides
  • Amazon Web Services
  • Apple Watch
  • Computer Tips
  • Cool Websites
  • Featured Posts
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • islamic Books
  • Linux
  • Linux Tips
  • Mac OS X
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Windows XP Tips
  • Wordpress
  • How to go Back to the old YouTube Layout (2013)
  • How to Bypass Chromecast DNS and Circumvent Geo Blocking
  • 5 Cool Websites to Find Good Movies and TV Shows on Netflix
  • SmartDNS vs VPN – What’s the Difference?
  • How to go Back to the old YouTube Layout (2017)
DMCA.com Protection Status

Recent Posts

  • How to Bypass Chromecast DNS and Circumvent Geo Blocking
  • 5 Cool Websites to Find Good Movies and TV Shows on Netflix
  • SmartDNS vs VPN “What’s the Difference?”
  • How to go Back to the old YouTube Layout (2013)
  • A Simple Trick to Get 50% Discount on Audible for Three Months

Recent Comments

  1. A Simple Trick to Get 50% Discount on Audible for Three Months on Private Browsing: What is it and What it is not
  2. 6 Best PayPal Alternatives (2017) on How to Save Money While Shopping Online in India
  3. Automatically Transcribe YouTube Video/Audio with Google Docs on 5 Best Team Management Apps (For Small and Large Teams)
  4. 6 Things You Need Know About Email Encryption on Delete All Emails from Gmail With Once Click
  5. Looking For YouTube Alternative? Try These 7 Video Sharing Sites on Ten Best YouTube Video Editing Software 2023
  • How to Make Animated Instagram Stories For Free technology
  • Cool New Features in Google Chrome v73 Google Software/Tips
  • How to Automatically Change Your Apple Watch Face Based on Time or Location Apple Watch
  • How To Log Out Of Facebook Messenger On iOS & Android Computer Tips
  • Remove the Desktop Cleanup Wizard from Windows 7 Windows 7
  • How to Make And Use Dropbox Paper Templates Computer Tips
  • Windows 7 Taskbar Not Showing Thumbnail Previews? Windows 7
  • How To Backup Your Android Phone And Tablet (No Root) How-To

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version