Using RPM queryformat will allow you to return just the columns of information that you desire. There's 190 different RPM query format tags that you can specify. You can use query format to show only names and version of packages or even contents of package metadata arrays. You can add query format modifies to convert raw data formats for dates and permissions to more readable output as well.
- [Instructor] Querying the RPM database…can be very powerful.…If, however, we want to present…the information in a certain format,…we might want to change the fields that are returned.…All packages have tags that we can show or hide.…To get a list of all tags,…in a terminal type in rpm…space --querytags…and hit Enter.…My CentOS installation lists nearly 190 different tags.…You get to decide what you want printed on the screen…just by choosing the tags.…Type in clear to clear your screen.…
If I wanted to show the package name and version…but nothing else,…I could do rpm space -qa…space --queryformat…space…double quote, percent,…left curly bracket, NAME in uppercase,…right curly bracket, space,…percent, left curly bracket,…VERSION in uppercase, right curly bracket,…\n, double quote.…To use the tags we need to surround them…with a percent symbol and curly brackets.…
For this example, I'm querying…all files in the database with the -qa option.…Then I'm specifying a query format of name and version.…Notice at the end of the line…
Author
Released
8/31/2017Instructor Grant McWilliams covers network and internet services administration, kernel management, and intrusion prevention. He shows how to make your systems more efficient with virtualization, manage users and groups, and lock everything down with SELinux mandatory access control. Plus, get access to 25 PDF "cheat sheets" and 100 practice questions so you can solidify and test your knowledge.
- Installing Linux on a physical machine
- Managing systemd services
- Managing reoccurring jobs with cron
- Limiting system access
- Configuring networking
- Creating, editing, and moving files and directories
- Analyzing text with grep and regular expressions
- Installing software and packages
- Managing the kernel
- Managing users, accounts, and groups
- Setting permissions
- Using access control lists
- Securing Linux with SELinux
- Accessing Linux remotely
- Configuring local storage
Skill Level Intermediate
Duration
Views
Related Courses
-
Setting Up a Red Hat Enterprise Linux Server
with Sandra Toner2h 46m Intermediate -
Linux: Desktops and Remote Access
with Grant McWilliams1h 44m Intermediate
-
Introduction
-
Welcome57s
-
What you should know3m 45s
-
About Red Hat Certifications2m 52s
-
-
1. Deploy Systems
-
Managing virtual machines6m 42s
-
2. System Config and Services
-
Get systemd service status3m 56s
-
Manage systemd services2m 33s
-
Configure networking3m 52s
-
Manage one-time jobs with at4m 16s
-
3. Essential Tools
-
Archive files using tar4m 40s
-
Compress files and archives4m 14s
-
Create files and directories5m 18s
-
Copy files and directories5m 48s
-
Move files and directories4m 59s
-
Create hard and soft links4m 55s
-
Introduction to vim3m 33s
-
Editing text with vim2m 45s
-
Reading the system journal3m 26s
-
4. Manage System Software
-
Query with RPM7m 14s
-
RPM query formatting6m 5s
-
Overview of yum2m 20s
-
Get info on package groups5m 15s
-
Search for packages1m 47s
-
Install and remove packages6m 59s
-
Manage OS updates6m 48s
-
Update the kernel4m 29s
-
Manage kernel modules5m 18s
-
5. Users and Accounts
-
Modify local user accounts4m 57s
-
6. File Access Control
-
File and directory modes1m 19s
-
Read access control lists3m 36s
-
Set access control lists5m 49s
-
Delete access control Lists4m 15s
-
-
7. Manage Security
-
Manage firewalls3m 15s
-
8. Accessing Linux Remotely
-
Configure Secure Shell2m 36s
-
-
9. Configure Local Storage
-
Conclusion
-
Next steps1m 20s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: RPM query formatting