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

Run Multiple Commands in Linux

Image
In this tutorial, How to Run Multiple Commands in 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

How to check CPU in Linux

Image
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's architecture, cores, and clock speed. This knowledge helps optimize system performance. Understanding your CPU is key for effective troubleshooting. Armed with this information, you can make informed decisions for a smoother Linux experience. Happy exploring!" Check CPU in Linux  Retrieve CPU details using the 'cat' command. $ cat /proc/cpuinfo View CPU architecture information using the 'lscpu' command. $ lscpu The terminal output is as follows: use cpuid command show x86 CPU $ cpuid display Linux hardware information $ sudo dmidecode processor type Inxi tool command to display Linux system in

Display Date and Time for each Command in Bash History

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  

curl command cheat sheet

In this tutorial, I have compiled a comprehensive curl command cheat sheet. Curl is a powerful command-line tool for making HTTP requests and working with various protocols. The cheat sheet is designed to serve as a quick reference guide, providing concise and organized information on the essential curl commands. Whether you're a beginner or an experienced user, this resource aims to simplify the usage of curl commands, helping you navigate and leverage its capabilities efficiently. Feel free to explore the cheat sheet and enhance your proficiency in utilizing curl for various web-related tasks. curl command cheat sheet Option -o <file>       # --output: write to file -u user:pass  # --user: Authentication -v                  # --verbose -s                  # --silent -I                  # --head: headers only -i                  # --include: Include the HTTP-header in the output Request -X POST          # --request -L                     # follow link if page redirects -F