RHEL
pwd→ Show current directoryls→ List filesls -l→ Long listingls -a→ Show hidden filescd /home→ Change directorycd ..→ Go up one levelmkdir test→ Create directoryrmdir test→ Remove empty directorytouch file.txt→ Create empty filecp file1 file2→ Copy filemv file1 file2→ Move/rename filerm file.txt→ Delete filerm -r dir→ Delete directory recursivelyfind / -name file.txt→ Search filetree→ Show directory treewhoami→ Show current userid→ Show user ID infowho→ Show logged-in usersw→ Show active usersadduser user1→ Add userpasswd user1→ Set passwordusermod -aG wheel user1→ Add user to groupgroups user1→ Show groupsdeluser user1→ Delete usersu user1→ Switch userCommand:
lsblkNotes: Lists block devices (disks, partitions).Command:
df -hNotes: Shows mounted filesystems and usage.Command:
sudo fdisk -lNotes: Lists disk partitions.Command:
du -sh /dirNotes: Shows total size of a directory.Command:
mount /dev/sdb1 /mntNotes: Mounts a disk partition to a directory.Command:
umount /mntNotes: Unmounts a mounted filesystem.Command:
blkidNotes: Displays UUIDs and filesystem types.Command:
parted /dev/sdbNotes: Partition management tool.
CPU & Memory
Command:
lscpuNotes: Shows CPU architecture and details.Command:
cat /proc/cpuinfoNotes: Detailed CPU info per core.Command:
free -hNotes: Displays memory usage in human-readable format.Command:
cat /proc/meminfoNotes: Detailed memory statistics.Command:
vmstatNotes: Shows CPU, memory, and I/O statistics.
Networking
Command:
ip addrNotes: Shows IP addresses of interfaces.Command:
ping google.comNotes: Tests connectivity.Command:
traceroute google.comNotes: Shows path packets take.Command:
netstat -tulnpNotes: Lists listening ports and processes.Command:
ss -tulnpNotes: Modern socket statistics.Command:
curl example.comNotes: Fetches webpage content.
User & Permissions
Command:
whoamiNotes: Shows current logged-in user.Command:
idNotes: Displays UID/GID info.Command:
useradd studentNotes: Creates a new user.Command:
passwd studentNotes: Sets password for user.Command:
chmod 755 file.shNotes: Changes file permissions.Command:
chown user:group file.txtNotes: Changes file owner and group.
Services & Logs
Command:
systemctl start httpdNotes: Starts Apache service.Command:
systemctl stop httpdNotes: Stops Apache service.Command:
systemctl status httpdNotes: Shows service status.Command:
journalctl -u httpdNotes: Displays logs for Apache service.Command:
tail -f /var/log/messagesNotes: Shows live system logs.
Checking Hardware Configuration in RHEL
CPU Information
Command:
lscpuNotes: Shows CPU architecture, cores, threads, speed.Command:
cat /proc/cpuinfoNotes: Detailed info per processor core.
Memory Information
Command:
free -hNotes: Displays total, used, free memory (human-readable).Command:
cat /proc/meminfoNotes: Detailed memory statistics.
Disk & Storage
Command:
lsblkNotes: Lists block devices (disks, partitions).Command:
df -hNotes: Shows mounted filesystems and usage.Command:
sudo fdisk -lNotes: Lists disk partitions.
PCI & USB Devices
Command:
lspciNotes: Lists PCI devices (network card, graphics card).Command:
lsusbNotes: Lists USB devices.
System Information
Command:
uname -aNotes: Kernel and OS details.Command:
sudo dmidecode | lessNotes: BIOS, motherboard, and system info.
All-in-One Tools
Command:
inxi -FxNotes: Full hardware summary (if installed).Command:
sudo hwinfoNotes: Detailed hardware report (if installed).
Comments
Post a Comment