Linux
Hiển thị các bài đăng có nhãn Linux. Hiển thị tất cả bài đăng

Why every DevOps engineer says: Learn Linux first

Why does every senior DevOps engineer tell you: Learn Linux first?

Before Kubernetes, before AWS, before Terraform… learn Linux. Here’s why 👇

Because no matter how shiny the cloud console looks, every outage eventually drags you down to the command line.

1. Kubernetes Pod failing? → You’ll debug with kubectl exec and land in Linux.

2. Pipeline broken? → File permissions, symlinks, or shell quirks.

3. High CPU alert? → top, iostat, vmstat — Linux tools, not AWS dashboards.

4. Disk full at 2 AM? → du -sh, df -h, lsof | grep deleted.

The reality: AWS UI can help you start. Python scripts can make you look smart.

But only Linux will save you when prod is burning.

If you’re starting DevOps, learn these first:

1. grep, awk, sed → text wrangling

2. ps, lsof, strace → process forensics

3. netstat, ss, tcpdump → network truth serum

4. systemctl, journalctl → service lifelines


Everything else in DevOps - Kubernetes, Terraform, CI/CD - is built on top of Linux.


Skip this step, and you’ll always feel like an imposter.

If you want to be taken seriously as a DevOps engineer, Learn Linux first. Everything else comes later.

⭕️ If this helps, consider a repost

#LearnLinux #DevOps #ZeroToDevOps #SRE #InfraThrone #DevOps



Linux Real-Time Interview Questions (Advanced)


In real Linux/DevOps interviews, you are NOT judged by

how many commands you remember…

You are judged by how you THINK during production issues.

This poster covers real-world scenarios like:

• High load but CPU idle

• Disk space not freeing

• Zombie processes

• OOM killer issues

• Cron & network failures

💡 Interview Tip:

Linux file system related questions and answers

1. What is an inode in Linux?

-An inode (index node) is a data structure that stores metadata about a file  such as file size, permissions, ownership, timestamps, and disk block locations — but not the file name or its path.

- Each file has one unique inode, and file names are stored in directory entries that map names to inode numbers.

#ls -i filename (Example command)

Shows the inode number of a file.

2. How can you check disk space usage on a Linux system?

- df -h (You can use this commands)

-Displays disk space usage for all mounted file systems in human-readable form.

du -sh /path/to/dir

- Shows total disk usage of a directory.

- Real-time tip: Use du -h --max-depth=1 to find which directories consume the most space.

3. What happens when a file is deleted in Linux while a process is still using it?

 - The file’s directory entry is removed, but the data remains on disk until the process releases the file descriptor.

- You can identify such files using:

lsof | grep deleted

- If you need to reclaim space

How to copy file to multi server with single command

Hướng dẫn copy files qua nhiều server cùng lúc

Nay có nhu cầu cập nhật chương trình mới trên tất cả các máy chủ Linux nên sẵn viết bài này luôn để ghi chú sau này lỡ quên coi lại  ^^

Tầm 30 server mà ftp/scp vô từng em để chép files chắc chết quá. Tư duy của thằng lười lại trỗi dậy ^^!

Việc này khá ư là đơn giản. :)

Đầu tiên là

AIX to Linux quick notes



Common System Files

File AIX Linux
Password file /etc/passwd /etc/passwd
Encrypted password file /etc/security/passwd /etc/shadow
Error logs
/var/adm/ras/errpt
/var/adm/messages
/var/log/messages
Group files
/etc/group
/etc/security/group
/etc/group
/etc/gshadow
Secure login
/etc/security/user
etc/securetty
DNS /etc/resolv.conf
/etc/netsvc.conf
/etc/resolv.conf
/etc/nsswitch.conf
Hosts file /etc/hosts /etc/hosts
Services /etc/services /etc/services
Kernel /usr/lib/boot/unix_64 /boot/vmlinuz
Device files ODM at /etc/objrepos /dev
Inittab /etc/inittab /etc/inittab
inetd.conf /etc/inetd.conf /etc/inetd.conf
File systems /etc/filesystems /etc/fstab
Networking
ODM database at
/etc/objrepos
/etc/sysconfig/network (SUSE)
/etc/sysconfig/network (Redhat)
/etc/sysconfig/network-scripts/if* (Redhat)
NFS exports
/etc/exports /etc/exports
System environment
/etc/environment
/etc/profile
/etc/bash.bashrc
Common User-related
/etc/security/user /etc/default/useradd
New user profile /etc/.profile /etc/skel/*.*
User limit /etc/security/limits /etc/security/limits.conf

Specific Commands
Action AIX Linux
Listing physical volumes (PV) lspv pvdisplay
List partitions in a disk lspv -l <disk> fdisk -l <disk>
List volume groups (VG) lsvg vgdisplay
Create volume group mkvg vgcreate
Remove volume group rmvg vgremove
Add a PV to VG extendvg vgextend
Remove a VG definition exportvg vgexport
Remove a PV from VG reducevg vgreduce
Import VG importvg vgimport
Activate VG varyonvg vgchange
List logical volume (LV) lslv lvdisplay
Create LV mklv lvcreate
Grow filesystems with LV chfs resize_reiserfs and resize2fs
Shrink filesystem chfs resize_reiserfs and resize2fs
Paging/Swap lsps -a procinfo
cat /proc/swaps
OS level oslevel
uname -a
cat /etc/SuSE-release
cat /etc/redhat-release
Run level who -r runlevel
Uptime uptime uptime
Performance vmstat, ps, sar, topas, and nmon vmstat, ps, sar, top,  and nmon (if installed)
List installed filesets lslpp -l  rpm -qa
Which fileset a file is in which_fileset <name> rpm -qf <path/name>
Verify installed filesets lppchk -v rpm -V <package>
List files in a fileset/package lslpp -f <fileset> rpm -ql <package>
List running kernel modules genkex lsmod
Insert module N/A (dynamic) insmod and modprobe
Unload modules N/A (dynamic) rmmod and modprobe
List memory installed bootinfo -r free, procinfo, and cat /proc/meminfo
Create users mksuer useradd
Change user details  chuser usermod and chage
Delete users rmuser userdel
Create groups mkgrp groupadd
Change group details chgrp groupmod
Delete group rmgrp groupdel
Install software installp, smitty install, rpm, and geninstall rpm -iv, yast -i, yast2 and yum install
Update software smitty update_all, installp, and rpm rpm -Uv, yast2 and yum
Remove software smit install, and rpm rpm -e, yast2 and yum
IP configuration smitty tcpip yast2 network (SUSE) /etc/network/sysconfig/network-scripts (Redhat)
IP alias ifconfig en# alias <IP> ifconfig eth#:1<IP>
Network interfaces netstat -in ifconfig 
Network routes netstat -rn netstat -rn, route
staticroutes smitty route /etc/sysconfig/routes (SUSE) /etc/network/sysconfig/network-scripts (Redhat)
Network options no -a sysctl -a
Error logs errpt and alog syslog, evlog, tail /var/log/messages and dmesg
Start daemons startsrc -s (SRC Controlled) rc.svc_name start, chkconfig,
/etc/init.d/<svc_name>/start,
service <name> start
Stop daemons stopsrc -s  rc.svc_name stop, chkconfig,
/etc/init.d/<svc_name>/stop,
service <name> stop
Refresh daemons refresh -p rc.svc_name restart,
/etc/init.d/<svc_name>/restart,
service <name> restart
Shutdown halt shutdown -h shutdown -h
Fast reboot shutdown -Fr shutdown -r now
System dump sysdumpdev -l N/A
Kernel tuning vmo (virtual memory)
schedo (scheduler)
no (network)
sysctl
Change kernel Change link in /usr/lib/boot/unix_* Change in /etc/yaboot.conf
Boot image bosboot lilo (SUSE)
Change bootlist bootlist N/A
System boot messages alog dmesg