Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

5 total results found

Clear File Content

Linux Tricks

Both methods can be used to clear a file's content, but they differ in implementation and details: 1. : > file.log Explanation: : is a shell built-in null command that does nothing. > is the output redirection operator that redirects the null command's "out...

operating-system
tricks
linux

getent

Linux Tricks

If pod has no curl or nslookup, use getent instead. getent ahosts foobar.namespace.svc.cluster.local getent ahosts google.com

getent
tricks
linux
operating-system

System Profile

Linux Tricks

Centos echo -e "\n=== OS ===\n$(cat /etc/redhat-release)\n\n=== Kernel ===\n$(uname -r)\n\n=== CPU ===\n$(lscpu | grep --color=never -E 'Model name|CPU\\(s\\)|Socket')\n\n=== Memory ===\n$(free -h)\n\n=== Disk ===\n$(df -h)\n" echo -e "\n=== OS ===\n$(cat /e...

profile
tricks
linux
operating-system

TCP Conn Test

Linux Tricks

code-praefect-86dc6b4f4f-ns6dj:~/code/code-gitaly# nc -zv code-gitaly-0-0 9999 code-gitaly-0-0 (10.1.244.170:9999) open nc -zv code-gitaly-0-0 9999 用的是 nc(即 netcat)命令,常用于端口探测或测试连接,参数含义如下: z:只扫描端口,不发送数据("zero-I/O mode")。 v:verbose,显示详细输出。 code-gitaly-0-0:目标主...

operating-system
nc
tcp
tricks
linux

TCP/IP Pseudo Files in Bash

Linux Tricks

TCP/IP pseudo-files are a special feature in Bash that allow you to open network connections using file-like syntax. They're not real files in the /dev directory — rather, Bash internally interprets paths like /dev/tcp/host/port and /dev/udp/host/port to creat...

tricks
pseudo
tcp
networking
linux
operating-system