history巧用

修改保存历史命令数量:

vim /etc/profile

HISTSIZE=100000

为命令历史添加日期

vim /etc/profile

HISTTIMEFORMAT=‘ %F %T  ‘

命令历史文件:

~/.bash_history

查看命令历史条数

wc -l ~/.bash_history

导出历史记录

history >> history.log

清空历史记录

history -c

读取历史记录

history -r history.log

HOSTNAME=`/bin/hostname 2>/dev/null`

HISTSIZE=100000

HISTTIMEFORMAT=‘%T %F  ‘

if [ "$HISTCONTROL" = "ignorespace" ] ; then

export HISTCONTROL=ignoreboth

else

export HISTCONTROL=ignoredups

fi

export HOSTNAME HISTSIZE HISTCONTROL

时间: 2024-07-28 20:16:52

history巧用的相关文章

history.replaceState 和 history.pushState的使用和注意事项 ------------黄丕巧

HTML5引入了history.pushState()和history.replaceState()这两个方法,他们允许添加和修改history实体.同时,这些方法会和window.onpostate事件一起工作. replaceState是替换当前的历史信息,pushState是添加一条新的历史记录 这两个方法有三个参数(state,title,url): 第一个参数是一个json格式的参数,他可以存储我们在当前历史以后会用到的数据,也可以传null:第二个官方的介绍是说页面的标题,不过暂时用

Linux常用命令(echo、date、ls、cd、history、cat)

一.linux常用命令有很多今天我们来总结一下常用的入门命令: 1.linux下关机命令:poweroff.init 0.halt.shutdown -h now 2.linux下重启命令:reboot.init 6.shutdown -r now 3.shutdown命令: 格式:shutdown  options TIME 其中options有以下几个: -r:执行重启 -c:取消shutdown命令 -h:执行关机 其中TIME有以下几个: now:表示现在 +m:相对时间表示法,从命令提

history对象

h5新增的history的某部分方法和属性,非常实用. 传送门 有pushState,replaceSate,popSate,state 它们详细请看传送门. 测试请开本地服务器. 1.达成某个条件返回指定页面. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>2</title> <style>

使用history环境变量提升系统安全性

1) 应用场景 系统如果被黑客攻入,他就可以查看一下histroy就能知道了系统的一些敏感信息,像登录的密码之类的:比如有马虎的维护工程师,直接输入了数据库的密码: [[email protected] ~]# history     16  history     17  clear    18  mysql -u root -p'redhat12345' -S /data/3306/mysql.sock    19  history 如上,我们可以发现数据库的密码为redhat12345 2

history命令

history命令的功能是显示使用过的命令,并为其编号. history n 显示最近使用过的n条命令. history -c 将当前shell中历史清空. history -d 801 删除编号为801的命令. history -a 追加最新一条命令到历史文件中. history -n 显示还没有从历史文件中读取的历史记录. history -r 将历史文件中的记录作为当前shell的历史记录. history -w 将当前记录写入历史文件中,覆盖原内容. -p Perform history

IEF could not decode Chinese character in IE history well

My friend is working on some case, and she looks not in the mood. I ask her what's going on. She wants me to look at the screenshot as below. That's why she is upset...IEF could not decode Chinese character in IE history well, so the filenames in Chi

history编写

vim /etc/profile export HISTORY_FILE=/tmp/history/`date +%Y%m%d`-history.log if [ ! -f /tmp/history/`date +%Y%m%d`-history.log ]; then        mkdir -p /tmp/history        chmod 777 -R /tmp/history        touch /tmp/history/`date +%Y%m%d`-history.log 

uva 111 History Grading(DP初步应用)

uva 111 History Grading Many problems in Computer Science involve maximizing some measure according to constraints. Consider a history exam in which students are asked to put several historical events into chronological order. Students who order all

巧洗白色袜子华润紫竹毓婷品牌获2013中国创新营销案例奖上火时怎么吃紫竹药业3

[电影里的孕产知识]<北京遇上西雅图>近期火热上映.众主演扮演的孕妇赚足眼球.吴秀波饰演的Frank嘱咐汤唯饰演的文佳佳产前要做眼底检查.专家表示,在妊娠晚期,很多孕妇易并发妊娠高血压综合征,眼底检查可了解到小动脉的病变. 华润紫竹毓婷品牌获"2013中国创新营销案例奖" [和谐家庭10条吵架公约] 1.要热吵不要冷战:2.要文斗不要武斗:3.就事论事不翻帐:4.严禁在公共场合.家人.孩子.朋友面前吵架:5.请使用文明语言:6.当天的气当天解:7.吵架时不提分手:8.双方要