Skip to content

Keycode

More flesh, less fluff.

Category: Linux

Check installation path of a package using rpm

rpm -ql <package>
Author pashanhuPosted on 13/08/2025Categories LinuxTags rpmLeave a comment on Check installation path of a package using rpm

Check package version using rpm

rpm -qa *intel*
rpm -qa | sort | grep intel
Author pashanhuPosted on 13/08/202513/08/2025Categories LinuxTags rpmLeave a comment on Check package version using rpm

Batch process all files in a folder

#!/bin/bash
for file in <path>/*; do
dcm2pnm "$file" "$file".png --write-png
done
Author pashanhuPosted on 13/08/2025Categories LinuxLeave a comment on Batch process all files in a folder

Count the number of files in a directory

ls -l | wc -l

wc: word count

Author pashanhuPosted on 13/08/202513/08/2025Categories LinuxLeave a comment on Count the number of files in a directory

Check Linux OS version

cat /etc/os-release
Author pashanhuPosted on 13/08/2025Categories LinuxLeave a comment on Check Linux OS version

Search installed packages using rpm

rpm -qa --last  | grep <something>
Author pashanhuPosted on 13/08/202513/08/2025Categories LinuxTags rpmLeave a comment on Search installed packages using rpm

Check where python packages are installed in a docker

Usually here:

/usr/local/lib/<python version>/site-packages

Or

pip show request <package name>
Author pashanhuPosted on 13/08/202513/08/2025Categories Linux, PythonTags virtual environmentLeave a comment on Check where python packages are installed in a docker

Check libraries related to a binary

ldd /usr/local/bin/<name>* | grep <something>
Author pashanhuPosted on 13/08/2025Categories LinuxTags lddLeave a comment on Check libraries related to a binary

Solution to “Another app is currently holding the yum lock; waiting for it to exit”

cat /var/run/yum.pid
<pid>

kill -9 <pid>

To get more details, use

ps -p <pid>

or

ps -ef | grep <pid>
Author pashanhuPosted on 02/04/2022Categories LinuxTags LinuxLeave a comment on Solution to “Another app is currently holding the yum lock; waiting for it to exit”

Delete files owned by a specific user on Linux

Delete all txt files:

find ~/testFolder/*.txt -user @USERNAME -exec rm {} \;

Note, the semicolon is necessary.

Delte all files and directories:

find ~/testFolder/ -user @USERNAME -exec rm -rf {} \;

But be careful using “-rf”.

Author pashanhuPosted on 24/05/2020Categories LinuxTags find, rm, userLeave a comment on Delete files owned by a specific user on Linux

Posts pagination

Page 1 Page 2 Next page

Recent Posts

  • Check installation path of a package using rpm
  • Check package version using rpm
  • Batch process all files in a folder
  • Count the number of files in a directory
  • Check Linux OS version

Recent Comments

No comments to show.
  • August 2025
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • August 2021
  • November 2020
  • October 2020
  • June 2020
  • May 2020
  • February 2020
  • October 2019
  • September 2019
  • August 2019
  • Algorithm
  • Boost
  • C/C++
  • Debug
  • git
  • GitHub
  • Image/Graphics
  • Java
  • Linux
  • Node.js
  • Other
  • Python
  • Qt
  • Swift
Keycode Proudly powered by WordPress