DEV Community 👩‍💻👨‍💻

Cover image for RHEL / Ubuntu Useful Command
Yassine Sellami
Yassine Sellami

Posted on • Updated on

RHEL / Ubuntu Useful Command

== [ All Distributions ] ==

-- Find Linux Standard Base (LSB) information
lsb_release -a

-- Check if virtualization is supported on Linux,The output must be not empty:
grep -E --color 'vmx|svm' /proc/cpuinfo

## Archive management
-- unzip 
unzip file.zip
unzip -d /path/to/extract/ file.zip

-- zip


Enter fullscreen mode Exit fullscreen mode

== [ Redhat ] ==

  • Sys information
-- Redhat sys information
cat /etc/redhat-release~

## Audit 
-- install
yum install audit
-- config
vi /etc/audit/auditd.conf
-- starting
service auditd start
-- reporting
aureport --start 04/04/2022 00:00:00 --end 04/06/2022 00:00:00


Enter fullscreen mode Exit fullscreen mode
  • Network
-- ifconfig
yum install net-tools
ifconfig
-- Ip
ip addr
-- Check for open ports, 3 way
sudo lsof -i tcp
netstat -tulpn 
sudo ss -lt


Enter fullscreen mode Exit fullscreen mode

== [ Ubuntu ] ==

  • Sys information
-- Find which WM_CLASS your window has,used as value in StartupWMClass on .desktop files to ignore duplication
xprop WM_CLASS

Enter fullscreen mode Exit fullscreen mode
  • Soft management
--- How to execute .bin .run file
chmod +x my_ide.run
./my_ide.run

-- add application icon to menu (dockbar)
cd /usr/share/applications (Global) 
cd ~/.local/share/applications/ (Local)
vi my_app.desktop
......
[Desktop Entry]
Comment=LiferayStudio
Terminal=false
Name=Liferay DXP Studio
Encoding=UTF-8
Exec='/opt/tools/liferay-developer-studio/DeveloperStudio'
Type=Application
Icon=/opt/tools/liferay-developer-studio/icon.xpm
StartupWMClass=LiferayDeveloper
......

Enter fullscreen mode Exit fullscreen mode
  • User management:
-- Get a List of All Users
less /etc/passwd
-- Add user to group
sudo usermod -aG [GROUP] [USER]
ex: sudo usermod -aG docker ${USER} => add your user to docker group
-- Login to specific user 
su - [USER]

Enter fullscreen mode Exit fullscreen mode
  • User Interface (UI/UX)
-- Minimize & Maximize buttons in Gnome
Separation by `:`
Left:
gsettings set org.gnome.desktop.wm.preferences button-layout "close,minimize,maximize:"
Right: ":minimize,maximize,close"
Mix: "close:minimize,maximize"

Enter fullscreen mode Exit fullscreen mode

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Just kidding, it's a personal preference. But you can change your theme, font, etc. in your settings.

The more you know. 🌈