Skip to the content
Skip to content
Top Menu
Nov 21, 2026
  • About Us
  • FAQ
  • Write For Us
  • Tech News
  • Facebook
  • Twitter
  • LinkedIn
  • Twitter
  • fa-youtube
Join to our facebook group
logo
  • Home
  • Linux
    • Distributions
      • RHEL-Centos
      • Rocky Linux
      • Ubuntu
    • LINUX COMMANDS
    • Shell Scripting
    • Cheat Sheets
      • Linux
      • Docker
    • Linux General
    • Linux Opinion
    • Troubleshooting
  • Enterprise Linux
  • Linux Interview Q & A
    • Linux Basics Q&A
    • Shell Scripting Q&A
      • Level 1: Beginner (0–1 Year)
    • Networking Q&A
  • Guides
    • Hosting
  • Linux Tips
Main Menu

Linux Tips

Run command as another user Linux
QUICK LINUX TIPS : 131

Run Command as Another User in Linux Using sudo -u

Nov 21, 2026 - by john

How do I run a single command as the mysql user? Try: sudo -u mysql -H bash -c 'echo $HOME && mysql -e "SHOW DATABASES"' Info: Runs commands as another user with an updated HOME environment variable. Examples: $ sudo -u www-data php -r 'echo getcwd();'  # Run a snippet […]

Read More
HTTPie API debugging
QUICK LINUX TIPS : 130

HTTPie API Debugging: Test and Inspect HTTP Requests

Nov 20, 2026 - by john

How do I debug an HTTP API quicker than with curl? Try: http --print=HBhb --verify=yes https://api.example.com/users/42 Info: Prints colored request and response headers and bodies, making HTTP API debugging easier and more readable. Examples: $ http POST api.example.com/users name=John age:=34  # Send JSON body with typed values $ http --session=api […]

Read More
Linux network namespace
QUICK LINUX TIPS : 129

Linux Network Namespace: Create an Isolated Network Stack

Nov 19, 2026 - by john

How do I run a command with its own isolated network stack? Try: sudo ip netns add isolated && sudo ip netns exec isolated ip link set lo up Info: Isolates network stacks for sandboxing or testing. Examples: $ sudo ip netns exec isolated bash  # Open an interactive shell […]

Read More
ShellCheck Bash script
QUICK LINUX TIPS : 128

ShellCheck Bash Script: Find Bugs and Security Issues in Linux

Nov 18, 2026 - by john

How do I lint my bash scripts for bugs and security issues? Try: shellcheck /opt/scripts/backup.sh Info: Static analysis tool that catches common bugs, security flaws, and style issues in shell scripts. Examples: $ shellcheck -s bash *.sh  # Force the shell dialect to bash explicitly $ shellcheck -f gcc script.sh […]

Read More
Linux process stack trace
QUICK LINUX TIPS : 127

Linux Process Stack Trace: Find Where a Hung Process Is Stuck

Nov 16, 2026 - by john

A process is hung. Where is it stuck in the code? Try: sudo cat /proc/3456/stack Info: Displays kernel stack traces and wait channels to pinpoint where processes are blocked. Examples: $ sudo cat /proc/*/wchan 2>/dev/null | sort | uniq -c | sort -rn  # Analyze wait channels system-wide $ sudo […]

Read More
Linux immutable file attribute
QUICK LINUX TIPS : 126

Linux Immutable File Attribute: Fix Files That Won't Delete

Nov 14, 2026 - by john

Even root can't delete a file. What's wrong? Try: sudo lsattr /tmp/stuck.lock Info: 'i' attributes block all modifications even for root; remove them using chattr -i. Examples: $ sudo chattr +i /etc/resolv.conf  # Protect configuration files from accidental modification $ sudo lsattr -R /etc | grep -E '^-*[ai]'  # Recursively […]

Read More
Bash startup time
QUICK LINUX TIPS : 125

Bash Startup Time: Find and Fix Slow Linux Shell Startup

Nov 13, 2026 - by john

Why does my bash shell take 3 seconds to start? Try: PS4='+ $EPOCHREALTIME\011 ' bash -x -lic exit 2>&1 | awk '/^\+/{if (prev) print $2-prev, cmd; prev=$2; cmd=$3" "$4" "$5}' | sort -rn | head -10 Info: Times and sorts bash startup commands to isolate performance bottlenecks. Examples: $ time […]

Read More
Linux scheduled tasks
QUICK LINUX TIPS : 124

Linux Scheduled Tasks: Find Every Cron Job and Timer

Nov 12, 2026 - by john

Where ARE all the scheduled tasks on my system? Try: sudo bash -c 'for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l 2>/dev/null | grep -v "^#\|^$" | sed "s/^/[$user] /"; done' Info: Enumerates active user crontabs while filtering comments, complementing system-wide cron directories. Examples: $ sudo […]

Read More
Linux filesystem check
QUICK LINUX TIPS : 123

Linux Filesystem Check: 3 Commands to Detect Disk Errors

Nov 11, 2026 - by john

How do I check if my mounted filesystem is corrupted? Try: sudo touch /forcefsck && sudo shutdown -r +1 'Scheduled fsck' Info: Triggers boot-time checks, while read-only flags safely audit mounted filesystems instantly. Examples: $ sudo tune2fs -c 1 /dev/sda1  # Force a filesystem check after every mount count $ […]

Read More
sudo command audit
QUICK LINUX TIPS : 122

Sudo Command Audit: Track Who Ran Commands in Linux

Nov 10, 2026 - by john

Who ran sudo commands on my server today? Try: sudo grep 'sudo' /var/log/auth.log | grep -v 'session' | tail -10 Info: Filters authentication logs to display sudo command executions while excluding noisy session events. Examples: $ sudo journalctl _COMM=sudo --since today  # Query sudo logs using systemd journalctl $ sudo […]

Read More
systemctl show
QUICK LINUX TIPS : 121

systemctl show: Find the Exact Systemd Service Executable

Nov 09, 2026 - by john

Which exact binary does a systemd service execute? Try: systemctl show nginx -p ExecStart --no-pager Info: The systemctl show command displays unit properties, extracting exact binaries, arguments, and configuration file paths via specific property filters. Examples: $ systemctl show nginx --all  # Dump all available properties for the service unit […]

Read More
Linux find rogue network connections
QUICK LINUX TIPS : 120

Linux Find Rogue Network Connections: Identify and Stop Them

Nov 08, 2026 - by john

A rogue script is calling an external API. How do I find and stop it? Try: sudo ss -tnp dst 203.0.113.45 Info: Filters socket connections by destination IP to expose associated processes and PIDs for immediate termination. Examples: $ sudo ss -tnp 'dst 192.168.1.0/24'  # Filter connections targeting an entire […]

Read More
Linux atomic file rename
QUICK LINUX TIPS : 119

Linux Atomic File Rename: Safely Update Config Files

Nov 07, 2026 - by john

My config reload reads a half-written file. How do I update it safely? Try: mv /etc/myapp/config.new /etc/myapp/config.json Info: Same-filesystem file renames are atomic at the inode level, ensuring readers see either the complete old file or the new file. Examples: $ sed -i.bak 's/old/new/' file  # Perform an in-place file […]

Read More
Linux directory comparison
QUICK LINUX TIPS : 118

Linux Directory Comparison: 3 Commands to Verify Folders

Nov 06, 2026 - by john

I rsync'd two folders. How do I verify they truly match? Try: diff -rq /source /destination Info: Recursively compares directories and reports differing files or unique items without printing full diff contents. Examples: $ diff -rq /a /b | grep -v '^Only'  # Compare file contents only, ignoring missing files […]

Read More
Linux process environment variables
QUICK LINUX TIPS : 117

Linux Process Environment Variables: 3 Commands to Inspect Running Daemons

Nov 05, 2026 - by john

How do I see what environment vars a running daemon was started with? Try: sudo cat /proc/3456/environ | tr '\0' '\n' Info: Reads null-separated initial environment variables from the process proc entry and translates them into readable lines. Examples: $ sudo strings /proc/3456/environ  # Alternative method using strings to extract […]

Read More
inotifywait
QUICK LINUX TIPS : 116

Inotifywait in Linux: Automatically Rebuild Projects on File Changes

Nov 04, 2026 - by john

How do I auto-rebuild my project when source files change? Try: while inotifywait -r -e modify,create,delete ./src/; do make build; done Info: inotifywait exits after a single file event, allowing a simple while loop to trigger builds on modification without external watchers. Examples: $ while inotifywait -e modify ./style.css; do […]

Read More

Posts navigation

1 2 … 9 Next

Trending

  • How to Create User in RHEL/CentOS 7.6
  • Linux Shell Scripting Command Cheat Sheet
  • California Age Verification Law Linux: What AB 1043 Means for Open Source
  • Linux Kernel 7.0: The Good Stuff You Need to Know
  • Easy Guide to mkdir Command in Linux
  • How to Install Rocky Linux 10.2 {Step by Step} with Screenshots
  • Master the Batch Command in Linux Quickly
  • Zsh vs Fish: Which Shell Is Better?
  • How to choose an OS
  • 13 Top command in Linux (Monitor Linux Server Processes)
  • Popular
  • Comments
  • Tags
useradd_command_linux

How to Create User in RHEL/CentOS 7.6

Mar 27, 2020

Linux Shell Scripting Command Cheat Sheet

Linux Shell Scripting Command Cheat Sheet

Apr 07, 2023

Aneeshya SLearn Archiving and Compression in Linux like a Pro
muglLearn Archiving and Compression in Linux like a Pro
No tags to show

Google Add as a preferred
source on Google
  • Contact US
  • Privacy Policy
  • Terms of use
  • Affiliate Disclosure
  • Advertise
Copyright © 2026 LinuxTeck. All Rights Reserved.
Material from our website cannot be republished ONLINE or OFFLINE without our permission.
L