Raspberry Pi Commands: General, Networking, Internet, File & System Information | upGrad blog (2024)

The Raspberry Pi is an easy, charge card measured PC that connects to a PC screen or TV, and utilises a standard console and mouse. It is an able little gadget that empowers individuals, all things considered, to investigate processing, and to figure out how to program in dialects like Scratch and Python.

Top Machine Learning and AI Courses Online

To Explore all our certification courses on AI & ML, kindly visit our page below.
Machine Learning Certification

What is Raspberry Pi?

Getting your Raspberry Pi ready for action is pretty simple—and whatever venture you’re doing, there’s presumably a guide that can walk you through the cycle. Be that as it may, a couple of devices and terminal commands you’ll use in pretty much every Pi attempt.

Trending Machine Learning Skills

AI Courses Tableau Certification
Natural Language Processing Deep Learning AI

Enrol for the Machine Learning Course from the World’s top Universities. Earn Masters, Executive PGP, or Advanced Certificate Programs to fast-track your career.

Since most Pi ventures run on Linux, having some command-line hacks makes the Pi a lot simpler to work with. In any case, regardless of whether you’re not a Linux veteran, these commands can encourage you a great deal as you tinker, so it’s a smart thought to get comfortable with them now.

What are the Raspberry Pi Commands?

The Raspberry Pi is an easy, charge card measured PC that connects to a PC screen or TV, and utilises a standard console and mouse. It is an able little gadget that empowers individuals, all things considered, to investigate processing, and to figure out how to program in dialects like Scratch and Python.

How would I utilise the Raspberry Pi command line?

Open Raspberry Pi Configuration (Menu > Preferences > Raspberry Pi Configuration). Change the Boot setting ‘To CLI’ and snap OK. Presently when you reboot, you’ll start in the command line (enter startx to boot into the work area).

General Commands

apt-get update: Updates the rundown of bundles on your framework to the rundown in the vaults. Use it before putting in new bundles to ensure you are introducing the most recent form.

apt-get upgrade: Redesigns the entirety of the product bundles you have introduced.

startx: Opens the Graphical User Interface.

clear: Clears recently run orders and text from the terminal screen.

date: Prints the current date.

find / -name text1.txt: Searches the whole system for the file text1.txt and outputs a list of all directories that contain the file.

reboot: To reboot immediately.

nano text.txt: Opens the file text.txt in the Linux text editor Nano.

poweroff: To shutdown immediately.

raspi-config: Opens the configuration settings menu.

shutdown -h now: To shutdown immediately.

shutdown -h 11:11: To shutdown at 11:11 AM.

File And Directory Commands

mv YYY: Moves the file or directory named YYY to a specified location.

rm text.txt: Deletes the file text.txt.

rmdir a_directory: Deletes(if it is empty) the directory a_directory .

cat text.txt: Displays the contents of the file text.txt.

cd /abc/xyz: Changes the current directory to the /abc/xyz directory.

cp XXX: Copies the file or directory XXX and pastes it to a specified location

mkdir text_directory: Creates a new directory named text_directory inside the current directory.

scp user@10.1.1.30:/some/path/ftext.txt: Copies a file over SSH. Can be used to download a file from a PC to the Raspberry Pi. user@10.1.1.30 is the username, and local IP address of the PC, and /some/path/text.txt is the path and file name of the file on the PC.

touch text.txt: Creates a new, empty file named text.txt in the current directory.

ls -l: Lists files in the current directory, along with file size, date modified, and permissions.

Networking and Internet Commands

ifconfig: To check the status of the remote association you are utilising (to check whether wlan0 has obtained an IP address).

ping: Tests availability between two gadgets associated with an organisation. For instance, ping 10.0.0.32 will send a parcel to the gadget at IP 10.0.0.32 and sit tight for a reaction. It additionally works with site addresses.

wget http://www.website.com/text.txt: Downloads the file text.txt from the web and saves it to the current directory.

iwconfig: To check which network the wireless adapter is using.

iwlist wlan0 scan: Prints a list of the currently available wireless networks.

iwlist wlan0 scan | grep ESSID: Use grep along with the name of a field to list only the fields you need

Nmap: Sweeps your organisation and records associated gadgets, port number, convention, state (open or shut) working framework, MAC addresses, and other data.

Also Read: Raspberry Pi Project Ideas

System Information Commands

cat /proc/meminfo: Shows details about your memory.

cat /proc/partitions: Shows the size and number of partitions on your SD card or hard drive.

cat /proc/version: Shows you which version of the Raspberry Pi you are using.

df -h: Shows information about the available disk space.

free: Shows how much free memory is available.

hostname -I: Shows the IP address of your Raspberry Pi

lsusb: Lists USB hardware connected to your Raspberry Pi

UP key: Pressing the UP key will print the last command entered into the command prompt. This is a quick way to repeat previous commands or make corrections to commands.

df /: Shows how much free disk space is available.

Must Read: Raspberry Pi IoT Projects

vcgencmd measure_temp: Shows the temperature of the CPU.

vcgencmd get_mem arm && vcgencmd get_mem gpu: Shows the memory split between the CPU and GPU.

dpkg – -get-selections | grep XXX: Shows all of the installed packages that are related to XXX.

dpkg – -get-selections: Shows all of your installed packages.

Each command can do a lot more of what I have shown here. To check out what more it can do, try “–help” after the command.

Popular AI and ML Blogs & Free Courses

Machine Learning Tutorial: Learn ML
Robotics Engineer Salary in India : All Roles A Day in the Life of a Machine Learning Engineer: What do they do? What is IoT (Internet of Things)
Permutation vs Combination: Difference between Permutation and Combination Machine Learning with R: Everything You Need to Know
AI & ML Free Courses
Introduction to NLP Fundamentals of Deep Learning of Neural Networks Linear Regression: Step by Step Guide
Artificial Intelligence in the Real World Introduction to Tableau Case Study using Python, SQL and Tableau

Conclusion

For some individuals, command-line access on any stage is scary. The helpful commands recorded here are an endeavour to give the Raspberry Pi newcomer the absolute minimum, to begin with, the terminal, a little stepping stone to progress with whichever Pi venture they choose to begin.

Also, If you’re interested to learn more aboutRaspberry Pi,machine learning, check out IIIT-B & upGrad’swhich is designed for working professionals and offers 450+ hours of rigorous training, 30+ case studies & assignments, IIIT-B Alumni status, 5+ practical hands-on capstone projects & job assistance with top firms.

Raspberry Pi Commands: General, Networking, Internet, File & System Information | upGrad blog (2024)

FAQs

How do I find the network information of my Raspberry Pi? ›

Using the Terminal
  1. Turn on your Raspberry Pi, and make sure it's connected to a network.
  2. Open a terminal on your Pi.
  3. Enter the command hostname -I in the terminal.
  4. Your Pi's IP address is the first part of the output: it will contain four numbers separated by periods, like so: 192. xx. x.x.
Jul 21, 2022

How do I find system information on Raspberry Pi? ›

To find out about your Raspberry Pi's hardware, enter the following: cat /proc/cpuinfo.

What is the general information about Raspberry Pi? ›

They grow best in places that have cool summers, and mild winters. Raspberries are a great source of fiber. Fiber helps keep our heart healthy and improve digestion. Raspberries also contain antioxidants which help decrease risk for cancer and heart disease.

How to find IP address of Raspberry Pi command line? ›

At the command prompt, enter ifconfig . The inet parameter on the second line displays the IP address of the board.

How do I connect to Raspberry Pi network? ›

If you want to connect the Pi to the internet via Ethernet, use an Ethernet cable to connect the Ethernet port on the Raspberry Pi to an Ethernet socket on the wall or on your internet router. You don't need to do this if you want to use wireless connectivity, or if you don't want to connect to the internet.

How to check system information in command? ›

Put on your (helpful) hacker hat and type Windows + R to bring up your computer's Run window. Enter cmd and press Enter to open the Command Prompt window. Type the command line systeminfo and press Enter. Your computer will show you all the specs for your system — just scroll through the results to find what you need.

How do I find my full system information? ›

How to check PC specs on Windows 10
  1. Click on the Windows icon in the bottom left corner.
  2. Click the Settings (gear) icon.
  3. Select System.
  4. On the left-hand side, select About.
  5. You'll find a range of data about your device and specifications.

How do I view full system information? ›

To check your PC hardware specs, click on the Windows Start button, then click on Settings (the gear icon). In the Settings menu, click on System. Scroll down and click on About. On this screen, you should see specs for your processor, Memory (RAM), and other system info, including Windows version.

How do I give Raspberry Pi commands? ›

Command Line for the Raspberry Pi
  1. pwd Print Working Directory. The shell command pwd displays the file path from the root directory to the current working directory. ...
  2. mkdir Make Directory. ...
  3. ls List. ...
  4. cd Change Directory. ...
  5. Filesystem Structure. ...
  6. The Command Line. ...
  7. cp Copy. ...
  8. Command Options.

What is the top command on a Raspberry Pi? ›

By running 'top' in the Terminal window, you will get an overview of running processes related to RAM, GPU and CPU. This can help you identify tasks that may be using too much memory or other system resources and causing performance issues. To exit 'top', press CTRL+C on your keyboard.

What is the password for Raspberry Pi command line? ›

Go to Menu | Preferences | Raspberry Pi Configuration . Under the System tab, select Change Password . Launch the command-line terminal and enter passwd at the prompt. It will prompt you for the current password of the Raspberry Pi desktop followed by the new password.

What is the primary purpose of the Raspberry Pi? ›

The Raspberry Pi was designed to be a low-cost, low-power device that can be used for a variety of purposes, including: Teaching basic computer science: The Raspberry Pi is often used in schools and educational settings to introduce students to the basics of computer science and programming.

What is Raspberry Pi example? ›

The Raspberry Pi is a type of single-board computer (SBC), meaning that its entire hardware set is placed on a single electronics board. There are no CPU sockets, memory slots or extension buses, such as Peripheral Component Interconnect Express, or PCIe, to swap out or add components.

What is the default IP address of a Raspberry Pi? ›

After the IP setting is confirmed, you can enter the default IP of the Raspberry Pi: 192.168. 0.100 in the web address bar in the computer browser, and you can directly access the Raspberry Pi running backstage and change the information. The above are the three ways to access the Raspberry Pi IP correctly.

How do I find the IP address of my headless Raspberry Pi? ›

Find the Raspberry Pi's IP Address

Open up your wireless router's configuration page (for example, by typing in 192.168. 1.1 into a browser window). From there, find your router's DHCP lease table and make a note of your Raspberry Pi's IP address.

Top Articles
Latest Posts
Article information

Author: Melvina Ondricka

Last Updated:

Views: 6227

Rating: 4.8 / 5 (68 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Melvina Ondricka

Birthday: 2000-12-23

Address: Suite 382 139 Shaniqua Locks, Paulaborough, UT 90498

Phone: +636383657021

Job: Dynamic Government Specialist

Hobby: Kite flying, Watching movies, Knitting, Model building, Reading, Wood carving, Paintball

Introduction: My name is Melvina Ondricka, I am a helpful, fancy, friendly, innocent, outstanding, courageous, thoughtful person who loves writing and wants to share my knowledge and understanding with you.