Showing posts from October, 2021

Display Date and Time for each Command in Bash History

 In this tutorial, How to list command display date and time command previously typed in Bash History. The Bash shell provides the command history. Display Date and Time for each Command in Bash History. The default history command $ history The output terminal as below Set time stamps in bash history Define the environment variable name $ HISTTIMEFORMAT="%d/%m/%y %T " The output as below   Or your add ~/.bash_profile file $ echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bash_profile $ cd $ source ~/.bash_profile The output terminal as below   To retrieve Linux bash command line history $ history  The output terminal as below  

Setup a Raspberry Pi Static IP Address

 In this tutorial, I use Raspbian operating system. How to setup a Raspberry Pi Static IP Address. Recommended Raspberry Pi Micro SD Card Power Supply Ethernet Cord or WiFi dongle (The Pi 3 and 4 has WiFi inbuilt) Step 1: we will first need to retrieve some information about your network ip r | grep default Step 2 : Retrieve the current DNS server and opening up the “resolv.conf” configuration file sudo nano /etc/resolv.conf Setting nameserver alternative DNS – such as for Google, or for Cloudflare. Step 3: modify the way the Raspberry Pi handles the network. sudo nano /etc/dhcpcd.conf Add lines as below: interface <NETWORK> static ip_address=<STATICIP>/24 static routers=<ROUTERIP> static domain_name_servers=<DNSIP> • NETWORK – your network connection type: eth0 (Ethernet) or wlan0 (wireless). • STATIC_IP – the static IP address you want to set for the Raspberry Pi. • ROUTER_IP – the gateway IP address for your router on the local network. • D