shell
shell 脚本学习
酸菜。
爱生活,爱TXJ。
展开
-
dd命令创建指定大小的文件
dd命令原创 2022-11-21 18:04:47 · 2997 阅读 · 0 评论 -
linux 通配符与特殊符号
linux通配符原创 2022-09-11 21:20:38 · 289 阅读 · 0 评论 -
总结一些工作当中常用的命令
ps -eo pid,ppid,sid,tty,pgrp,comm,stat,cmd | grep -E 'bash|PID'sudo su 获得root权限lsof -i:80 列出哪些进程在监听80端口netstat -tunlp | grep 80后续再补充。原创 2021-08-06 19:26:52 · 59 阅读 · 0 评论 -
vim配置
" GENERAL SETTINGS: {{{1" To use VIM settings, out of VI compatible mode.set nocompatible" Enable file type detection.filetype plugin indent on" Syntax highlighting.syntax on" Setting colorscheme"color mycolor" Other settings."set expandtabse原创 2021-04-16 16:01:17 · 117 阅读 · 0 评论 -
数值比较英文缩写
最近学到test 命令时对数值比较的命令查了一下:lt (less than) 小于le (less than or equal to) 小于等于eq (equal to) 等于ne (not equal to) 不等于ge (greater than or equal to)大于等于gt (great...原创 2020-03-12 17:42:25 · 1675 阅读 · 0 评论 -
Shell 文件包含的两种方式
与C/C++语言类似,shell脚本语言也有文件包含使用方法:(1). filename # 注意点号(.)和文件名中间有一空格(2)source filename例子:#test1.sh的内容#!/bin/shab="asn"#test2.sh的内容#!/bin/sh. ./test1.shecho $ab执行效果:...原创 2020-02-18 17:46:54 · 332 阅读 · 0 评论 -
shell变量和shell数组的简单使用
一:Shell 变量(1)定义变量时,变量名不加美元符号 如:name="txj"输出变量使用echo #相当于printf例如:echo ${name}变量的命名规则:(1)变量名和等号之间不能有空格,(2)命名只能使用英文字母,数字和下划线,首个字符不能以数字开头。(3)中间不能有空格,可以使用下划线(_)。(4)不能使用标点符号。(5)不能使用bash里的关键字(可用h...原创 2020-02-18 13:11:30 · 220 阅读 · 0 评论 -
运行 Shell 脚本的两种方法:
//创建一个test.sh文件#!/bin/bashecho "Hello World !"#! 是一个约定的标记,它告诉系统这个脚本需要什么解释器来执行,即使用哪一种 Shell。(这里是bash)一:作为可执行程序chmod +x ./test.sh #使脚本具有执行权限./test.sh #执行脚本注:(1)在当前目录下打开终端执行(2)chmod +x #表示给....原创 2020-02-11 22:47:06 · 1137 阅读 · 0 评论