Advanced Search
Search Results
5 total results found
Clear File Content
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...
getent
If pod has no curl or nslookup, use getent instead. getent ahosts foobar.namespace.svc.cluster.local getent ahosts google.com
System Profile
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...
TCP Conn Test
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:目标主...
TCP/IP Pseudo Files in Bash
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...