Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

Wednesday, December 9, 2020

Display system info with neofetch

neofetch is a Terminal-based tools to displays information about your operating system, software and hardware in visual way.

To install neofetch to Raspberry Pi OS, enter the command:

$ sudo apt install neofetch



Friday, December 4, 2020

Test network speed between Raspberry Pi using iPerf3

iPerf3 is a tool for active measurements of the maximum achievable bandwidth on IP networks. It supports tuning of various parameters related to timing, buffers and protocols (TCP, UDP, SCTP with IPv4 and IPv6). For each test it reports the bandwidth, loss, and other parameters.

This post show how to run iPerf3 on two Raspberry Pi to check the network speed between.

On both Raspberry Pi, install iPerf3 by entering command in Terminal:

$ sudo apt install iperf3
After installed.

In the service side, enter the command:
$ iperf3 -s
In the client side, enter command:
$ iperf3 -c <server ip>




Tuesday, December 1, 2020

Check installed package in Raspberry Pi OS, using dpkg/dpkg-query

To list all installed packages, enter the command in Terminal:

$ dpkg -l

or

$ dpkg-query -l

To list about a specified package:

$ dpkg -l package-name-pattern

or

$ dpkg-query -l package-name-pattern



dpkg is a tool to install, build, remove and manage Debian packages. It can also be used as a front-end to dpkg-deb and dpkg-query. 

dpkg-query is a tool to show information about packages listed in the dpkg database.

With command "-l [package-name-pattern...]" list all known packages matching one or more patterns. If no package-name-pattern is given, list all packages in /usr/local/var/lib/dpkg/status, excluding the ones marked as not-installed (i.e.  those which have been previously purged).

The first three columns of the output show the desired action, the package status, and errors, in that order.

              Desired action:
                u = Unknown
                i = Install
                h = Hold
                r = Remove
                p = Purge

              Package status:
                n = Not-installed
                c = Config-files
                H = Half-installed
                U = Unpacked
                F = Half-configured
                W = Triggers-awaiting
                t = Triggers-pending
                i = Installed

              Error flags:
                <empty> = (none)
                R = Reinst-required




Tuesday, May 19, 2020

pinout command, to query Raspberry Pi GPIO pin-out information.

In update Raspbian, the pinout command was added. It's a funny and informative utility for querying Raspberry Pi GPIO pin-out information.

$ pinout


Related:
How to check Raspberry Pi 4B reversion 1.2, it provide more option to check your board version.


Check model and revision of your Raspberry Pi board

With the upadte Raspbian, you can read model and rev. of your Raspberry Pi board in /proc/device-tree/model. Enter the command in terminal:

cat /proc/device-tree/model


Related:
How to check Raspberry Pi 4B reversion 1.2, it provide more option to check your board version.

Wednesday, February 20, 2019

Check glibc version

To check the glibc version in Raspberry Pi/Raspbian, simple enter the command in Terminal:

$ ldd --version

Work on Raspberry Pi/Raspbian:

Also work on Linux Mint:

Tuesday, February 19, 2019

Identify my Raspberry Pi board version

To identify the version of your Raspberry Pi, you can enter the command:

$ cat /proc/cpuinfo

The last three lines show the hardware type, the revision code, and the Pi's unique serial number.


Then browse Raspberry Pi DOCUMENTATION > HARDWARE > RASPBERRYPI > REVISION-CODES. You can search your hardware revision to find out the version of you board.

My board is Raspberry Pi 3 B+



Related:
How to check Raspberry Pi 4B reversion 1.2, it provide more option to check your board version.

Thursday, March 10, 2016

Display WiFi config using Linux command iwconfig


Iwconfig is similar to ifconfig(8), but is dedicated to the wireless interfaces. It is used to set the parameters of the network interface which are specific to the wireless operation (for example : the frequency). Iwconfig may also be used to display those parameters, and the wireless statistics (extracted from /proc/net/wireless).

All these parameters and statistics are device dependent. Each driver will provide only some of them depending on hardware support, and the range of values may change. Please refer to the man page of each device for details.

This video show iwconfig run on Raspberry Pi 3/Raspbian Jessie with build-in WiFi, to display WiFi info:


We can get WiFi link quality with command:
$ iwconfig wlan0 | grep -i quality



Sunday, September 27, 2015

Search for available package, and know the version before install

apt-cache is a low-level tool used to query information from APT's binary cache files.


You can search available package with"
$ apt-cache search package


or know the details of the package; such as version
$ apt-cache show package


Wednesday, April 8, 2015

Python to get uptime of Raspberry Pi, in second

In linux, the command "$ cat /proc/uptime" shows how long the system has been on since it was last restarted. ~ http://en.wikipedia.org/wiki/Uptime#Using_uptime


This Python example code get uptime in second, run on Raspberry Pi:
import os

uptime = os.popen("awk '{print $1}' /proc/uptime").readline()
print("uptime(sec) = "+uptime)


Wednesday, April 1, 2015

List all Linux command available - compgen

To list all available Linux command can be run:
$ compgen -c

To list all command start with "ls"
$ compgen -c ls

To list all command contain the letters "ls"
$ compgen -c | grep ls



Wednesday, March 25, 2015

How to list info of installed package

dpkg-query is a tool to show information about packages listed in the dpkg database.

Examples:



How to know the current Overclock setting

To know the current Overclock setting on Raspbian, enter the command:
$ cat /boot/config.txt


For more options and information see http://www.raspberrypi.org/documentation/configuration/config-txt.md



Tuesday, March 17, 2015

Read CPUs frequency of Raspberry Pi 2

There are 4 cpu core on Raspberry Pi 2. ls /sys/devices/system/cpu show 4 cpu, cpu0~cpu3. The files hold the scaling current frequency of each cpu.
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq

Tested on Raspberry Pi 2, running Raspbian.


Related:

Get CPU load from /proc/loadavg

/proc
The proc filesystem is a pseudo-filesystem which provides an interface to kernel data structures.  It is commonly mounted at /proc.  Most of it is read-only, but some files allow kernel variables to be changed.

/proc/loadavg
The first three fields in this file are load average figures giving the number of jobs in the run queue (state R) or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.  They are the same as the load average numbers given by uptime(1) and other programs.  The fourth field consists of two numbers separated by a slash (/).  The first of these is the number of currently runnable kernel scheduling entities (processes, threads).  The value after the slash is the number of kernel scheduling entities that currently exist on the system.  The fifth field is the PID of the process that was most recently created on the system.

reference: http://man7.org/linux/man-pages/man5/proc.5.html

Test on Raspberry Pi running Raspbian.


Related:
Python display Raspberry Pi load average graphically

Monday, March 16, 2015

View dynamic system info with Linux command top and htop

$ top

The top program provides a dynamic real-time view of a running system. It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel. The types of system summary information shown and the types, order and size of information displayed for processes are all user configurable and that configuration can be made persistent across restarts.

The program provides a limited interactive interface for process manipulation as well as a much more extensive interface for personal configuration--encompassing every aspect of its operation. And while top is referred to throughout this document, you are free to name the program anything you wish. That new name, possibly an alias, will then be reflected on top's display and used when reading and writing a configuration file.


$ htop

Htop is a free (GPL) ncurses-based process viewer for Linux.

It is similar to top, but allows you to scroll vertically and horizontally, so you can see all the processes running on the system, along with their full command lines.

Tasks related to processes (killing, renicing) can be done without entering their PIDs.

To install htop, enter the command:
$ sudo apt-get install htop




Tuesday, March 10, 2015

Sunday, December 28, 2014

scp copy folder

Linux command scp option -r recursively copy entire directories.  Note that scp follows sym‐bolic links encountered in the tree traversal.


To copy folder from Linux host to Raspberry Pi (or any Linux machine) user home, enter the command:
$ scp -r testscp pi@192.168.1.107:

where testscp is the folder to be copied.

or
$ scp -r testscp pi@192.168.1.107:newfolder

where newfolder will be created.


Wednesday, October 22, 2014

Linux command tree, list contents of directories in a tree-like format

The Linux command tree list contents of directories in a tree-like format.

To install trr on Raspberry Pi, enter the command:
$ sudo apt-get install tree