sudo apt install net-tools

ifconfig#private ip
hostname -I
or
ifconfig
or
ip addr show

#public ip
curl ifconfig.meifconfig -a$ hostname -I 
# The following commands allow you to get ip address in Linux. Open a terminal. Type any of the following command. Press Enter. The Ip address is next to inet.

ip address
ip address show eth0
ifconfig -a
ifconfig eth0
ip route
ip route show dev eth0
ip addr
ip addr show
ifconfig -a
ip route
# private
interface="lo"
ip addr | grep "inet\b" | grep "\b${interface}.*$" | awk '{gsub(/\/.+/,"",$2); print $2}'

# public
curl ifconfig.meip addr
ip addr show eth0
ifconfig -a
ifconfig eth0
ip route
ip route show dev eth0# show IP address of current linux machine
ip addr showip addr show | grep inet | grep -v inet6 | awk '{print $2}' | cut -d '/' -f 1# Run ifconfig command and filter the output using grep and awk
ip_address=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | awk '{print $2}')

# Print the current IP address
echo "Current IP address: $ip_address"

Shell/Bash相关代码片段

kde plasma missing taskbar

linux get parent pid

install ollama in linux

git put existing folder to gitlab

cloning a repository with ssh

git commit reuse message

git commit with previous message

can't pull from another branch

install pyfiglet python

markdown parser

Exception: Can not find valid pkg-config name.

force quit macos

force quit mac

force quit

docker desktop current user not user groups

force quit menu mac

pomodoro app for ubuntu

expo-server-sdk npm install

postgresql database backup script windows

kill wandb

hkp://pool.sks-keyservers.net

change docker image tag

how to exec into a pod as root

install swift in linux

git delete pruned branches

git change master head

has insufficient funds for spend sol local

could not find `Cargo.toml` in

git workflow call

kill running port one liner ubuntu

bash check if running as root

how to install openssl in windows

openssh latest version for raspbian

sed lines after match

pip install is very slow

gitlab connect error fix in git

Intellij removing space changes git

install kubernetes alma linux 8.9

how to remove quotes from a string in bash

how to install grafana-prometheus kubernetes

show laptop battery health windows 10

ubuntu terminal won't open

uninstall pip ubuntu

fatal: detected dubious ownership in repository

docker npm network timeout

install nvidia drivers pop os

how to list apt holds

how to install yo code generator

install notion ubuntu

zsh-autocomplete

install yabai macos

cwpanel install rocky linux 9

tar command not found

Correct use of command substitution in Bash

how to push changes to github from terminal

ollama uninstall

rocky 9 mysql

nodejs jest only on specific file

windows ubuntu wsl

ignore a folder in SVN

npm install for express the version 5

add local .env to vercel env

pihole unbound install and config

Create SSH Key

kitty terminal install

X server (windows, macos and linux) for docker gui

rename a local Git branch

delete a Git branch locally and remotely

laravel generate sitemap xml

max github file size

find-large-files-linux

git pull accept all incoming changes

upgrade to fedora 40 from terminal

upgrade all packages pnpm

imperative configmap command

how to show ip address in linux

linux libreoffice cli convert docx to txt

how to install .run file in ubuntu

start tensorboard

how to install xampp in ubuntu