Linux day1

配置源
curl -s -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
curl -s -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum update -y

yum install tree nmap dos2unix lrzsz nc lsof wget tcpdump htop iftop iotop sysstat nethogs -y
yum install psmisc net-tools bash bash-completion vim-enhanced -y

systemctl restart network 重启所有网卡
ifup eth1只启动网卡1‘
ifdown eth1 只关闭网卡1

查看ip
ifcofig

查看当前用户
whoami

查看当前路径
pw

 

 

 

bash的内置命令

 

alias, bg, bind, break, builtin, caller, cd, command, compgen, complete,
compopt, continue, declare, dirs, disown, echo, enable, eval, exec, exit, export, false,
fc, fg, getopts, hash, help, history, jobs, kill, let, local, logout, mapfile, popd,
printf, pushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test,
times, trap, true, type, typeset, ulimit, umask, unalias, unset, wait

 

 假如把密码不小心输入进去了

history会显示

 

用history -d 序列号删除想删除的哪一行

-c是全部清空历史记录

 

 

 

 

 

!sys 执行最近的以sys开头的命令

ctrl +r 搜索最近执行的命令

 

posted @ 2023-03-18 16:38  敬佟学Java  阅读(17)  评论(0)    收藏  举报