Cat

concatenate files and print on the standard output

连接文件然后打印输出

示例

root@instance-d4aepywa:~# cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash

用Nano打开

nano /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash

echo

display a line of text

Echo the STRING(s) to standard output.

# echo $0  ## $0 是脚本本身的名字
/bin/sh

先查看当前shell的pid,再定位到此shell的进程

# echo $$ ## $$ 是脚本运行的当前进程ID号
14498

env

run a program in a modified environment

# env
HISTFILESIZE=10000
HISTTIMEFORMAT=root %Y/%m/%d %T
MAIL=/var/mail/root
USER=root
SSH_CLIENT=120.230.131.173 10632 22
XDG_SESSION_TYPE=tty
SHLVL=1
HOME=/root
SSH_TTY=/dev/pts/0
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
LOGNAME=root
_=SHELL
XDG_SESSION_CLASS=user
TERM=xterm
XDG_SESSION_ID=127904
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
XDG_RUNTIME_DIR=/run/user/0
HISTSIZE=1000
LANG=en_US.UTF-8
SHELL=/bin/bash
PROMPT_COMMAND=history -a;
PWD=/root
SSH_CONNECTION=120.230.131.173 10632 192.168.0.4 22
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop

ps 查看当前进程

report a snapshot of the current processes

# ps
PID TTY TIME CMD
13923 pts/0 00:00:00 bash
14498 pts/0 00:00:00 sh
15532 pts/0 00:00:00 grep
16089 pts/0 00:00:00 ps