分类 shell脚本学习 articles

第四章 控制流结构

1.if语句 1if 条件1 2then 3 命令1 4elif 条件2 5then 6 命令2 7else 8 命令3 9fi 10------------------ 11if 条件 12then 命令 13fi 14eg: 15#!/bin/bash 16#if test 17#this is a comment line 18if [ "10" -lt "12" ];then 19#yes 10 is less than 12 20echo "yes,10 is less than 12" 21else 22echo "no" 23fi 注意:if语句必须以fi终止。”10″ 前一个空格,“12”后也有一个空格。 这个条件都是通过test命令来指定。条件表达为test exp……

Continue reading

第三章:变量和运算符

1.echo echo [option] string -e 解析转移字符 -n 回车不换行,linux系统默认回车换行 转移字符 c t f n 1#!/bin/bash 2#echo 3echo -e "this echo's 3 newlnennn" 4echo "OK" 5echo 6echo "this is echo's 3 ewlinennn" 7echo "this log file have all been done">mylogfile.txt 8[test@szbirdora ~]$ sh echod.sh 9this echo's 3 newlne 10OK 11this is echo's 3 ewlinennn 上面可以看到有-e则可以解析转移字符,没有不能解析。echo空输出为空 2.read 可以从键盘或文件的某一行文本中读入信息,并将其赋给一……

Continue reading

第二章:变量和运算符

变量 本地变量:在用户现在的shell生命期的脚本中使用。设置变量:various_name=value.可用set 来查看。用readonly可以使变量只读。 环境变量:用于当前用户下所有用户进程(不限于现在的shell)。 设置变量:export various_name=value。……

Continue reading

第一章.Linux Shell简介

第一章:shell基础 shell基础(学习总结,自己整理的,如转摘,请注明出处。)查看前需掌控的命令:umask 、chmod、chgrp、chown等 umask –查看当前用户创建文件或文件夹时的默认权限 umask的计算算法权限对应表(见下表): umask 文件权限 目录权限 0 6 7 1 5 6 2 4 5 3 3 4 4……

Continue reading

shell脚本加密工具shc

shc是一个加密shell脚本的工具.它的作用是把shell脚本转换为一个可执行的二进制文件. 用shell脚本对系统进行自动化维护,简单,便捷而且可移植性好. 但shell脚本是可读写的,很有可能会泄露敏感信息,如用户名,密码,路径,IP等. 同样,在shell脚本运行时会也泄露敏感……

Continue reading

find 命令:查找文件

find命令用于查找文件,其命令格式为: 1find [起始目录] [搜索条件] [操作] 其中[起始目录]是指命令将从该目录起,遍历其下的所有子目录,查找满足条件的文件。该目录默认是当前目录。[搜索条件]是一个逻辑表达式,当表达式为”真”时,搜索条件成立,为”假”时不成立。搜索条件的一般表达式及……

Continue reading

Latest articles

Categories

Tags

ACL AD AES AI AWS Ansible Atlassian Azure BMC Blockchain Brocade CDH5 CL210 Cobbler Confd C语言 DDOS DISTINCT DNS Duckdb EKS ELK GCP Ghost Git Glusterfs Go Godaddy Grafana HBA HCIE Hotspot HttpWatch IBM IIS IOS InfluxDB Ingress InnoDB JavaScript Jinja2 KVM Keepalived Mplayer MySQLdb Netlify OpenResty PM PostgreSQL QoS RH318 RH442 RHCA RHCE RHEV RSA SRE SecureCRT Statuscode SublimeText2 TC Telecom Tencentcloud VBA aira2 alpine android anpic apache apm apparmor appfog apr apt-get aria2 array atop audit awk awstats axel backdoor backup bamboo bash bat benchmark bigdata bin bind bitwise book bootstrap bsd c1000 cache capistrano catlog centos centos7 chatops chattr check_mk checkinstall cisco clearall clickhouse cloud-desktop cmdb cms collectd comm compress conver corosync cpu crontab crunchbang css curl date decode dell desktop devops df dhcp diff diskpart django docker dos2unix dpkg drupal etcd excel fail2ban fastcgi fdisk fiddler find firewalld flask flvtool ftp function fuser geek gin github gitlab glances golang google gooupadd graphviz gravatra grep grub2 hadoop haproxy hardware heartbeat helm hexdump hhvm history html http/html/web httplogs https huawei huaweicloud hugo icmp iconv ifconfig inotify iopp ipmitool iptables iredmail iscsi isito it-news java jdk jenkins jira join joomla k3s k8s kdump kernel kingate lamp last leetcode lib light-http linux linux高级篇 ln ls lsi lsof lvm lvs mac mail man mark markdown matplotlib maven memcached microservice mimikatz mkdocs mkpasswd mmonit mod_jk mongodb monit monitor mono moodle mosh mount mpm mrtg mtr my.cnf mysql mysqlbinlog mysqld_multi mysqldump mysqlhotcopy nagios nc nethogs nexus nfs nginx nmon nocatlog node.js nrpe ntfs ntop ntp obs ocr open-falcon openbox opencv openldap openssl openstack oracle oswatch paas pacemaker pam pandas parted pcp pcre pdf percona perl pexpect pgrep php php-fpm ping plsql develope postfix powershell prettify proc prometheus puppeteer pushd pwgen pxe pyecharts python python模块 radmin raid rdesktop read redhat redis redmine regex rh134 rhel7 rhel8 rm rman rootkit route rpm rpmforge rrdtool rsync rsyslog safe saltstack samba scapy screen sed selenium selinux seo seq session set shc sheepdog shell shopt sitemap skydns smokeping snffier snmp socket soft sort spider sql sqlserver squid ss ssh sshpass strace strings su sudo suse svn sysbench syslog-ng sysstat systemd t tar tcpcopy tcpdump tech telnet tengine test testlink threads time tmux tomcat touch tr tsar twisted ubuntu udev ulimit unix unixbench user-agent useradd varnish vbs vercel vi vim visudo vmstat vmware vnc voice vpn vscode vsftp vsftpd vue watchdog web webcam webistrano wget wiki windows wol wordpress workshop wsl x-windows xampp xcache xmllint xtrabackup yule yum zabbix zeromq zip zonetime zookeeper 下载工具 云主机 云原生 代理 加密 古意 吐槽 圈里圈外 娱乐 字符串函数 安全 平台架构 意林 推理 提权 故事汇 故障案例 数据结构 每日看点 民国史 生活 科学记录 站长管理工具 算法 管理 网站架构 翻墙 股票 行业 诗韵 负载均衡 远程管理 面试题

Links

Meta