linux 命令汇总
这里汇总一下平时用到的一些命令,方便需要的时候查询,不定期编辑 1. 计算一个字符串的md5
echo -n 'the_password' | md5sum -
[color=red]"-n" is supplied to force echo not to add a newline character automatically behind the string[/color]
md5sum也可以换成sha*sum,比如sha256sum等
2. There are stopped jobs. 这个消息是在推出控制台的时候碰到的,搜了下,然后才想起每次编辑某个文件又想看下log的时候,并不总是需要把vim退出:在运行某个程序的时候,按Ctrl-z可以把程序“挂起”(suspend),然后干点别的事情,然后再把程序调出来继续运行,在终端输入
jobs
可以看到被挂起的程序列表,
vivi@H0334:~$ jobs
[1]- Stopped vim
[2]+ Stopped vim c.html
然后可以输入
fg $jobid
继续运行程序,$jobid就是输入jobs出现的列表的前面那个数字
Unix allows you to suspend a program you are running and then go back to it later on. This is called "job control". When you are using a program interactively, it is said to be in the "foreground"; once it is stopped (with [ctrl-z]) it is in the "background". At this point you can put the job back into the foreground by typing "fg", or tell it to continue to run in the background with "bg". The shell gives a number to each job that is running in the background or that has been stopped. To see the list of current jobs, type "jobs". Each job will be listed, preceded by its number. The job most recently stopped is referred to as the current job and will have a + sign in front of it. You can kill a job by typing: [code=shell] kill %n [/code] where n is the number of the job. A job left running in the background will stop when it needs input from the terminal.
** 使用wget创建一个站点的镜像**
wget -mk http://www.example.com/
ubuntu安装受限的资源
文件编码查看及其转换
或者
也可以识别部分文件编码,貌似没有enca那么精确
确认之后再加上 --notest 参数执行一遍
装系统的时候应该考虑好分区的问题,900多g的分区,用gparted调整了好久才调整成250g
查看分区的uuid命令
同一个服务器上起两个tomcat web应用,端口不同,因为是在同一个域,所以访问两个应用的时候都会写同一个cookie,于是就会出现在一个应用登录拿一个sessionid,这时候去登录另外一个应用会把这个sessionid覆盖掉,于是这时候回到第一个应用,就会出现没有登录的情况
解决的办法是在tomcat启动的时候指定sessionid的key