Posts

Showing posts from October, 2021

Display Date and Time for each Command in Bash History in Linux

Image
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   Conclusion Displaying the date and time for each command in Linux Linux can be invaluable for monitoring and debugging purposes. By using the HISTTIMEFORMAT variable, you can easily prepend timestamps to your command history, providing a clear record of when each command was executed. This simple yet powerful feature enhances...

Setup a Raspberry Pi Static IP Address

Image
Introduction The Raspberry Pi is an incredibly versatile single-board computer beloved by hobbyists and professionals alike. Setting up a static IP address for your Raspberry Pi is crucial when using it as a server, IoT hub, or for any application requiring consistent network access. This guide provides a comprehensive, user-friendly walkthrough to help you establish a static IP address and ensure reliable connectivity. Why Setup a Static IP Address? A static IP address offers several benefits, including: Reliable Access : Ensures your Raspberry Pi is always reachable at the same IP. Network Stability : Reduces conflicts in DHCP environments. Ease of Configuration : Simplifies the management of devices connected to your network. If your Raspberry Pi hosts services like a web server or VPN, a static IP address is essential for uninterrupted functionality. Prerequisites Before you begin, ensure you have: A Raspberry Pi with Raspberry Pi OS installed. SSH access to your Raspberry Pi (or a...