Blog_Banner_Asset
    Homebreadcumb forward arrow iconBlogbreadcumb forward arrow iconArtificial Intelligencebreadcumb forward arrow iconRaspberry Pi Commands: General, Networking, Internet, File & System Information

Raspberry Pi Commands: General, Networking, Internet, File & System Information

Last updated:
18th Dec, 2020
Views
Read Time
6 Mins
share image icon
In this article
Chevron in toc
View All
Raspberry Pi Commands: General, Networking, Internet, File & System Information

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

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

Ads of upGrad blog

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. 

Ads of upGrad blog

Popular AI and ML Blogs & Free Courses

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 about Raspberry Pi, machine learning, check out IIIT-B & upGrad’s PG Diploma in Machine Learning & AI which 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.

Profile

Pavan Vadapalli

Blog Author
Director of Engineering @ upGrad. Motivated to leverage technology to solve problems. Seasoned leader for startups and fast moving orgs. Working on solving problems of scale and long term technology strategy.
Get Free Consultation

Selectcaret down icon
Select Area of interestcaret down icon
Select Work Experiencecaret down icon
By clicking 'Submit' you Agree to  
UpGrad's Terms & Conditions

Our Popular Machine Learning Course

Frequently Asked Questions (FAQs)

1What are the limitations of using the Raspberry Pi?

Since the Raspberry Pi lacks an internal hard drive, it relies on an SD card to store its data. On the Raspberry Pi, it is not feasible to perform all of the things that a desktop computer can do. It lacks heat sinks, which makes it susceptible to overheating. Crashing and bug faults have also been reported by users. Other operating systems, such as Windows, are incompatible with it.

2What are the pros of using the Raspberry Pi?

Since the Raspberry Pi has a large number of GPIO pins, it can accommodate numerous sensors at once. It has a speedier CPU, which guarantees that it will perform well. It is appropriate for small businesses because it requires little expenditure to operate. The Raspberry Pi does not require much programming knowledge, making it incredibly user-friendly.

3What is meant by Noobs Raspberry?

NOOBS is a Raspberry Pi-developed OS installation software. It comes with a pre-installed operating system for the Raspberry Pi. LibreElec, a stripped-down version of Linux with the Kodi media center software installed, is also included on the NOOBS card. NOOBS allows users to install and reinstall one or more operating systems, as well as set the default operating system. NOOBS includes the Raspberry Pi OS and LibreELEC operating systems. It also offers a variety of alternative operating systems that can be downloaded and installed from the internet.

Explore Free Courses

Suggested Blogs

Artificial Intelligence course fees
5455
Artificial intelligence (AI) was one of the most used words in 2023, which emphasizes how important and widespread this technology has become. If you
Read More

by venkatesh Rajanala

29 Feb 2024

Artificial Intelligence in Banking 2024: Examples & Challenges
6191
Introduction Millennials and their changing preferences have led to a wide-scale disruption of daily processes in many industries and a simultaneous g
Read More

by Pavan Vadapalli

27 Feb 2024

Top 9 Python Libraries for Machine Learning in 2024
75652
Machine learning is the most algorithm-intense field in computer science. Gone are those days when people had to code all algorithms for machine learn
Read More

by upGrad

19 Feb 2024

Top 15 IoT Interview Questions & Answers 2024 – For Beginners & Experienced
64477
These days, the minute you indulge in any technology-oriented discussion, interview questions on cloud computing come up in some form or the other. Th
Read More

by Kechit Goyal

19 Feb 2024

Data Preprocessing in Machine Learning: 7 Easy Steps To Follow
153042
Summary: In this article, you will learn about data preprocessing in Machine Learning: 7 easy steps to follow. Acquire the dataset Import all the cr
Read More

by Kechit Goyal

18 Feb 2024

Artificial Intelligence Salary in India [For Beginners & Experienced] in 2024
908781
Artificial Intelligence (AI) has been one of the hottest buzzwords in the tech sphere for quite some time now. As Data Science is advancing, both AI a
Read More

by upGrad

18 Feb 2024

24 Exciting IoT Project Ideas & Topics For Beginners 2024 [Latest]
760561
Summary: In this article, you will learn the 24 Exciting IoT Project Ideas & Topics. Take a glimpse at the project ideas listed below. Smart Agr
Read More

by Kechit Goyal

18 Feb 2024

Natural Language Processing (NLP) Projects & Topics For Beginners [2023]
107770
What are Natural Language Processing Projects? NLP project ideas advanced encompass various applications and research areas that leverage computation
Read More

by Pavan Vadapalli

17 Feb 2024

45+ Interesting Machine Learning Project Ideas For Beginners [2024]
328409
Summary: In this Article, you will learn Stock Prices Predictor Sports Predictor Develop A Sentiment Analyzer Enhance Healthcare Prepare ML Algorith
Read More

by Jaideep Khare

16 Feb 2024

Schedule 1:1 free counsellingTalk to Career Expert
icon
footer sticky close icon