Posts

Showing posts with the label Linux Commands

Manage Packages on RPM Linux Distros With DNF

 In this tutorial, How to install and remove packages on RPM-based Linux Distros with DNF. DNF is the default package manager on Fedora and RHEL RHEL . when you run yum command on new Linux distros, it is actually using DNF in the background. Verify command below ls -l /usr/bin/yum The output the yum command is a symbolic link to dnf. Search package with DNF dnf search nginx get more infomation abount a certain package dnf info nginx List all packages installed your system. dnf list installed Installing package use DNF sudo dnf install nginx How to view all the dependencies installed of nginx dnf deplist nginx Uninstall package use DNF sudo dnf remove nginx DNF keeps a record of all transactions that involve installing or removing software packages dnf history Removing Unused Dependencies To remove such dependencies sudo dnf autoremove remove data downloaded along with installed packages. sudo dnf clean packages clean up your software package cache and other metadata that installed...

Run Multiple Commands in Linux

Image
In this tutorial, How to Run Multiple Commands in Linux Linux at Once. You will executing multiple Linux commands at one. On Linux, there are three ways to run multiple commands in terminal. 1. Using Logical OR (ll) operator The syntax command A || command B if command A runs successfully, command B won't execute. Command B will only execute if command A fails Example: sudo find /tmp -name devopsroles.com || touch huuphan.com The output terminal as below 2. Using the AND (&&) Operator The syntax command A && command B Command A runs successfully, If command B not error. Example: mkdir /tmp/devopsroles && cd /tmp The output terminal as below 3. Using the Semicolon(;) Operator The syntax command A ; command B Command A and command B run executed sequentially  The output terminal as below Conclusion Running multiple commands in Linux can significantly enhance your efficiency by allowing you to execute several tasks in a single command line. This tutorial cover...

How to check CPU in Linux

Image
Introduction When it comes to system performance and optimization, understanding the specifications and status of your CPU is paramount. Whether you're a system administrator managing servers or a developer fine-tuning applications, knowing how to check CPU information in Linux is a fundamental skill. In this guide, we'll walk you through various methods to retrieve detailed CPU information using command-line tools available in most Linux distributions. From basic CPU details to in-depth insights, you'll gain the knowledge to effectively monitor and assess the heart of your system's processing power. In today's tutorial, we'll guide you on checking your CPU in a Linux system. Follow these steps: Open the terminal on your Linux system. Type 'lscpu' and press enter to access detailed CPU information. For a quick overview, you can use 'cat /proc/cpuinfo'. If you want real-time CPU usage data, try the 'top' command. Learn about your CPU'...

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...

Master the curl command cheat sheet

Introduction Learn how to use the curl command like a pro with this in-depth guide. This cheat sheet covers everything from basic HTTP requests to advanced options, helping you make the most out of curl’s powerful features. The curl command is one of the most powerful and versatile tools available in the Linux command line for making HTTP requests and interacting with a wide range of protocols. Whether you're fetching data from a web server, uploading files via FTP, or simply testing an API, curl has got you covered. This guide aims to be your go-to resource for mastering the curl command, offering a detailed cheat sheet along with practical examples to help you understand and utilize its full potential. If you’ve ever found yourself lost in the myriad of curl options and flags, this article is for you. With over 1600 words of detailed explanations, you’ll walk away with the knowledge needed to leverage curl like a true Linux expert. Let’s dive in! What is Curl? Curl stands for Cl...