Skip to content


怎样快速获取指定目录下文件数量

ls |wc -l

wc命令
  wc命令的功能为统计指定文件中的字节数、字数、行数, 并将统计结果显示输出。
  语法:wc [选项] 文件…
  说明:该命令统计给定文件中的字节数、字数、行数。如果没有给出文件名,则从标准输入读取。wc同时也给出所有指定文件的总统计数。字是由空格字符区分开的最大字符串。
  该命令各选项含义如下:
  - c 统计字节数。
  - l 统计行数。
  - w 统计字数。
  这些选项可以组合使用。
  输出列的顺序和数目不受选项的顺序和数目的影响。
  总是按下述顺序显示并且每项最多一列。
  行数、字数、字节数、文件名
  如果命令行中没有文件名,则输出中不出现文件名。
  例如:
  $ wc – lcw file1 file2
  4 33 file1
  7 52 file2
  11 11 85 total
  省略任选项-lcw,wc命令的执行结果与上面一样。

Posted in Linux 命令, 技术.

Tagged with .


php使用ODBC连接access

需要修改下php.ini里odbc的设置,否则遇到长字段可能只取到部分数据。


; Handling of LONG fields. Returns number of bytes to variables. 0 means
; passthru.
;odbc.defaultlrl = 4096
odbc.defaultlrl = 80960

Posted in Mysql, 技术.


已收录334页

根据http://www.admin5.com/html/2/1/20070408/39923.html做优化

Posted in SEO, 其它.


h1和网摘

将论坛主题设为< h1 >标签
增加网摘
收藏此页到: [新浪ViVi] [de.licio.us] [365Key] [雅虎收藏] [我的网摘] [POCO网摘] [天极网摘] [和讯网摘] [igooi] [Google] [Furl] [百度搜藏]

Posted in SEO, 其它.


收录206页

改用sitemap插件后,收录了206页

Sitemaps 类型 最后一次提交时间 最新下载时间 Sitemaps 状态 已提交的网址
sitemap.xml Sitemap Web 2007-5-2 10 个小时前 确定 31048
sitemapIndex.php Sitemap 索引 Web 16 个小时前 16 个小时前 确定 558

Posted in SEO, 其它.


网站收录情况

在提交了31048 个网址的sitemap后,google大概增加了七十几页。
当前搜索引擎的收录情况为
baidu:5
google:83
msn:1

当前论坛的主题为2234 篇.

好烂哦,sitemap还要改一下.

Posted in SEO, 其它.


mysql 中取指定范围随机数

Returns a random floating-point value v between 0 and 1 inclusive (that is, in the range 0 <= v <= 1.0). If an integer argument N is specified, it is used as the seed value, which produces a repeatable sequence. mysql> SELECT RAND();
-> 0.9233482386203
mysql> SELECT RAND(20);
-> 0.15888261251047
mysql> SELECT RAND(20);
-> 0.15888261251047
mysql> SELECT RAND();
-> 0.63553050033332
mysql> SELECT RAND();
-> 0.70100469486881
mysql> SELECT RAND(20);
-> 0.15888261251047

To obtain a random integer R in the range i <= R <= j, use the expression FLOOR(i + RAND() * (j – i). For example, to obtain a random integer in the range of 7 to 12 inclusive, you could use the following statement: SELECT FLOOR(7 + (RAND() * 5)); 将discuz论坛中所有贴子的浏览数改为13~93之间 update cdb_threads set views=FLOOR( 13+(RAND() * 80));

Posted in Mysql, 技术.


wamp windows 下gd模块失效

用wamp自带的工具配置失效,因为他显示的php.ini和实际使用的是两个文件。
应当使用wamp\php\下的php.ini

Posted in PHP, 技术.


linux 批量删除文件

find ../shanghai/ -name “*.html” -exec rm -f {} \;
在命令行可执行在shell里报错
find: missing argument to `-exec’
换用
find ../shanghai/ -name “*.html”|xargs rm -rf
在命令行可执行在shell里报错
rm:无效选项 —
请尝试执行‘rm –help’来获取更多信息。

给shell加上#!/bin/bash
报错
: bad interpreter: 没有那个文件或目录sh

由于shell是在windows下写的,估计是换行的问题.
系统没装dos2unix,所以在linux下重写一遍,成功。

Posted in Linux 命令, 技术.


find命令中*号的疑惑

当前目录下有abc.html,def.html,ghi.html
使用find . -name *.html会报 “path must precede expression”错误
因为find -name 后面只能指定一個 name,执行上面的命令会解析成
-name abc.html,def.html,ghi.html 所以就会报错

可以使用 find . -name “*.html” 来解决

Posted in Linux 命令, 技术.

Tagged with .