linux is not unix …
command | use | description |
---|---|---|
pwd | pwd | View the current directory path |
who | who or who am i or whoami | View current user |
cd | cd /usr/bin or cd / or cd ../ | Enter the bin directory of usr; enter the root directory; or enter the previous directory |
cd | cd directory | cd relative path or absolute path |
ls | ls -a or ls-l or ls | List all files and folders in the current directory |
mount | mount /dev/xxx /mnt | Mount a file xxx under the mounting device to the mnt directory |
unmount | unmount xxx | Unmount |
cat | cat notice.md | View the information of a file, it will be printed to the console |
mkdir | mkdir xxx | Create xxx folder |
touch | touch readme.md | Create the readme.md file |
cp | cp readme.md /usr/readme.md.tmp | Copy readme.md to the /user directory |
cp -r | cp - r abc /usr/abc.tmp | -r means recursion, copy abc and its sub-files to /usr |
mv | mv abc /usr/abc | Cut or rename (same directory) |
rm -rf | rm /usr/abc.tmp or rm -rf /usr/abc.tmp | Delete, use with caution |
his | su root someone su bitqian | Switch to xxx user |
free | free or free -h | View memory usage |
top | top | Open the task manager, which is linux |
command | use | description |
---|---|---|
exit | exit | Log out, similar to windows + L lock screen |
shutdown | shutdown or shutdown -now | Shutdown |
reboot | reboot | Reboot |
init | init 0 | Shutdown |
init | init 1 | Single user working status |
init | init 2 | Multi-user status (no NFS) |
init | init 3 | Multi-user status (with NFS) |
init | init 4 | The system is not used, left to the user |
init | init 5 | graphic interface |
init | init 6 | The system shuts down normally and restarts rboot |
ifconfig | ifconfig | The network card information shows like win's ipconfig~ |
df | df -h | View disk information, hard disk size |
cat | cat xx | 查看文件内容 |
tac | tac xx | 查看文件,倒序,从下往上 |
more | more 文件名 | 分页显示文件,enter键往下翻,ctrl + B 向上翻 |
head | head -3 notice.md | 查看notice.md 前三行信息 |
tail | tail xx | 查看文件 |
wc | wc xx | 行数、单词数,以及该文件的字节数 |
find | find / -name “*python3*” /usr/bin | 模糊匹配所有包含python3字符的 文件以及文件夹 |
grep | grep bitqian /usr/notice.md | 在/usr文件中查找"bitqian"字符串 |
gerp | gerp bitqian /usr/notice.md -n | 找到bitqian所在的行号,-c是次数 |
whereis | whereis java | 形象吗。 jdk所在的路径 |
ln | ln abc /usr/123 | 将当前目录的abc文件硬链接到/usr/123目录下。 |
ln -s | ln -s abc /usr/123 | 软链接 |
ln 或者 ln -s的区别 | null | 内容相通; 软链接可以 跨文件系统 ,硬链接不可以; 软链接,删除原文件,链接的文件无法访问。 |
useradd | useradd bitqian | 添加bitqian用户,bitqian会出现home目录下,别直接删 |
useradd | useradd abc -g root | 把abc添加到root组下 |
passwd | passwd abc | 为abc这个用户设置密码 |
userdel | userdel abc -r | 删除abc |
groupadd | groupadd g1 | 添加用户组 |
groupdel | groupdel g1 | 删除用户组 |
ls -a | more | ls -a | more | 管道用法。使用 “|” ,连接多个命令。用于查找对应的结果。子查询类似。 |
ls -l | grep “^a” | ls -l | grep “^a” | 查找文件中以a打头的字符。 |
20/11/20
vim命令:什么命令最好用. … 当然是我linux的的vim拉。vim 是vi的升级版。
通过命令的方式快速对文件进行curd。
debug, 日志文件用。。
命令 | 使用 | 描述 |
---|---|---|
光标移动 | \\\ | 用vim命令打开了文件,默认是只读,命令模式。可以输入一系列的命令来查找你要的信息。按esc键到命令模式。 |
ctrl+f | ctrl+f | 上一页码 |
ctrl +b | ctrl +b | 下一页 |
0 | 0 | 按下数字0,到当前行的首字母,win的home键 |
$ | $ | 美元符,到当前行的末尾,win的end键 |
G | G | 大写的G,到当前文件的最后一行 |
nG | nG | 到当前文件的第n行 |
gg | gg | 到当前文件的第一行… |
搜索功能 | \\\ | 页数命令模式, 进入vim后esc键到命令模式。 |
/搜索的关键字 | /abc | 搜索包含abc的字母,高亮显示。 |
n | n | /abc的时候,按下字母n,向下翻,查找abc。 |
N | N | /abc 搜索abc,向上查找 |
复制,删除 | \\\ | 页数esc键,命令行式 |
dd | dd | 删除当前行 |
u | u | 回退,撤销,删除后用 |
yy | yy | 复制当前行 |
nyy | 2yy | 从光标开始复制两行 |
p | p | 从光标处粘贴 |
编辑模式 | \\\ | 输入a或者i或者o 从命令模式进入编辑模式,键盘可以输入你想输入的东西拉。 |
esc | esc | esc又进入命令模式 |
必须是命令模式才能做保存退出的操作 | \\\ | esc进入命令模式 |
命令模式下 : | : | 按 :然后… |
:w | :w | 保存 |
:q | :q | 退出vim |
:q! | :q! | 强制退出 |
:wq | :wq | 保存并退出vim |
有关查找端口的问题:
2020/11/24
# 查看启动中的日志 并启用控制台:
./startup.sh & tail -f ../logs/catalina.out
# 端口查看:
netstat -ano | grep 8080
# 启动端口
./shutdown.sh
# 查看进程:
ps -ef | grep tomcat
# kill 进程
kill -9 pid
更新…