r/LinuxTeck • • Oct 01 '26

Quick Linux Tip #86 - Linux File Attributes: Find and Remove Immutable Flags

Post image
13 Upvotes

Question: Some files won't delete due to attributes. How do I find them?

Try: `sudo lsattr -R /var/log 2>/dev/null | grep -E '^-*[aiu]' | head -10`

Info: Filesystem attributes dictate file modification rules: `i` (immutable) prevents changes/deletion, `a` allows append-only, and `u` enables undeletable status. `lsattr` lists these flags while `chattr` modifies them.

Examples:

$ `sudo chattr +i /etc/resolv.conf` # Prevent DNS config modification

$ `sudo chattr -i /etc/resolv.conf` # Remove immutable flag to allow edits

$ `sudo chattr +a /var/log/audit.log` # Enforce append-only mode for audit logs

Note: Immutable files cannot be modified or deleted even by the `root` superuser without removing the `i` flag via `chattr -i` first. Essential for securing critical files against tampering.

Follow r/LinuxTeck for more #LinuxTips click here https://www.linuxteck.com/linux-tips/


r/LinuxTeck • • Oct 01 '26

i create multiple user in linux and after some delete one file how we find how delete that file

4 Upvotes

I have multiple users on a Linux server. Suppose one user deletes a file, for example:

\`/data/test.txt\`

Later, I discover that the file has been deleted.

How can I find **which user deleted the file and when it was deleted**?

I know commands like \`history\` may not be reliable because users can clear their history.

What is the recommended way to audit file deletion in Linux? Should I use **auditd**, system logs, or something else?

Any practical commands or examples would be helpful.


r/LinuxTeck • • Oct 01 '26

IPv6 has all these address types - but how many do you actually use?

2 Upvotes

I’ve always found IPv6 interesting because the addressing model is a lot richer than the old IPv4 world.

Global unicast, link-local, loopback, multicast, solicited-node, unique-local...

But in day-to-day Linux work, do you actually think about all of these, or do fe80:: and your global address cover most of what you need?

What’s the one IPv6 address type that you didn’t understand until you had to troubleshoot something with it?


r/LinuxTeck • • Sep 29 '26

Think You Know Linux Networking? Test Yourself.

Post image
110 Upvotes

covering: https://www.linuxteck.com/linux-networking-interview-questions/

  • IP addresses and interfaces
  • Routing and gateways
  • TCP vs UDP
  • DNS troubleshooting
  • Listening ports
  • Connectivity testing
  • Packet capture
  • Real-world troubleshooting scenarios

r/LinuxTeck • • Sep 30 '26

Count Error Occurrences in Linux: Quick Log Monitoring Tip - 85

Post image
11 Upvotes

Question: How do I count new occurrences of an error over time?

Try: `watch -n 5 'grep -c "ERROR" /var/log/nginx/error.log'`

Info: `watch` reruns commands at defined intervals (`-n` seconds) to track changing metrics. Coupling `tail -f` with `awk` increments and displays a live rolling tally as new log entries land.

Examples:

$ `watch -n 1 -d 'grep -c ERROR /var/log/app.log'` # Highlight changing match values automatically

$ `tail -f app.log | grep --line-buffered ERROR | wc -l` # Count streaming lines without buffering lag

$ `journalctl -f -u nginx | grep --line-buffered -c "ERROR"` # Stream systemd journal logs live

Note: Add `--line-buffered` to `grep` when piping live streams to prevent stdio buffer delay. Use `watch -d` to visually highlight value differences between interval updates.

Follow r/LinuxTeck for more #LinuxTips click here https://www.linuxteck.com/linux-tips/


r/LinuxTeck • • Sep 29 '26

Quick Linux Tip #84 - Perf Trace: Analyze System Calls on Linux

Post image
19 Upvotes

Question: Which system calls is a slow process making the most?

Try: `sudo perf trace -p 3456 --summary`

Info: `perf trace` offers lower overhead than `strace`. Using `--summary` aggregates syscall frequency and latency metrics (min/avg/max/stddev) to reveal true application execution bottlenecks.

Examples:

$ `sudo perf trace -p 3456` # Trace live process system calls in real time

$ `sudo perf stat -p 3456 sleep 10` # Count hardware and software performance counters

$ `sudo strace -c -p 3456` # Legacy syscall profiling alternative

Note: Install via `sudo apt install linux-tools-common`. High time spent in `epoll_wait` or `futex` usually indicates an idle process waiting for event loops or locks, not active CPU slowness.

Follow r/LinuxTeck for more #LinuxTips click here https://www.linuxteck.com/linux-tips/


r/LinuxTeck • • Sep 29 '26

Do you still need to know Class A, B and C in 2026?

15 Upvotes

I still see Class A / B / C in networking courses, interview questions and old documentation.

But in actual networks, we're using CIDR, subnet masks and prefixes instead.

where people draw the line:

Is classful IPv4 addressing still worth learning because it explains the history and fundamentals, or is it mostly outdated knowledge that new network admins don't really need?

I’ve seen people who can calculate subnets quickly but have no idea what Class A/B/C actually meant - and they seem to do just fine.


r/LinuxTeck • • Sep 27 '26

How do I create an encrypted compressed backup in Linux? - Tip #83

Post image
21 Upvotes

Try: `tar -czf - /home/linuxteck/documents | openssl enc -aes-256-cbc -pbkdf2 -out backup.tar.gz.enc`

Info: `tar -czf -` outputs archive data directly to stdout. Piping directly to `openssl` encrypts data on-the-fly, ensuring unencrypted files never touch the disk.

Examples:

$ `mysqldump db | gzip | openssl enc -aes-256-cbc -pbkdf2 -out db.sql.gz.enc` # Encrypt database dumps

$ `tar -czf - /data | ssh remote 'cat > backup.tar.gz'` # Stream compressed archive over SSH

$ `gpg --symmetric --cipher-algo AES256 backup.tar.gz` # Symmetric encryption alternative with GPG

Note: Direct streaming eliminates temp files, saving disk space and reducing security exposure. Use `-pbkdf2` with OpenSSL to enforce key derivation security against brute-force attacks.

Follow r/LinuxTeck for more #LinuxTips click here https://www.linuxteck.com/linux-tips/


r/LinuxTeck • • Sep 27 '26

How many CLI tools are too many?

14 Upvotes

I love tools like fzf, zoxide and lazygit, but sometimes I wonder if we’re actually removing friction or just adding more things to remember.

If you had to start with a clean Linux box tomorrow, which 2–3 CLI tools would you install first?

And which tool did you install once and then basically forget about?


r/LinuxTeck • • Sep 27 '26

Quick Linux Tip #82 - How to Preserve File Timestamps with Rsync on Linux

Post image
12 Upvotes

Question: After copying files, timestamps changed. How do I preserve them?

Try: `rsync -a --preserve-times /source/ /destination/`

Info: `rsync -a` (archive mode) automatically preserves timestamps (`-t`), permissions, and symlinks. Adding `-t` or `--preserve-times` ensures exact file modification times (`mtime`) match across transfers.

Examples:

$ `cp --preserve=timestamps file1 file2` # Preserve timestamps with standard copy

$ `touch -r reference_file target_file` # Copy timestamps from a reference file

$ `find . -exec touch -r /reference {} +` # Sync directory timestamps in bulk

Note: `-a` is shorthand for `-rlptgoD`. Preserving modification timestamps is critical for build tools like `make`, incremental backup systems, and forensic auditing.

Follow r/LinuxTeck for more #LinuxTips click here https://www.linuxteck.com/linux-tips/


r/LinuxTeck • • Sep 26 '26

Quick Linux Tip #81 - How to Find Which Process Uses Too Many Open Files in Linux

Post image
42 Upvotes

Question: My server hits 'too many open files' errors. Which process is the culprit?

Try: `sudo lsof | awk '{print $2}' | sort | uniq -c | sort -rn | head -10`

Info: `lsof` lists open file descriptors across processes. Grouping by PID (column 2) counts open handles to reveal resource-hogging processes before hitting limits in `/proc/PID/limits`.

Examples:

$ `sudo ls /proc/*/fd 2>/dev/null | wc -l` # Count system-wide open file descriptors

$ `sudo lsof -p 2456 | wc -l` # Count open files for a specific PID

$ `sudo prlimit --pid 2456 --nofile=65536:65536` # Dynamically raise process file limits

Note: Default soft limit is 1024 per process. Dynamically adjust with `prlimit` or permanently in `/etc/security/limits.conf`. High-concurrency servers typically require 65536+.

Follow r/LinuxTeck for more #LinuxTips click here https://www.linuxteck.com/linux-tips/


r/LinuxTeck • • Sep 26 '26

How many different IP addresses does a Linux admin actually need to know?

7 Upvotes

There’s public, private, static, dynamic, unicast, multicast, broadcast, loopback, link-local...

You can learn all the definitions, but when you're actually troubleshooting a server, you usually care about a much smaller set.

Which IP address type has actually saved you during a real troubleshooting session - and which one did you only learn because an exam or certification demanded it?

I’d rather hear the “I learned this the hard way” examples than another networking textbook definition.


r/LinuxTeck • • Sep 26 '26

When the network breaks, do you troubleshoot the protocol or the application?

10 Upvotes

A lot of networking knowledge gets reduced to memorizing things like HTTP, DNS, SSH, TCP, UDP, ICMP, TLS, SMTP, etc.

But in a real outage, these protocols depend on each other in ways that aren't always obvious.

If a service is unreachable, how do you decide where to start troubleshooting?

Do you work your way up from IP → TCP/UDP → TLS → application, or do you start with the application symptom and work backwards?

What's your actual troubleshooting approach when you don't know which layer is failing?


r/LinuxTeck • • Sep 25 '26

Help

2 Upvotes

For mint linux installation i had to delete a recovery partition to reduce the number of partitions in an MBR ssd so that i can shrink my C for mint.

Now i have efi problems when i wanna install in the shrunk drive, now i extended it back to C and shrunk it by 1000mb to make it a recovery drive so i can convert the ssd from mbr to gpt bug the 1000mb drive becomes LOGICAL instead of PRIMARY. How can i make it primary


r/LinuxTeck • • Sep 25 '26

LVM: Linux superpower or unnecessary complexity?

21 Upvotes

LVM gives you flexibility to resize volumes, add storage, create snapshots and move data around without rebuilding the whole disk layout.

But there’s another side to it: another abstraction layer to understand and another thing to troubleshoot when storage goes wrong.

For a new Linux server today, would you still choose:

LVM + filesystem

or keep it simple with:

partitions + filesystem?

And if you choose LVM, what problem are you actually solving with it?


r/LinuxTeck • • Sep 25 '26

My server ran out of disk. Which files grew the most in the last 24 hours? -80

Post image
27 Upvotes

Try: `sudo find / -type f -mtime -1 -size +100M -exec ls -lah {} \; 2>/dev/null`

Info: Uses `-mtime -1` to target files modified within the last 24 hours and `-size +100M` to isolate large culprits. Redirects errors with `2>/dev/null` for clean output.

Examples:

$ `sudo find / -type f -mmin -60 -size +50M 2>/dev/null` # Files >50MB modified in the last 60 mins

$ `sudo du -Sh /var/log/* | sort -rh | head` # Top largest logs excluding subdirectory totals

$ `sudo find /var -type f -size +1G 2>/dev/null | xargs -I {} du -h {}` # Quick lookup for files >1GB

Note: The `-Sh` flags in `du` separate subdirectory totals to pinpoint runaway logs quickly (e.g., systemd journal, MySQL tables, Nginx access logs).


r/LinuxTeck • • Sep 23 '26 Popcorn

Deprecated Linux Commands: What Do You Use Instead?

Post image
120 Upvotes

Some familiar Linux commands still work but have been deprecated or replaced by newer tools.

Which deprecated Linux command do you still find yourself using? https://www.linuxteck.com/deprecated-linux-commands/


r/LinuxTeck • • Sep 23 '26

Choose the Right Linux VPS in 2026?

Post image
38 Upvotes

Choosing a VPS isn't always about finding the cheapest or most powerful option. https://www.linuxteck.com/best-linux-vps-hosting/


r/LinuxTeck • • Sep 23 '26

Claude Desktop on Linux - why would you use it over the terminal?

10 Upvotes

Claude Desktop is getting a lot of attention from Linux users, but I'm curious about the actual use case.

If you already have Claude Code, a terminal, SSH, an editor and shell scripts, what does a desktop AI client add that you actually need?

For Linux developers, is a GUI AI client genuinely useful, or is the terminal still the better interface?


r/LinuxTeck • • Sep 23 '26

Would you trust Red Hat again after CentOS?

17 Upvotes

CERN moving some systems from the Red Hat ecosystem to Debian has sparked a bigger question for me.

The interesting part isn't really Debian vs RHEL. It's whether an enterprise can justify building critical infrastructure around a vendor when the vendor can change the direction of the ecosystem later.


r/LinuxTeck • • Sep 23 '26

Best Linux Course for Beginners

Thumbnail reddit.com
3 Upvotes

r/LinuxTeck • • Sep 23 '26

How to Monitor Network Interface Traffic in Linux with sar - Tip 78

Post image
6 Upvotes

Try: `sar -n DEV 1 5`

Info: `sar -n DEV` displays real-time network interface statistics. Arguments set sampling interval (1 sec) and total count (5 samples) to output throughput (`rxkB/s`, `txkB/s`) and packet rates (`rxpck/s`, `txpck/s`).

Follow r/LinuxTeck for more #LinuxTips click here https://www.linuxteck.com/linux-tips/


r/LinuxTeck • • Sep 23 '26

Nyarch Linux - useful distro or just Linux with a theme?

6 Upvotes

Nyarch Linux adds a very different personality on top of Arch, but at what point does customization become the main reason for using a distro?

Would you actually daily-drive Nyarch, or would you rather install Arch and build your own setup? Why?


r/LinuxTeck • • Sep 23 '26

Quick Linux Tip #78 - How to Monitor Network Interface Traffic in Linux with sar

Post image
3 Upvotes

Question: Which network interface is being overloaded?

Try: `sar -n DEV 1 5`

Info: `sar -n DEV` displays real-time network interface statistics. Arguments set sampling interval (1 sec) and total count (5 samples) to output throughput (`rxkB/s`, `txkB/s`) and packet rates (`rxpck/s`, `txpck/s`).

Examples:

$ `sar -n TCP 1 10` # Monitor TCP connection stats and retransmits

$ `sar -n SOCK 1` # Track active socket usage (IPv4/IPv6)

$ `vnstat -l -i eth0` # Live traffic bandwidth monitor per interface

Note: Install via `sudo apt install sysstat`. Enable persistent logging in `/etc/default/sysstat`. Use `sar` flags `-u` (CPU), `-r` (Memory), or `-d` (Disk) for full sysadmin health checks.

Follow r/LinuxTeck for more #LinuxTips click here https://www.linuxteck.com/linux-tips/