shell文件操作大全

1.创建文件夹

!/bin/sh

mkdir -m 777 "%%1"

2.创建文件

!/bin/sh

touch "%%1"

3.删除文件

!/bin/sh

rm -if "%%1"

4.删除文件夹

!/bin/sh

rm -rf "%%1"

5.删除一个目录下所有的文件夹

!/bin/bash

direc="%%1" #$(pwd)
for dir2del in $direc/* ; do
if [ -d $dir2del ]; then
rm -rf $dir2del
fi
done

6.清空文件夹

!/bin/bash

direc="%%1" #$(pwd)
rm -if $direc/*
for dir2del in $direc/* ; do
if [ -d $dir2del ]; then
rm -rf $dir2del
fi
done

7.读取文件

!/bin/sh

7.1.操作系统默认编码
cat "%%1" | while read line; do
echo $line;
done

7.2.UTF-8编码
cat "%%1" | while read line; do
echo $line;
done

7.3.分块读取
cat "%%1" | while read line; do
echo $line;
done

8.写入文件

!/bin/sh

cat > "%%1" << EOF
%%2
EOF

tee "%%1" > /dev/null << EOF
%%2
EOF

sed -i '$a %%2' %%2

9.写入随机文件

!/bin/sh

cat > "%%1" << EOF
%%2
EOF

tee "%%1" > /dev/null << EOF
%%2
EOF

sed -i '$a %%2' %%2

10.读取文件属性

!/bin/bash

file=%%1
file=${file:?'必须给出参数'}
if [ ! -e $file ]; then
echo "$file 不存在"
exit 1
fi
if [ -d $file ]; then
echo "$file 是一个目录"
if [ -x $file ]; then
echo "可以"
else
echo "不可以"
fi
echo "对此进行搜索"
elif [ -f $file ]; then
echo "$file 是一个正规文件"
else
echo "$file不是一个正规文件"
fi
if [ -O $file ]; then
echo "你是$file的拥有者"
else
echo "你不是$file的拥有者"
fi
if [ -r $file ]; then
echo "你对$file拥有"
else
echo "你并不对$file拥有"
fi
echo "可读权限"
if [ -w $file ]; then
echo "你对$file拥有"
else
echo "你并不对$file拥有"
fi
echo "可写权限"
if [ -x $file -a ! -d $file ]; then
echo "你拥有对$file"
else
echo "你并不拥有对$file"
fi
echo "可执行的权限"

11.写入文件属性

!/bin/bash

修改存放在ext2、ext3、ext4、xfs、ubifs、reiserfs、jfs等文件系统上的文件或目录属性,使用权限超级用户。

一些功能是由Linux内核版本来支持的,如果Linux内核版本低于2.2,那么许多功能不能实现。同样-D检查压缩文件中的错误的功能,需要2.5.19以上内核才能支持。另外,通过chattr命令修改属性能够提高系统的安全性,但是它并不适合所有的目录。chattr命令不能保护/、/dev、/tmp、/var目录。

chattr [-RV] [-+=AacDdijsSu] [-v version] 文件或目录
-R:递归处理所有的文件及子目录。
-V:详细显示修改内容,并打印输出。
-:失效属性。
+:激活属性。
= :指定属性。
A:Atime,告诉系统不要修改对这个文件的最后访问时间。
S:Sync,一旦应用程序对这个文件执行了写操作,使系统立刻把修改的结果写到磁盘。
a:Append Only,系统只允许在这个文件之后追加数据,不允许任何进程覆盖或截断这个文件。如果目录具有这个属性,系统将只允许在这个目录下建立和修改文件,而不允许删除任何文件。
i:Immutable,系统不允许对这个文件进行任何的修改。如果目录具有这个属性,那么任何的进程只能修改目录之下的文件,不允许建立和删除文件。
D:检查压缩文件中的错误。
d:No dump,在进行文件系统备份时,dump程序将忽略这个文件。
C:Compress,系统以透明的方式压缩这个文件。从这个文件读取时,返回的是解压之后的数据;而向这个文件中写入数据时,数据首先被压缩之后才写入磁盘。
S:Secure Delete,让系统在删除这个文件时,使用0填充文件所在的区域。
u:Undelete,当一个应用程序请求删除这个文件,系统会保留其数据块以便以后能够恢复删除这个文件。

12.枚举一个目录中的所有文件夹

!/bin/bash

OLDIFS=$IFS
IFS=:
for path in $( find "%%1" -type d -printf "%p$IFS")
do

"$path"

done
IFS=$OLDIFS

13.复制文件夹

!/bin/sh

cp -rf "%%1" "%%2"

14.复制一个目录下所有的文件夹到另一个目录下

!/bin/bash

direc="%%1" #$(pwd)
for dir2cp in $direc/* ; do
if [ -d $dir2cp ]; then
cp $dir2cp "%%2"
fi
done

15.移动文件夹

!/bin/sh

mv -rf "%%1" "%%2"

16.移动一个目录下所有的文件夹到另一个目录下

!/bin/bash

direc="%%1" #$(pwd)
for dir2mv in $direc/* ; do
if [ -d $dir2mv ]; then
mv $dir2mv "%%2"
fi
done

17.以一个文件夹的框架在另一个目录下创建文件夹和空文件

!/bin/bash

direc="%%1" #$(pwd)
OLDIFS=$IFS
IFS=:
for path in $( find $direc -type d -printf "%p$IFS")
do
mkdir -p "%%2/${path:${#direc}+1}"
done
IFS=$OLDIFS

cp -a "%%1" "%%2"

表达式 含义
${#string}
{#string}
1,取得字符串长度
string=abc12342341 //等号二边不要有空格
echo ${#string} //结果11
expr length $string //结果11
expr "$string" : "." //结果11 分号二边要有空格,这里的:根match的用法差不多2,字符串所在位置
expr index $string '123' //结果4 字符串对应的下标是从0开始的这个方法让我想起来了js的indexOf,各种语言对字符串的操作方法大方向都差不多,如果有语言基础的话,学习shell会很快的。
3,从字符串开头到子串的最大长度
expr match $string 'abc.
3' //结果9个人觉得这个函数的用处不大,为什么要从开头开始呢。
4,字符串截取
echo ${string:4} //2342341 从第4位开始截取后面所有字符串
echo ${string:3:3} //123 从第3位开始截取后面3位
echo ${string:3:6} //123423 从第3位开始截取后面6位
echo ${string: -4} //2341 :右边有空格 截取后4位
echo ${string:(-4)} //2341 同上
expr substr $string 3 3 //123 从第3位开始截取后面3位上面的方法让我想起了,php的substr函数,后面截取的规则是一样的。
5,匹配显示内容
//例3中也有match和这里的match不同,上面显示的是匹配字符的长度,而下面的是匹配的内容
expr match $string '([a-c][0-9])' //abc12342341
expr $string : '([a-c][0-9])' //abc1
expr $string : '.
([0-9][0-9][0-9])' //341 显示括号中匹配的内容这里括号的用法,是不是根其他的括号用法有相似之处呢,
6,截取不匹配的内容
echo ${string#a3} //42341 从$string左边开始,去掉最短匹配子串
echo ${string#c
3} //abc12342341 这样什么也没有匹配到
echo ${string#c13} //42341 从$string左边开始,去掉最短匹配子串
echo ${string##a3} //41 从$string左边开始,去掉最长匹配子串
echo ${string%3
1} //abc12342 从$string右边开始,去掉最短匹配子串
echo ${string%%3*1} //abc12 从$string右边开始,去掉最长匹配子串这里要注意,必须从字符串的第一个字符开始,或者从最后一个开始,
7,匹配并且替换
echo ${string/23/bb} //abc1bb42341 替换一次
echo ${string//23/bb} //abc1bb4bb41 双斜杠替换所有匹配
echo ${string/#abc/bb} //bb12342341 #以什么开头来匹配,根php中的^有点像
echo ${string/%41/bb} //abc123423bb %以什么结尾来匹配,根php中的$有点像

!/bin/bash

direc=$(pwd)
for file in "$(direc)/"
do
if [ "${file##
.}" = "sh" ]; then
xterm -e bash $file
elif [ "${file##.}" = "bin" ]; then
xterm -e $file
elif [ "${file##
.}" = "run" ]; then
xterm -e $file
elif [ "${file##.}" = "bundle" ]; then
xterm -e $file
elif [ "${file##
.}" = "pl" ]; then
xterm -e perl $file
elif [ "${file##.}" = "class" ]; then
xterm -e java ${file%.
}
elif [ "${file##.}" = "rpm" ]; then
xterm -e rpm -ivh $file
elif [ "${file##
.}" = "rb" ]; then
xterm -e ruby $file
elif [ "${file##.}" = "py" ]; then
xterm -e python $file
elif [ "${file##
.}" = "jar" ]; then
xterm -e java -jar $file
fi
done
OLDIFS=$IFS
IFS=:
for path in $( find $direc -type d -printf "%p$IFS")
do
for file in ls $path
do
if [ "${file##.}" = "sh" ]; then
xterm -e bash """"$path"/"$file""""
elif [ "${file##
.}" = "bin" ]; then
xterm -e """"$path"/"$file""""
elif [ "${file##.}" = "run" ]; then
xterm -e """"$path"/"$file""""
elif [ "${file##
.}" = "bundle" ]; then
xterm -e """"$path"/"$file""""
elif [ "${file##.}" = "pl" ]; then
xterm -e perl """"$path"/"$file""""
elif [ "${file##
.}" = "class" ]; then
xterm -e java """"$path"/"${file%.}""""
elif [ "${file##
.}" = "rpm" ]; then
xterm -e rpm -ivh """"$path"/"$file""""
elif [ "${file##.}" = "rb" ]; then
xterm -e ruby """"$path"/"$file""""
elif [ "${file##
.}" = "py" ]; then
xterm -e python """"$path"/"$file""""
elif [ "${file##*.}" = "jar" ]; then
xterm -e java -jar """"$path"/"$file""""
fi
done
done
IFS=$OLDIFS

18.复制文件

!/bin/sh

cp %%1 %%2

19.复制一个目录下所有的文件到另一个目录

!/bin/bash

direc="%%1" $(pwd)
for file in "$direc/*"
do
cp "$file" "%%1"
done

20.提取扩展名

!/bin/sh

%%2=${%%1##.}

21.提取文件名

!/bin/sh

%%2="$(basename %%1)"

22.提取文件路径

!/bin/sh

%%2="$(dirname %%1)"

23.替换扩展名

!/bin/sh

%%3="$(basename %%1)$%%2"

24.追加路径

!/bin/sh

%%3="$(dirname %%1)/$%%2"

25.移动文件

!/bin/sh

mv "%%1" "%%2"

26.移动一个目录下所有文件到另一个目录

!/bin/bash

direc="%%1" #$(pwd)
OLDIFS=$IFS
IFS=:
for file in "$(direc)/*"
do
mv "$file" "%%1"
done
IFS=$OLDIFS

27.指定目录下搜索文件

!/bin/sh

find -name "%%1"

28.打开文件对话框

!/bin/sh

%%1="$(Xdialog --fselect '~/' 0 0 2>&1)"

29.文件分割

!/bin/sh

split -b 2k "%%1"

while read f1 f2 f3
do
echo $f1 >> f1
echo $f2 >> f2
echo $f3 >> f3
done

!/bin/bash

linenum=wc -l httperr8007.log| awk '{print $1}'
n1=1
file=1
while [ $n1 -lt $linenum ]
do
n2=expr $n1 + 999
sed -n "${n1}, ${n2}p" httperr8007.log > file_$file.log
n1=expr $n2 + 1
file=expr $file + 1
done

其中httperr8007.log为你想分割的大文件,file_$file.log 为分割后的文件,最后为file_1.log,file_2.log,file_3.log……,分割完后的每个文件只有1000行(参数可以自己设置)

split 参数:
-b :后面可接欲分割成的档案大小,可加单位,例如 b, k, m 等;
-l :以行数来进行分割;

按每个文件1000行来分割除

split -l 1000 httperr8007.log httperr

httpaa,httpab,httpac ........

按照每个文件100K来分割

split -b 100k httperr8007.log http

httpaa,httpab,httpac ........

!/bin/bash

if [ $# -ne 2 ]; then
echo 'Usage: split file size(in bytes)'
exit
fi

file=$1
size=$2

if [ ! -f $file ]; then
echo "$file doesn't exist"
exit
fi

TODO: test if $size is a valid integer

filesize=/bin/ls -l $file | awk '{print $5}'
echo filesize: $filesize

let pieces=$filesize/$size
let remain=$filesize-$pieces*$size
if [ $remain -gt 0 ]; then
let pieces=$pieces+1
fi
echo pieces: $pieces

i=0
while [ $i -lt $pieces ];
do
echo split: $file.$i:
dd if=$file of=$file.$i bs=$size count=1 skip=$i
let i=$i+1
done

echo "#!/bin/bash" > merge

echo "i=0" >> merge
echo "while [ $i -lt $pieces ];" >> merge
echo "do" >> merge
echo " echo merge: $file.$i" >> merge
echo " if [ ! -f $file.$i ]; then" >> merge
echo " echo merge: $file.$i missed" >> merge
echo " rm -f $file.merged" >> merge
echo " exit" >> merge
echo " fi" >> merge
echo " dd if=$file.$i of=$file.merged bs=$size count=1 seek=$i" >> merge
echo " let i=$i+1" >> merge
echo "done" >> merge
chmod u+x merge'

30.文件合并

!/bin/sh

cp "%%1"+"%%2" "%%3"

exec 3 exec 4 while read f1 <&3 && read f2 <&4
do
echo $f1 $f2 >> join.txt
done

!/bin/bash

if [ $# -ne 2 ]; then
echo 'Usage: split file size(in bytes)'
exit
fi

file=$1
size=$2

if [ ! -f $file ]; then
echo "$file doesn't exist"
exit
fi

TODO: test if $size is a valid integer

filesize=/bin/ls -l $file | awk '{print $5}'
echo filesize: $filesize

let pieces=$filesize/$size
let remain=$filesize-$pieces*$size
if [ $remain -gt 0 ]; then
let pieces=$pieces+1
fi
echo pieces: $pieces

i=0
while [ $i -lt $pieces ];
do
echo split: $file.$i:
dd if=$file of=$file.$i bs=$size count=1 skip=$i
let i=$i+1
done

echo "#!/bin/bash" > merge

echo "i=0" >> merge
echo "while [ $i -lt $pieces ];" >> merge
echo "do" >> merge
echo " echo merge: $file.$i" >> merge
echo " if [ ! -f $file.$i ]; then" >> merge
echo " echo merge: $file.$i missed" >> merge
echo " rm -f $file.merged" >> merge
echo " exit" >> merge
echo " fi" >> merge
echo " dd if=$file.$i of=$file.merged bs=$size count=1 seek=$i" >> merge
echo " let i=$i+1" >> merge
echo "done" >> merge
chmod u+x merge'

31.文件简单加密

!/bin/bash

make test && make strings && sudo make install

shc -r -f %%1.sh

%%1.x

%%1.x.c

32.文件简单解密

!/bin/bash

make test && make strings && sudo make install

shc -r -f %%1.sh

%%1.x

%%1.x.c

33.读取ini文件属性

!/bin/bash

if [ "$%%3" = "" ];then
sed -n "/[$%%2]/,/[.]/{
/^[.
]/d
/^[ ]$/d
s/;.
$//
p
}" $1
elif [ "$%%4" = "" ];then
sed -n "/[$%%2]/,/[.]/{
/^[.
]/d
/^[ ]$/d
s/;.
$//
s/^[ | ]$%%3[ | ]=[ | ](.)[ | ]/\1/p
}" $1
else
if [ "$%%4" = "#" ];then
sed "/[$%%2]/,/[.
]/{
s/^[ | ]$%%3[ | ]=./ /
}p" $1 > /tmp/sed$$
mv /tmp/sed$$ $1
else
sed "/[$2]/,/[.
]/{
s/^[ | ]$%%3[ | ]=.*/$%%3=$%%4/
}p" $1 > /tmp/sed$$
mv /tmp/sed$$ $%%1
fi
fi

34.合并一个文件下所有的文件

!/bin/sh

cat $(ls |grep -E '%%1.') > %%1

!/bin/bash

OLDIFS=$IFS
IFS=:
for path in $( find %%1 -type d -printf "%p$IFS")
do
for file in $path/.c $path/.cpp
do
if [[ ! "$file" =~ *.[A-Za-z]+ ]]; then

"$(path)/$(file)"

fi
done
done
IFS=$OLDIFS

!/bin/bash

cat <<'EOF'> combine.c

include

int main()
{
FILE f1,f2,f3;
f1=fopen("a1.txt","r");
f2=fopen("a2.txt","r");
f3=fopen("a3.txt","w");
int a,b;
a=getw(f1); /
从a1.txt和a2.txt中分别取最小的数a和b/
b=getw(f2);
while(!feof(f1)&&!feof(f2)) /
两个文件都没结束时,执行循环、比较/
{
if(a<=b)
{
putw(a,f3);
a=getw(f1);
}
else
{putw(b,f3);
b=getw(f2);
}
}
if(feof(f1)) /
文件a1.txt结束时,把a2.txt中的数全部输入a3.txt/
{putw(b,f3);
while((b=getw(f2))!=EOF)
putw(b,f3);
}
if(feof(f2)) /
同上*/
{
putw(a,f3);
while((a=getw(f1))!=EOF)
putw(a,f3);
}
fclose(f1);
fclose(f2);
fclose(f3);
printf("已完成!");
return 0;
}
EOF
gcc -o combine combine.c
if [ $? -eq 0 ]; then
./combine
else
echo 'Compile ERROR'
fi

35.写入ini文件属性

!/bin/bash

if [ "$%%3" = "" ];then
sed -n "/[$%%2]/,/[.]/{
/^[.
]/d
/^[ ]$/d
s/;.
$//
p
}" $1
elif [ "$%%4" = "" ];then
sed -n "/[$%%2]/,/[.]/{
/^[.
]/d
/^[ ]$/d
s/;.
$//
s/^[ | ]$%%3[ | ]=[ | ](.)[ | ]/\1/p
}" $1
else
if [ "$%%4" = "#" ];then
sed "/[$%%2]/,/[.
]/{
s/^[ | ]$%%3[ | ]=./ /
}p" $1 > /tmp/sed$$
mv /tmp/sed$$ $%%1
else
sed "/[$%%2]/,/[.
]/{
s/^[ | ]$%%3[ | ]=.*/$%%3=$%%4/
}p" $1 > /tmp/sed$$
mv /tmp/sed$$ $%%1
fi
fi

36.获得当前路径

!/bin/sh

%%1=$(pwd)

37.读取XML数据库

如何通过shell命令行读取xml文件中某个属性所对应的值?
例如:
BuildVersion 5
我希望能够通过Unix shell命令对属性键的名称BuildVersion进行查询,返回的结果是5,如何实现呀?

!/bin/bash

grep BuildVersion|sed 's/.<.>([^<].)<.>.*/\1/'

结果返回的是“BuildVersion”,而不是“5”,如果要查询BuildVersion自动返回数值5应当如何写?

应该没错的。试一下: echo "BuildVersion 5"|grep BuildVersion|sed 's/.<.>([^<].)<.>.*/\1/'我在SL的终端里试,返回值是5

目前需要从xml文件提取数据,想做一个xmlparser.sh
xml 类似这样


希望输入 xmlparser.sh a.xml hostip可以返回192.168.0.1

!/bin/sh

if [ $# -ne 2 ];then
echo "Usage: $0 "
exit 0
fi

grep $2 $1|awk '{print $2}'|grep -o "[0-9.]*"


grep $2 $1|awk '{print $2}'|grep -o "[0-9.]*"
改成
grep $2 $1|awk '{print $2}'|grep -Eo "[0-9.]+"
楼上这个有问题,如果我要得到的是



中的sharename,那么,呵呵,就错了

我觉得应该先定位到第二个参数“$2”的位置,然后再提取“=”后面的内容

这里有个完整的实现:
Parse Simple XML Files using Bash – Extract Name Value Pairs and Attributes
http://www.humbug.in/2010/parse-simple-xml-files-using-bash-extract-name-value-pairs-and-attributes/

不过需要安装xmllint.

设计到对多个xml文件进行element的读取和列表。有人做过么?
举个例子,
多个xml文件里面都有


xxx</titlel><br> </article></p> <p>通过shell读取,然后合并到一起,再生成一个新的xml,但是其他元素不变。<br> <article><br> <title>aaa</titlel><br> </article><br> <article><br> <title>bbb</titlel><br> </article></p> <p>如果格式异常简单,没有特例,那么可以用shell实现<br> 如果有可能格式复杂,因为shell的命令所使用的正则表达式都不支持跨行匹配,所以用shell来解决这个问题就绕圈子了。<br> 用perl来作这个工作最直接、简单。perl的XML:DOM模块是专门处理XML文件的。</p> <p>偶倒是觉得,用PHP写Scripts也很方便,功能强大,而且,跨平台,</p> <h1>!/bin/sh</h1> <p>sed -n '/<article>/{</p> <p>N;</p> <p>/\n[[:space:]]*<title>/{</p> <pre><code>N; /<article>.*<\/article>/p } </code></pre> <p>D;</p> <p>n</p> <p>}'</p> <p>这小段代码能把一个xml文件中,你要的东西拿出来.<br> 你可以用for file in $*把这些信息都>>tmpfile中.<br> 然后用sed 在指定文件的指定位置用r命令把tmpfile粘贴进来~~~~</p> <p>大思路如此<sup>_</sup> 我想有这个东西(只要能正确的跑出结果)后面就不难了吧...</p> <p>Name<br> xmllint — command line XML tool</p> <p>Synopsis<br> xmllint [[--version] | [--debug] | [--shell] | [--debugent] | [--copy] | [--recover] | [--noent] | [--noout] | [--nonet] | [--htmlout] | [--nowrap] | [--valid] | [--postvalid] | [--dtdvalid URL] | [--dtdvalidfpi FPI] | [--timing] | [--output file] | [--repeat] | [--insert] | [--compress] | [--html] | [--xmlout] | [--push] | [--memory] | [--maxmem nbbytes] | [--nowarning] | [--noblanks] | [--nocdata] | [--format] | [--encode encoding] | [--dropdtd] | [--nsclean] | [--testIO] | [--catalogs] | [--nocatalogs] | [--auto] | [--xinclude] | [--noxincludenode] | [--loaddtd] | [--dtdattr] | [--stream] | [--walker] | [--pattern patternvalue] | [--chkregister] | [--relaxng] | [--schema] | [--c14n]] [xmlfile]</p> <p>Introduction<br> The xmllint program parses one or more XML files, specified on the command line as xmlfile. It prints various types of output, depending upon the options selected. It is useful for detecting errors both in XML code and in the XML parser itself.</p> <p>It is included in libxml2.</p> <p>Options<br> --version<br> Display the version of libxml2 used.<br> --debug<br> Parse a file and output an annotated tree of the in-memory version of the document.<br> --shell<br> Run a navigating shell. Details on available commands in shell mode are below.<br> --debugent<br> Debug the entities defined in the document.<br> --copy<br> Test the internal copy implementation.<br> --recover<br> Output any parsable portions of an invalid document.<br> --noent<br> Substitute entity values for entity references. By default, xmllint leaves entity references in place.<br> --nocdata<br> Substitute CDATA section by equivalent text nodes.<br> --nsclean<br> Remove redundant namespace declarations.<br> --noout<br> Suppress output. By default, xmllint outputs the result tree.<br> --htmlout<br> Output results as an HTML file. This causes xmllint to output the necessary HTML tags surrounding the result tree output so the results can be displayed in a browser.<br> --nowrap<br> Do not output HTML doc wrapper.<br> --valid<br> Determine if the document is a valid instance of the included Document Type Definition (DTD). A DTD to be validated against also can be specified at the command line using the --dtdvalid option. By default, xmllint also checks to determine if the document is well-formed.<br> --postvalid<br> Validate after parsing is completed.<br> --dtdvalid URL<br> Use the DTD specified by URL for validation.<br> --dtdvalidfpi FPI<br> Use the DTD specified by the Public Identifier FPI for validation, note that this will require a Catalog exporting that Public Identifier to work.<br> --timing<br> Output information about the time it takes xmllint to perform the various steps.<br> --output file<br> Define a file path where xmllint will save the result of parsing. Usually the programs build a tree and save it on stdout, with this option the result XML instance will be saved onto a file.<br> --repeat<br> Repeat 100 times, for timing or profiling.<br> --insert<br> Test for valid insertions.<br> --compress<br> Turn on gzip compression of output.<br> --html<br> Use the HTML parser.<br> --xmlout<br> Used in conjunction with --html. Usually when HTML is parsed the document is saved with the HTML serializer, but with this option the resulting document is saved with the XML serializer. This is primarily used to generate XHTML from HTML input.<br> --push<br> Use the push mode of the parser.<br> --memory<br> Parse from memory.<br> --maxmem nnbytes<br> Test the parser memory support. nnbytes is the maximum number of bytes the library is allowed to allocate. This can also be used to make sure batch processing of XML files will not exhaust the virtual memory of the server running them.<br> --nowarning<br> Do not emit warnings from the parser and/or validator.<br> --noblanks<br> Drop ignorable blank spaces.<br> --format<br> Reformat and reindent the output. The $XMLLINT_INDENT environment variable controls the indentation (default value is two spaces " ").<br> --testIO<br> Test user input/output support.<br> --encode encoding<br> Output in the given encoding.<br> --catalogs<br> Use the catalogs from $SGML_CATALOG_FILES. Otherwise /etc/xml/catalog is used by default.<br> --nocatalogs<br> Do not use any catalogs.<br> --auto<br> Generate a small document for testing purposes.<br> --xinclude<br> Do XInclude processing.<br> --noxincludenode<br> Do XInclude processing but do not generate XInclude start and end nodes.<br> --loaddtd<br> Fetch external DTD.<br> --dtdattr<br> Fetch external DTD and populate the tree with inherited attributes.<br> --dropdtd<br> Remove DTD from output.<br> --stream<br> Use streaming API - useful when used in combination with --relaxng or --valid options for validation of files that are too large to be held in memory.<br> --walker<br> Test the walker module, which is a reader interface but for a document tree, instead of using the reader API on an unparsed document it works on a existing in-memory tree. Used in debugging.<br> --chkregister<br> Turn on node registration. Useful for developers testing libxml2 node tracking code.<br> --pattern patternvalue<br> Used to exercise the pattern recognition engine, which can be used with the reader interface to the parser. It allows to select some nodes in the document based on an XPath (subset) expression. Used for debugging.<br> --relaxng schema<br> Use RelaxNG file named schema for validation.<br> --schema schema<br> Use a W3C XML Schema file named schema for validation.<br> --c14n<br> Use the W3C XML Canonicalisation (C14N) to serialize the result of parsing to stdout. It keeps comments in the result.<br> Shell<br> xmllint offers an interactive shell mode invoked with the --shell command. Available commands in shell mode include:</p> <p>base<br> display XML base of the node<br> bye<br> leave shell<br> cat node<br> Display node if given or current node.<br> cd path<br> Change the current node to path (if given and unique) or root if no argument given.<br> dir path<br> Dumps information about the node (namespace, attributes, content).<br> du path<br> Show the structure of the subtree under path or the current node.<br> exit<br> Leave the shell.<br> help<br> Show this help.<br> free<br> Display memory usage.<br> load name<br> Load a new document with the given name.<br> ls path<br> List contents of path (if given) or the current directory.<br> pwd<br> Display the path to the current node.<br> quit<br> Leave the shell.<br> save name<br> Saves the current document to name if given or to the original name.<br> validate<br> Check the document for error.<br> write name<br> Write the current node to the given filename.<br> Catalogs<br> Catalog behavior can be changed by redirecting queries to the user's own set of catalogs. This can be done by setting the XML_CATALOG_FILES environment variable to a list of catalogs. An empty one should deactivate loading the default /etc/xml/catalog default catalog.</p> <p>Debugging Catalogs<br> Setting the environment variable XML_DEBUG_CATALOG using the command "export XML_DEBUG_CATALOG=" outputs debugging information related to catalog operations.</p> <p>Error Return Codes<br> On the completion of execution, Xmllint returns the following error codes:</p> <p>0<br> No error<br> 1<br> Unclassified<br> 2<br> Error in DTD<br> 3<br> Validation error<br> 4<br> Validation error<br> 5<br> Error in schema compilation<br> 6<br> Error writing output<br> 7<br> Error in pattern (generated when [--pattern] option is used)<br> 8<br> Error in Reader registration (generated when [--chkregister] option is used)<br> 9<br> Out of memory error</p> <p>Parse Simple XML Files using Bash – Extract Name Value Pairs and Attributes</p> <p>2 Comments<br> 1<br> Tweet</p> <p>Pratik Sinha | July 31, 2010</p> <p>I have written up a simple routine par<strong><em>ML to parse simple XML files to extract unique name values pairs and their attributes. The script extracts all xml tags of the format <abc arg1="hello">xyz</abc> and dynamically creates bash variables which hold values of the attributes as well as the elements. This is a good solution, if you don’t wish to use xpath for some simple xml files. However you will need xmllint installed on your system to use the script. Here’s a sample script which uses the par</em></strong>ML function</p> <h1>!/bin/bash</h1> <p>xmlFile=$1</p> <p>function par*<em><em>ML() {<br> elemList=( $(cat $xmlFile | tr '\n' ' ' | XMLLINT_INDENT="" xmllint --format - | /bin/grep -e "</.</em>>$" | while read line; do <br> echo $line | sed -e 's/^.</em><///' | cut -d '>' -f 1; <br> done) )</p> <p>totalNoOfTags=${#elemList[@]}; ((totalNoOfTags--))<br> suffix=$(echo ${elemList[$totalNoOfTags]} | tr -d '</>')<br> suffix="${suffix}_"</p> <p>for (( i = 0 ; i < ${#elemList[@]} ; i++ )); do<br> elem=${elemList[$i]}<br> elemLine=$(cat $xmlFile | tr '\n' ' ' | XMLLINT_INDENT="" xmllint --format - | /bin/grep "</$elem>")<br> echo $elemLine | grep -e "<sup></[</sup> ]<em>>$" 1>/dev/null 2>&1<br> if [ "0" = "$?" ]; then<br> continue<br> fi<br> elemVal=$(echo $elemLine | tr '\011' '\040'| sed -e 's/^[ ]</em>//' -e 's/<sup><.*>([</sup><].<em>)<.</em>>$/\1/' | sed -e 's/^[ ]<em>//' | sed -e 's/[ ]</em>$//')<br> xmlElem="${suffix}$(echo $elem | sed 's/-/_/g')"<br> eval ${xmlElem}=<code>echo -ne \""${elemVal}"\"</code><br> attrList=($(cat $xmlFile | tr '\n' ' ' | XMLLINT_INDENT="" xmllint --format - | /bin/grep "</$elem>" | tr '\011' '\040' | sed -e 's/^[ ]<em>//' | cut -d '>' -f 1 | sed -e 's/<sup><[</sup> ]</em>//' | tr "'" '"' | tr '"' '\n' | tr '=' '\n' | sed -e 's/^[ ]*//' | sed '/^$/d' | tr '\011' '\040' | tr ' ' '>'))<br> for (( j = 0 ; j < ${#attrList[@]} ; j++ )); do<br> attr=${attrList[$j]}<br> ((j++))<br> attrVal=$(echo ${attrList[$j]} | tr '>' ' ')<br> attrName=<code>echo -ne ${xmlElem}_${attr}</code><br> eval ${attrName}=<code>echo -ne \""${attrVal}"\"</code><br> done<br> done<br> }</p> <p>par***ML<br> echo "$status_xyz | $status_abc | $status_pqr" #Variables for each XML ELement<br> echo "$status_xyz_arg1 | $status_abc_arg2 | $status_pqr_arg3 | $status_pqr_arg4" #Variables for each XML Attribute<br> echo ""</p> <h1>All the variables that were produced by the par***ML function</h1> <p>set | /bin/grep -e "^$suffix"</p> <p>The XML File used for the above script example is:<br> <?xml version="1.0"?><br> <status><br> <xyz arg1="1"> a </xyz><br> <abc arg2="2"> p </abc><br> <pqr arg3="3" arg4="a phrase"> x </pqr><br> </status></p> <p>The root tag, which in this case is “status”, is used as a suffix for all variables. Once the XML file is passed to the function, it dynamically creates the variables $status_xyz, $status_abc, $status_pqr, $status_xyz_arg1, $status_abc_arg2, $status_pqr_arg3 and $status_pqr_arg4.</p> <p>The output when the script is ran with the xml file as an argument is<br> @$ bash par***ML.sh test.xml<br> a | p | x<br> 1 | 2 | 3 | a phrase</p> <p>status_abc=p<br> status_abc_arg2=2<br> status_pqr=x<br> status_pqr_arg3=3<br> status_pqr_arg4='a phrase'<br> status_xyz=a<br> status_xyz_arg1=1</p> <p>This script won’t work for XML files like the one below with duplicate element names.<br> <?xml version="1.0"?><br> <status><br> <test arg1="1"> a </test><br> <test arg2="2"> p </test><br> <test arg3="3" arg4="a phrase"> x </test><br> </status></p> <p>This script also won’t be able to extract attributes of elements without any CDATA. For eg, the script won’t be able to create variables corresponding to <test arg1="1">. It will only create the variables corresponding to <test1 arg2="2">abc</test1>.<br> <?xml version="1.0"?><br> <status><br> <test arg1="1"><br> <test1 arg2="2">abc</test1><br> </test><br> </status></p> <p>38.写入XML数据库</p> <h1>!/bin/bash</h1> <p>39.ZIP压缩文件</p> <h1>!/bin/sh</h1> <p>zip -r "/%%1" "%%2"</p> <p>40.ZIP解压缩</p> <h1>!/bin/sh</h1> <p>unzip -x "/%%1" "%%2"</p> <p>41.获得应用程序完整路径</p> <h1>!/bin/bash</h1> <p>42.ZIP压缩文件夹</p> <h1>!/bin/bash</h1> <p>43.递归删除目录下的文件</p> <h1>!/bin/bash</h1> <p>rm -if "%%1/<em>"<br> OLDIFS=$IFS<br> IFS=:<br> for path in $( find %%1 -type d -printf "%p$IFS")<br> do<br> for file in $path/</em>.c $path/*.cpp<br> do<br> if [[ ! "$file" =~ *.[A-Za-z]+ ]]; then</p> <h1>"$(path)/$(file)"</h1> <p>fi<br> done<br> done<br> IFS=$OLDIFS</p> <p>44.IDEA加密算法</p> <h1>!/bin/bash</h1> <p>45.RC6算法</p> <h1>!/bin/bash</h1> <p>cat <<'EOF'> rc6.c</p> <h1>include<stdio.h></h1> <p>/* Timing data for RC6 (rc6.c)</p> <p>128 bit key:<br> Key Setup: 1632 cycles<br> Encrypt: 270 cycles = 94.8 mbits/sec<br> Decrypt: 226 cycles = 113.3 mbits/sec<br> Mean: 248 cycles = 103.2 mbits/sec</p> <p>192 bit key:<br> Key Setup: 1885 cycles<br> Encrypt: 267 cycles = 95.9 mbits/sec<br> Decrypt: 235 cycles = 108.9 mbits/sec<br> Mean: 251 cycles = 102.0 mbits/sec</p> <p>256 bit key:<br> Key Setup: 1877 cycles<br> Encrypt: 270 cycles = 94.8 mbits/sec<br> Decrypt: 227 cycles = 112.8 mbits/sec<br> Mean: 249 cycles = 103.0 mbits/sec</p> <p>*/</p> <h1>include "../std_defs.h"</h1> <p>static char *alg_name[] = { "rc6", "rc6.c", "rc6" };</p> <p>char **cipher_name()<br> {<br> return alg_name;<br> }</p> <h1>define f_rnd(i,a,b,c,d) \</h1> <pre><code> u = rotl(d * (d + d + 1), 5); \ t = rotl(b * (b + b + 1), 5); \ a = rotl(a ^ t, u) + l_key; \ c = rotl(c ^ u, t) + l_key[i + 1] </code></pre> <h1>define i_rnd(i,a,b,c,d) \</h1> <pre><code> u = rotl(d * (d + d + 1), 5); \ t = rotl(b * (b + b + 1), 5); \ c = rotr(c - l_key[i + 1], t) ^ u; \ a = rotr(a - l_key, u) ^ t </code></pre> <p>u4byte l_key[44]; /* storage for the key schedule */</p> <p>/* initialise the key schedule from the user supplied key */</p> <p>u4byte *set_key(const u4byte in_key[], const u4byte key_len)<br> { u4byte i, j, k, a, b, l[8], t;</p> <pre><code>l_key[0] = 0xb7e15163; for(k = 1; k < 44; ++k) l_key[k] = l_key[k - 1] + 0x9e3779b9; for(k = 0; k < key_len / 32; ++k) l[k] = in_key[k]; t = (key_len / 32) - 1; // t = (key_len / 32); a = b = i = j = 0; for(k = 0; k < 132; ++k) { a = rotl(l_key + a + b, 3); b += a; b = rotl(l[j] + b, b); l_key = a; l[j] = b; i = (i == 43 ? 0 : i + 1); // i = (i + 1) % 44; j = (j == t ? 0 : j + 1); // j = (j + 1) % t; } return l_key; </code></pre> <p>};</p> <p>/* encrypt a block of text */</p> <p>void encrypt(const u4byte in_blk[4], u4byte out_blk[4])<br> { u4byte a,b,c,d,t,u;</p> <pre><code>a = in_blk[0]; b = in_blk[1] + l_key[0]; c = in_blk[2]; d = in_blk[3] + l_key[1]; f_rnd( 2,a,b,c,d); f_rnd( 4,b,c,d,a); f_rnd( 6,c,d,a,b); f_rnd( 8,d,a,b,c); f_rnd(10,a,b,c,d); f_rnd(12,b,c,d,a); f_rnd(14,c,d,a,b); f_rnd(16,d,a,b,c); f_rnd(18,a,b,c,d); f_rnd(20,b,c,d,a); f_rnd(22,c,d,a,b); f_rnd(24,d,a,b,c); f_rnd(26,a,b,c,d); f_rnd(28,b,c,d,a); f_rnd(30,c,d,a,b); f_rnd(32,d,a,b,c); f_rnd(34,a,b,c,d); f_rnd(36,b,c,d,a); f_rnd(38,c,d,a,b); f_rnd(40,d,a,b,c); out_blk[0] = a + l_key[42]; out_blk[1] = b; out_blk[2] = c + l_key[43]; out_blk[3] = d; </code></pre> <p>};</p> <p>/* decrypt a block of text */</p> <p>void decrypt(const u4byte in_blk[4], u4byte out_blk[4])<br> { u4byte a,b,c,d,t,u;</p> <pre><code>d = in_blk[3]; c = in_blk[2] - l_key[43]; b = in_blk[1]; a = in_blk[0] - l_key[42]; i_rnd(40,d,a,b,c); i_rnd(38,c,d,a,b); i_rnd(36,b,c,d,a); i_rnd(34,a,b,c,d); i_rnd(32,d,a,b,c); i_rnd(30,c,d,a,b); i_rnd(28,b,c,d,a); i_rnd(26,a,b,c,d); i_rnd(24,d,a,b,c); i_rnd(22,c,d,a,b); i_rnd(20,b,c,d,a); i_rnd(18,a,b,c,d); i_rnd(16,d,a,b,c); i_rnd(14,c,d,a,b); i_rnd(12,b,c,d,a); i_rnd(10,a,b,c,d); i_rnd( 8,d,a,b,c); i_rnd( 6,c,d,a,b); i_rnd( 4,b,c,d,a); i_rnd( 2,a,b,c,d); out_blk[3] = d - l_key[1]; out_blk[2] = c; out_blk[1] = b - l_key[0]; out_blk[0] = a; </code></pre> <p>};<br> int main()<br> {</p> <p>return 0;<br> }<br> EOF<br> gcc -o rc6 rc6.c<br> if [ $? -eq 0 ]; then<br> ./combine<br> else<br> echo 'Compile ERROR'<br> fi</p> <p>46.Grep</p> <h1>!/bin/bash</h1> <p>grep -qE %%1 %%2</p> <p>47.直接创建多级目录</p> <h1>!/bin/bash</h1> <p>mkdir -p %%1</p> <p>48.批量重命名</p> <h1>!/bin/bash</h1> <p>find $PWD -type f -name '*.cpp' |sed s/'.cpp'//g|awk '{MV = "mv"};{C = ".c"};{ CPP=".cpp"}; {print MV, $1 CPP , $1 C}'|sh<br> ls | awk -F '-' '{print "mv "$0" "$2}' #去掉带'-'的前缀</p> <p>49.文本查找替换</p> <h1>!/bin/bash</h1> <p>sed -e 's:%%2:%%3:g' %%1</p> <h1>sed -e 's/%%2/%%3/g' %%1</h1> <p>50.文件关联</p> <h1>!/bin/bash</h1> <p>51.批量转换编码从GB2312到Unicode</p> <h1>!/bin/bash</h1> <p>scode="gbk"<br> dcode="ucs2"<br> for FILE in $(find $(pwd) -type f)<br> do<br> TMP_file=$(mktemp -p $(pwd))<br> if [ -f $FILE ]; then<br> Fright=$(stat -c %a $FILE)<br> Fuser=$(stat -c %U $FILE)<br> Fgrp=$(stat -c %G $FILE)<br> iconv -f $scode -t $dcode $FILE -o $TMP_file<br> mv $TMP_file $FILE<br> chmod $Fright $FILE<br> chown $Fuser.$Fgrp $FILE<br> fi<br> done</p> <p>52.设置JDK环境变量</p> <h1>!/bin/bash</h1> <p>find "$PWD" -type f ( -iname '<em>.bin' ) -print0 | xargs -0 chmod +x<br> find -type f ( -iname '</em>.bin' ) -print |<br> while read filename<br> do<br> case "$filename" in<br> <em>.bin)<br> xterm -e "$filename" && rm -if "$filename"<br> ;;<br> esac<br> done<br> OLDIFS=$IFS<br> IFS=$'\n'<br> for line in <code>cat ~/.bashrc</code><br> do<br> if [[ "$line" =~ .</em>export.* ]]; then<br> if [[ "$line" =~ .<em>JAVA_HOME=.</em> ]]; then<br> if [[ "$line" =~ =(/([0-9a-zA-Z._]+))+ ]]; then<br> javahome=$line<br> fi<br> fi<br> fi<br> if [[ "$line" =~ export\ PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin$ ]];then<br> javapath=$line<br> fi<br> if [[ "$line" =~ export\ CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib$ ]];then<br> classpath=$line<br> fi<br> done<br> if [ ! -n "$javahome" ]; then<br> sed -i '$a export JAVA_HOME='$(pwd)'/jdk1.6.0_25' ~/.bashrc<br> else<br> sed -i 's:'${javahome//\/\\}':export JAVA_HOME='$(pwd)'/jdk1.6.0_32:g' ~/.bashrc<br> fi<br> if [ ! -n "$javapath" ]; then<br> sed -i '$a export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin' ~/.bashrc<br> fi<br> if [ ! -n "$classpath" ]; then<br> sed -i '$a export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib' ~/.bashrc<br> fi<br> IFS=$OLDIFS</p> <h1>!/bin/bash</h1> <p>shift<br> OLDIFS=$IFS<br> IFS=$'\n'<br> for line in <code>cat ~/TestBash.txt</code> #~/.bashrc<br> do<br> if [[ "$line" =~ .<em>export.</em> ]]; then<br> if [[ "$line" =~ export\ CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib$ ]]; then<br> classpath=$line<br> elif [[ "$line" =~ export\ PATH=$PATH:$CATALINA_HOME/bin$ ]]; then<br> jbosspath=$line<br> fi<br> if [[ "$line" =~ .<em>JAVA_HOME=.</em> ]]; then<br> if [[ "$line" =~ =(/([0-9a-zA-Z.<em>]+))+ ]];then<br> javahome=$line<br> fi<br> elif [[ "$line" =~ .<em>CATALINA_HOME=.</em> ]];then<br> if [[ "$line" =~ =(/([0-9a-zA-Z.</em>]+))+ ]];then<br> catalinahome=$line<br> fi<br> elif [[ "$line" =~ .<em>TOMCAT_HOME=.</em> ]];then<br> if [[ "$line" =~ =(/([0-9a-zA-Z.<em>]+))+ ]];then<br> tomcathome=$line<br> fi<br> elif [[ "$line" =~ .<em>CATALINA_BASE=.</em> ]];then<br> if [[ "$line" =~ =(/([0-9a-zA-Z.</em>]+))+ ]];then<br> catalinabase=$line<br> fi<br> elif [[ "$line" =~ .<em>JBOSS_HOME=.</em> ]];then<br> if [[ "$line" =~ =(/([0-9a-zA-Z._]+))+ ]];then<br> jbosshome=$line<br> fi<br> fi<br> elif [[ "$line" =~ ^PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin$ ]];then<br> javapath=$line<br> fi<br> if [[ "$line" =~ export\ CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib$ ]];then<br> classpath=$line<br> fi<br> if [[ "$line" =~ export\ PATH=$PATH:$JBOSS_HOME/bin$ ]];then<br> jbosspath=$line<br> fi<br> done<br> if [ ! -n "$javahome" ]; then<br> sed -i '$a export JAVA_HOME='$(pwd)'/jdk1.6.0_24' ~/TestBash.txt #~/.bashrc<br> else<br> sed -i 's:'${javahome//\/\\}':export JAVA_HOME='$(pwd)'/jdk1.6.0_24:g' ~/TestBash.txt<br> fi<br> if [ ! -n "$javapath" ]; then<br> sed -i '$a PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin' ~/TestBash.txt #~/.bashrc<br> fi<br> if [ ! -n "$classpath" ]; then<br> sed -i '$a export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib' ~/TestBash.txt #~/.bashrc<br> fi<br> if [ ! -n "$catalinahome" ]; then<br> sed -i '$a export CATALINA_HOME='$(pwd) ~/TestBash.txt #~/.bashrc<br> else<br> sed -i 's:'${catalinahome//\/\\}':export CATALINA_HOME='$(pwd)':g' ~/TestBash.txt<br> fi<br> if [ ! -n "$tomcathome" ]; then<br> sed -i '$a export TOMCAT_HOME='$(pwd) ~/TestBash.txt #~/.bashrc<br> else<br> sed -i 's:'${tomcathome//\/\\}':export TOMCAT_HOME='$(pwd)':g' ~/TestBash.txt<br> fi<br> if [ ! -n "$catalinabase" ]; then<br> sed -i '$a export CATALINA_BASE='$(pwd) ~/TestBash.txt #~/.bashrc<br> else<br> sed -i 's:'${catalinabase//\/\\}':export CATALINA_BASE='$(pwd)':g' ~/TestBash.txt<br> fi<br> if [ ! -n "$jbosshome" ]; then<br> sed -i '$a export JBOSS_HOME='$(pwd) ~/TestBash.txt #~/.bashrc<br> else<br> sed -i 's:'${jbosshome//\/\\}':export JBOSS_HOME='$(pwd)':g' ~/TestBash.txt<br> fi<br> if [ ! -n "$jbosspath" ]; then<br> sed -i '$a export PATH=$PATH:$CATALINA_HOME/bin' ~/TestBash.txt #~/.bashrc<br> fi<br> IFS=$OLDIFS</p> <p>53.批量转换编码从Unicode到GB2312</p> <h1>!/bin/bash</h1> <p>scode="ucs2"<br> dcode="gbk"<br> for FILE in $(find $(pwd) -type f)<br> do<br> TMP_file=$(mktemp -p $(pwd))<br> if [ -f $FILE ]; then<br> Fright=$(stat -c %a $FILE)<br> Fuser=$(stat -c %U $FILE)<br> Fgrp=$(stat -c %G $FILE)<br> iconv -f $scode -t $dcode $FILE -o $TMP_file<br> mv $TMP_file $FILE<br> chmod $Fright $FILE<br> chown $Fuser.$Fgrp $FILE<br> fi<br> done</p> <p>54.删除空文件夹</p> <h1>!/bin/bash</h1> <p>rmdir -p %%1</p> <p>55.GB2312文件转UTF-8格式</p> <h1>!/bin/bash</h1> <p>iconv -f gbk -t utf8 %%1 -o %%2</p> <p>56.UTF-8文件转GB2312格式</p> <h1>!/bin/bash</h1> <p>iconv -f utf8 -t gbk %%1 -o %%2</p> <p>57.获取文件路径的父路径</p> <h1>!/bin/bash</h1> <p>%%1=basename $PWD</p> <p>58.Unicode文件转UTF-8格式</p> <h1>!/bin/bash</h1> <p>iconv -f ucs2 -t utf-8 %%1 -o %%2</p> <p>59.CRC循环冗余校验</p> <h1>!/bin/bash</h1> <p>cat <<'EOF'> crc.c</p> <h1>include<stdio.h></h1> <p>unsigned long int crc32_table[256];</p> <p>unsigned long int ulPolynomial = 0x04c11db7;</p> <p>unsigned long int Reflect(unsigned long int ref, char ch)</p> <p>{ unsigned long int value(0);</p> <pre><code> // 交换bit0和bit7,bit1和bit6,类推 for(int i = 1; i < (ch + 1); i++) { if(ref & 1) value |= 1 << (ch - i); ref >>= 1; } return value; </code></pre> <p>}</p> <p>init_crc32_table()</p> <p>{ unsigned long int crc,temp;</p> <pre><code> // 256个值 for(int i = 0; i <= 0xFF; i++) { temp=Reflect(i, 8); crc32_table[i]= temp<< 24; for (int j = 0; j < 8; j++){ unsigned long int t1,t2; </code></pre> <p>unsigned long int flag=crc32_table[i]&0x80000000;</p> <pre><code> t1=(crc32_table[i] << 1); if(flag==0) t2=0; else t2=ulPolynomial; crc32_table[i] =t1^t2 ; } crc=crc32_table[i]; crc32_table[i] = Reflect(crc32_table[i], 32); } </code></pre> <p>}<br> unsigned long GenerateCRC32(char xdata * DataBuf,unsigned long len)</p> <p>{</p> <pre><code> unsigned long oldcrc32; unsigned long crc32; unsigned long oldcrc; unsigned int charcnt; char c,t; oldcrc32 = 0x00000000; //初值为0 charcnt=0; while (len--) { t= (oldcrc32 >> 24) & 0xFF; //要移出的字节的值 oldcrc=crc_32_tab[t]; //根据移出的字节的值查表 c=DataBuf[charcnt]; //新移进来的字节值 oldcrc32= (oldcrc32 << 8) | c; //将新移进来的字节值添在寄存器末字节中 oldcrc32=oldcrc32^oldcrc; //将寄存器与查出的值进行xor运算 charcnt++; } crc32=oldcrc32; return crc32; </code></pre> <p>}</p> <p>参数表可以先在PC机上算出来,也可在程序初始化时完成。下面是用于计算参数表的c语言子程序,在Visual C++ 6.0下编译通过。</p> <h1>include <stdio.h></h1> <p>unsigned long int crc32_table[256];</p> <p>unsigned long int ulPolynomial = 0x04c11db7;</p> <p>unsigned long int Reflect(unsigned long int ref, char ch)</p> <p>{ unsigned long int value(0);</p> <pre><code> // 交换bit0和bit7,bit1和bit6,类推 for(int i = 1; i < (ch + 1); i++) { if(ref & 1) value |= 1 << (ch - i); ref >>= 1; } return value; </code></pre> <p>}<br> int main()<br> {<br> unsigned long int crc,temp;</p> <pre><code> // 256个值 for(int i = 0; i <= 0xFF; i++) { </code></pre> <p>temp=Reflect(i, 8);<br> crc32_table[i]= temp<< 24;</p> <pre><code> for (int j = 0; j < 8; j++){ unsigned long int t1,t2; </code></pre> <p>unsigned long int flag=crc32_table[i]&0x80000000;<br> t1=(crc32_table[i] << 1);</p> <pre><code> if(flag==0) t2=0; else t2=ulPolynomial; crc32_table[i] =t1^t2 ; </code></pre> <p>}</p> <pre><code> crc=crc32_table[i]; crc32_table[i] = Reflect(crc32_table[i], 32); } </code></pre> <p>return 0;<br> }<br> EOF<br> gcc -o crc crc.c<br> if [ $? -eq 0 ]; then<br> ./combine<br> else<br> echo 'Compile ERROR'<br> fi</p> <p>60.判断是否为空文件</p> <h1>!/bin/bash</h1> <p>61.终止程序</p> <h1>!/bin/sh</h1> <p>kill -KILL pidof %%1 -s</p> <h1>killall %%1</h1> <p>62.定时关机</p> <h1>!/bin/sh</h1> <p>shutdown -h %%1 & #23:00</p> <h1>shutdown -h now</h1> <h1>halt</h1> <h1>/sbin/poweroff</h1> <h1>init 0</h1> <p>63.显示进程列表</p> <h1>!/bin/sh</h1> <p>ps aux</p> <h1>fuser -l</h1> <p>64.遍历文件夹列出文件大小</p> <h1>!/bin/sh</h1> <p>du -sH "%%1/*"</p> <p>65.GOST算法</p> <h1>!/bin/bash</h1> <p>66.对目标压缩文件解压缩到指定文件夹</p> <h1>!/bin/bash</h1> <p>67.保存文件时重名自动生成新文件</p> <h1>!/bin/bash</h1> <p>68.打开网页</p> <h1>!/bin/sh</h1> <p>lynx %%1</p> <p>69.删除空文件夹整合操作</p> <h1>!/bin/bash</h1> <p>70.获取磁盘所有分区</p> <h1>!/bin/sh</h1> <p>df -k</p> <p>71.激活一个程序或程序关联的文件</p> <h1>!/bin/bash</h1> <p>72.MP3播放</p> <h1>!/bin/sh</h1> <p>amp "%%1"</p> <p>73.WAV播放</p> <h1>!/bin/sh</h1> <p>amp "%%1"</p> <p>74.写图像到剪切板</p> <h1>!/bin/bash</h1> <p>75.从剪贴板复制图像到窗体</p> <h1>!/bin/bash</h1> <p>76.删除文件夹下的所有文件且不删除文件夹下的文件夹</p> <h1>!/bin/sh</h1> <p>rm -if "%%1/*"</p> <p>77.XML遍历结点属性值</p> <h1>!/bin/bash</h1> <p>78.Unicode文件转GB2312格式</p> <h1>!/bin/sh</h1> <p>iconv -f ucs2 -t gbk %%1 -o %%2</p> <p>79.开源程序库Xercesc-C++代码工程中内联80.提取包含头文件列表</p> <h1>!/bin/bash</h1> <p>81.GB2312文件转Unicode格式</p> <h1>!/bin/sh</h1> <p>iconv -f gbk -t ucs2 %%1 -o %%2</p> <p>82.Java程序打包</p> <h1>!/bin/bash</h1> <p>83.UTF-8文件转Unicode格式</p> <h1>!/bin/bash</h1> <p>iconv -f utf8 -t ucs2 %%1 -o %%2</p> <p>84.创建PDF文档</p> <h1>!/bin/bash</h1> <p>85.创建Word文档</p> <h1>!/bin/bash</h1> <p>86.快速高效的文件加密</p> <h1>!/bin/bash</h1> <p>87.从CSV文件构造XML文档</p> <h1>!/bin/bash</h1> <p>88.从XML文档生成CSV文件</p> <h1>!/bin/bash</h1> <p>89.模拟键盘输入字符串</p> <h1>!/bin/bash</h1> <p>90.提取PDF文件中的文本</p> <h1>!/bin/bash</h1> <p>91.操作内存映射文件</p> <h1>!/bin/bash</h1> <p>91.1发送内存映射数据</p> <h1>!/bin/bash</h1> <p>91.2接收内存映射数据</p> <h1>!/bin/bash</h1> <p>92.重定向windows控制台程序的输出信息</p> <h1>!/bin/bash</h1> <p>93.基数转序数</p> <h1>!/bin/bash</h1> <p>94.数字月份转英文</p> <h1>!/bin/bash</h1> <p>95.报表相关</p> <h1>!/bin/bash</h1> <p>96.根据进程名获取进程ID</p> <h1>!/bin/bash</h1> <p>pidof %%1 -s</p> <p>96.BCP导入</p> <h1>!/bin/bash</h1> <p>97.BCP导出</p> <h1>!/bin/bash</h1> <p>98.计算文件MD5值</p> <h1>!/bin/bash</h1> <p>md5sum "%%1"</p> <p>99.计算获取文件夹中文件的MD5值</p> <h1>!/bin/bash</h1> <p>100.复制一个目录下所有文件到一个文件夹中</p> <h1>!/bin/bash</h1> <p>cp $(find "%%1" -name <em>.</em>) "%%2"</p> <p>101.移动一个目录下所有文件到一个文件夹中</p> <h1>!/bin/bash</h1> <p>mv $(find "%%1" -name <em>.</em>) "%%2"</p> <p>102.文件RSA高级加密<br> 十进制到十六进制<br> typeset -i16 BASE_16_NUM<br> BASE_16_NUM=%%1<br> echo $BASE_16_NUM</p> <p>八进制到十六进制</p> <h1>!/bin/bash</h1> <p>typeset -i16 BASE_16_NUM<br> BASE_16_NUM=8#%%1<br> echo $BASE_16_NUM</p> <p>十进制到八进制</p> <h1>!/bin/bash</h1> <p>printf %o %%1; echo</p> <p>十进制到十六进制</p> <h1>!/bin/bash</h1> <p>printf %x %%1; echo</p> <p>103.计算文件大小</p> <h1>!/bin/bash</h1> <p>wc "%%1"</p> <p>104.计算文件夹的大小</p> <h1>!/sbin/ksh</h1> <p>dir=%%1<br> (cd $dir;pwd)<br> find $dir -type d -print | du | awk '{print $2, "== ("$1/2"kb)"}' |sort -f |<br> sed -e "s,[^ /]<em>/([^ /]</em>) ==,|--1," -e"s,[^ /]*/,| ,g"</p> <p>105.快速获得当前程序的驱动器、路径、文件名和扩展名</p> <p>106.磁盘剩余空间计算</p> <h1>!/bin/bash</h1> <p>df -k</p> <p>107.获取当前程序进程ID</p> <h1>!/bin/bash</h1> <p>pidof %%1 -s</p> <p>108.全盘搜索文件</p> <h1>!/bin/bash</h1> <h1>updatedb</h1> <h1>locate %%1</h1> <p>slocate %%1</p> <p>109.获得当前登录的用户名</p> <h1>!/bin/bash</h1> <p>whoami</p> <p>110.获得所有用户名</p> <h1>!/bin/bash</h1> <p>who</p> <p>111.创建MySQL管理用户</p> <h1>!/bin/bash</h1> <p>mysqladmin -u root password %%1</p> <p>112.管理MySQL数据库服务器</p> <h1>!/bin/bash</h1> <p>112.1.启动MySQL数据库服务器<br> mysqld -console</p> <p>112.2.登录MySQL数据库服务器<br> 112.2.1.登录本地MySQL数据库服务器<br> mysql -uroot -p%%1</p> <p>112.2.2.登录远程MySQL数据库服务器<br> mysql -h %%1 -u %%2 -p%%3</p> <p>112.3.关闭MySQL数据库服务器<br> mysqladmin -u root shutdown</p> <h1>pkill -9 mysql</h1> <p>112.4.测试MySQL数据库服务器<br> mysqlshow || mysqlshow -u root mysql || mysqladmin version status || mysql test</p> <p>113.MySQL执行查询</p> <h1>!/bin/sh</h1> <p>mysqladmin -u %%1 -p%%2 SELECT * INTO OUTFILE './bestlovesky.xls' FROM bestlovesky WHERE 1 ORDER BY id DESC LIMIT 0, 50;</p> <p>mysql -u %%1 -p%%2 -e "SELECT * INTO OUTFILE './bestlovesky.xls' FROM bestlovesky WHERE 1 ORDER BY id DESC LIMIT 0, 50;"</p> <p>114.创建Oracle管理用户</p> <h1>!/bin/sh</h1> <p>114.1.创建新用户<br> create user test identified by test default tablespace ts_test temporary<br> tablespace temp;</p> <p>114.2.给用户角色特权<br> grant connect,resource to test;</p> <p>115.登录Oracle数据库</p> <h1>!/bin/bash</h1> <p>sqlplusw<br> sqlplus /nolog<br> conn username/password@Oranet<br> conn system/systempwd@whfc<br> conn sys/syspwd@whfc as sysdba</p> <p>115.创建Oracle表空间</p> <h1>!/bin/bash</h1> <p>conn system@whfc01<br> create tablespace ts_test datafile '/data2/oradata/ciis/ts_test01.dbf' size</p> <p>116.添加Oracle数据文件</p> <h1>!/bin/bash</h1> <p>alter tablespace ts_test add datafile '/data2/oradata/ciis/ts_test02.dbf' size</p> <p>117.查看Oracle表空间大小</p> <h1>!/bin/bash</h1> <p>desc DBA_DATA_FILES</p> <p>118.查看Oracle剩余表空间大小</p> <h1>!/bin/bash</h1> <p>desc DBA_FREE_SPACE</p> <p>119.查看Oracle当前用户表名</p> <h1>!/bin/bash</h1> <p>select * from tab;</p> <p>120.Oracle创建索引</p> <h1>!/bin/bash</h1> <p>CREATE INDEX idx_book_bookid ON book(bookname);</p> <p>121.Oracle创建主键约束</p> <h1>!/bin/bash</h1> <p>ALTER TABLE book ADD CONSTRAINT pk_book_bookid PRIMARY KEY (bookid);</p> <p>122.Oracle显示表结构</p> <h1>!/bin/bash</h1> <p>desc book</p> <p>123.Oracle查看表的索引</p> <h1>!/bin/bash</h1> <p>column index_name format a30<br> select table_name, index_name from user_indexes;</p> <p>124.Oracle查看索引列</p> <h1>!/bin/bash</h1> <p>select table_name, index_name, column_name, column_position from user_ind_columns;</p> <p>125.Oracle查看数据段占空间大小</p> <h1>!/bin/bash</h1> <p>desc user_segments</p> <p>126.Oracle查看表占空间大小</p> <h1>!/bin/bash</h1> <p>select segment_name,segment_type,bytes from user_segments where segment_type='TABLE';</p> <p>127.安全删除USB</p> <h1>!/bin/bash</h1> <p>rundll32.exe shell32.dll,Control_RunDLL hotplug.dll</p> <p>128.打开SQL Server Management Studio</p> <h1>!/bin/bash</h1> <p>sqlwb %%1.sql</p> <p>129.MySQL数据库导出备份</p> <h1>!/bin/bash</h1> <p>mysqldump -u %%1 -p %%2 %%3>%%4.sql<br> mysqldump --opt test > mysql.test //将数据库test导出到mysql.test文件,后面是一个文本文件<br> mysqldump -u root -p123456 --databases dbname > mysql.dbname //就是把数据库dbname导出到文件mysql.dbname中。</p> <p>130.MySQL数据库数据导入<br> mysql -u %%1 -p %%2 %%3<%%4.sql<br> mysqlimport -u root -p123456 < mysql.dbname<br> 将文本数据导入数据库:<br> 文本数据的字段之间用tab键隔开<br> use test<br> load data local infile "文件名" into table 表名;<br> eg: load data local infile "D:/mysql.txt" into table mytable;<br> 导入.sql 文件命令<br> use database<br> source d:/mysql.sql;</p> <p>131.MySQL数据库检查<br> mysqlcheck -o %%3 -u %%1 -p %%2</p> <p>132.MySQL数据表文件修复<br> myisamchk -B -o %%1.myd</p> <p>1,查看数据库状态 及启动停止<br> /etc/init.d/mysqld status<br> /etc/init.d/mysqld start<br> /etc/init.d/mysqld stop</p> <p>2,给用户配置初始密码123456:<br> mysqladmin -u root -password 123456</p> <p>3,修改root用户密码为 abc123<br> mysqladmin -u root -p123456 password abc123</p> <p>4,如果想去掉密码:<br> mysqladmin -u root -pabc123 password ""</p> <p>5,root连接数据库有密码和无密码:<br> mysql -u root(-uroot) -p<br> mysql</p> <p>6,增加用户 test1 密码 abc,让它可以在任何主机上登录,并对所有数据库有查询,插入,修改,删除的权限:<br> 格式: grant select on 数据库.* to 用户名@登录主机 identified by "密码"<br> grant select,insert,update,delete on <em>.</em> to test1@"%" Identified by "abc";</p> <p>8,增加一个用户test2,让它只可以在localhost上登录,并可以对数据库mydb进行查询,插入,修改,删除的操作,<br> 这样用户即使使用知道test2的密码,他也无法从internet 上直接访问数据库,只能通过mysql主机上的web页面来访问。<br> grant select,insert,update,delete on mydb.* to test2@localhost identified by "abc";<br> grant select,insert,update,delete on mydb.* to test2@localhost identified by ""; 设置无密码</p> <p>9,显示数据库列表:<br> show databases;<br> use mysql 打开库<br> show tables;</p> <p>10,表的操作<br> describle 表名; 显示数据表的结构<br> create database 库名;<br> drop database 库名;<br> create table 表名(字段设定列表)<br> drop table 表名;<br> delete from 表名;清空表记录<br> select * from 表名; 显示表中的记录<br> insert into 表名 values(, ,)</p> <p>alter table 表名 add column <字段名><字段选项></p> <p>133.检查端口占用</p> <h1>!/bin/bash</h1> <p>netstat -ano</p> <p>134.Linux下检查Apache是否安装</p> <h1>!/bin/bash</h1> <p>rpm -qa | grep httpd</p> <p>135.Linux下启动Apache服务</p> <h1>!/bin/bash</h1> <p>service httpd start</p> <p>136.Linux下停止Apache服务</p> <h1>!/bin/bash</h1> <p>service httpd stop</p> <p>137.Linux下重新启动Apache服务</p> <h1>!/bin/bash</h1> <p>service httpd restart</p> <p>138.Linux下自动加载Apache 服务</p> <h1>!/bin/bash</h1> <p>chkconfig - level 3 httpd on</p> <p>139.Linux下不自动加载Apache 服务</p> <h1>!/bin/bash</h1> <p>chkconfig - level 3 httpd off</p> <p>140.Linux下检查VSFTP是否安装</p> <h1>!/bin/bash</h1> <p>rpm -qa | grep vsftpd</p> <p>141.Linux下启动VSFTP服务</p> <h1>!/bin/bash</h1> <p>service vsftpd start</p> <p>142.Linux下停止VSFTP服务</p> <h1>!/bin/bash</h1> <p>service vsftpd stop</p> <p>143.Linux下重新启动VSFTP服务</p> <h1>!/bin/bash</h1> <p>service vsftpd restart</p> <p>144.Linux下检查VSFTP是否被启动</p> <h1>!/bin/bash</h1> <p>pstree | grep vsftpd</p> <p>145.Linux下检查Sendmail是否安装</p> <h1>!/bin/bash</h1> <p>rpm -qa | grep sendmail</p> <p>146.Linux下启动Sendmail服务</p> <h1>!/bin/bash</h1> <p>service sendmail start</p> <p>147.Linux下停止Sendmail服务</p> <h1>!/bin/bash</h1> <p>service sendma stop</p> <p>148.Linux下重新启动Sendmail服务</p> <h1>!/bin/bash</h1> <p>service sendmail restart</p> <p>149.Linux下自动加载Sendmail 服务</p> <h1>!/bin/bash</h1> <p>chkconfig - level 3 sendmail on</p> <p>150.Linux下不自动加载Sendmail 服务</p> <h1>!/bin/bash</h1> <p>chkconfig - level 3 sendmail off</p> <p>151.Linux下文本图形界面配置启动服务</p> <h1>!/bin/bash</h1> <p>ntsysv</p> <p>152.以数组的方式删除文件夹</p> <p>153.GCC批量编译</p> <h1>!/bin/bash</h1> <p>find -type f ( -iname '<em>.c' -o -iname '</em>.cpp' ) -print |<br> while read filename<br> do<br> case "$filename" in<br> *.c)<br> gcc "$filename" -o "$(dirname "$filename")"/"$(basename "$filename" .c)"<br> ;;<br> *.cpp)<br> gcc "$filename" -o "$(dirname "$filename")"/"$(basename "$filename" .cpp)"<br> ;;<br> esac<br> done</p> <p>154.批量赋予可执行权限</p> <h1>!/bin/bash</h1> <p>find "$PWD" -type f ( -iname '<em>.sh' -o -iname '</em>.csh' -o -iname '<em>.ksh' -o -iname '</em>.pl' -o -iname '<em>.bin' -o -iname '</em>.run' -o -iname '<em>.bundle' -o -iname '</em>.rb' -o -iname '*.py' ) -print0 | xargs -0 chmod +x</p> <h1>!/bin/bash</h1> <p>for file in <em>.sh <em>.pl <em>.bin <em>.run <em>.bundle <em>.rb <em>.py<br> do<br> if [[ ! "$file" =~ *.[A-Za-z]+ ]]; then<br> chmod +x "$(file)"<br> fi<br> done<br> OLDIFS=$IFS<br> IFS=:<br> for path in $( find $(pwd) -type d -printf "%p$IFS")<br> do<br> for file in $path/</em>.sh $path/</em>.pl $path/</em>.bin $path/</em>.run $path/</em>.bundle $path/</em>.rb $path/</em>.py<br> do<br> if [[ ! "$file" =~ *.[A-Za-z]+ ]]; then<br> chmod +x "$(path)/$(file)"<br> fi<br> done<br> done<br> IFS=$OLDIFS</p> <p>155.批量执行</p> <h1>!/bin/bash</h1> <p>find -type f ( -iname '<em>.sh' -o -iname '</em>.csh' -o -iname '<em>.ksh' -o -iname '</em>.pl' -o -iname '<em>.bin' -o -iname '</em>.run' -o -iname '<em>.bundle' -o -iname '</em>.bin' -o -iname '<em>.class' -o -iname '</em>.rpm' -o -iname '<em>.rb' -o -iname '</em>.py' -o -iname '*.jar' ) -print |<br> while read filename<br> do<br> case "$filename" in<br> *.sh | *.csh | *.ksh)<br> if [ ! "./""$(basename $filename)" = $0 ]; then<br> xterm -e "$filename"<br> fi<br> ;;<br> *.pl)<br> xterm -e perl "$filename"<br> ;;<br> *.bin | *.run | *.bundle)<br> xterm -e "$filename"<br> ;;<br> *.class)<br> xterm -e java "$(dirname "$filename")"/"$(basename "$filename" .class)"<br> ;;<br> *.rpm)<br> xterm -e rpm -ivh "$filename"<br> ;;<br> *.rb)<br> xterm -e ruby "$filename"<br> ;;<br> *.py)<br> xterm -e python "$filename"<br> ;;<br> *.jar)<br> xterm -e java -jar "$filename"<br> ;;<br> esac<br> done</p> <h1>!/bin/bash</h1> <p>find -maxdepth 1 -type f ( -iname '<em>.sh' -o -iname '</em>.pl' -o -iname '<em>.bin' -o -iname '</em>.run' -o -iname '<em>.bundle' -o -iname '</em>.bin' -o -iname '<em>.class' -o -iname '</em>.rpm' -o -iname '<em>.rb' -o -iname '</em>.py' -o -iname '<em>.jar' ) -print<br> while read file<br> do<br> case "${file##</em>.}" in<br> sh ) xterm -e """"$file"""";;<br> pl ) xterm -e perl """"$file"""";;<br> bin ) xterm -e """"$file"""";;<br> run ) xterm -e """"$file"""";;<br> bundle ) xterm -e """"$file"""";;<br> class ) xterm -e java """"${file%.*}"""";;<br> rpm ) xterm -e rpm -ivh """"$file"""";;<br> rb ) xterm -e ruby """"$file"""";;<br> py ) xterm -e python """"$file"""";;<br> jar ) xterm -e java -jar """"$file"""";;<br> esac<br> done</p> <p>156.获取操作系统版本</p> <h1>!/bin/bash</h1> <p>uname -r</p> <h1>uname -a</h1> <p>157.自身复制</p> <h1>!/bin/bash</h1> <p>cp $0 "%%1"</p> <p>158.GCC批量创建静态库</p> <h1>!/bin/bash</h1> <p>find -type f ( -iname '<em>.c' -o -iname '</em>.cpp' ) -print |<br> while read filename<br> do<br> case "$filename" in<br> <em>.c)<br> g++ -c -o "$(dirname "$filename")"/"$(basename "$filename" .c)".o"" "$filename"<br> ;;<br> <em>.cpp)<br> g++ -c -o "$(dirname "$filename")"/"$(basename "$filename" .cpp)".o"" "$filename"<br> ;;<br> esac<br> done<br> OLDIFS=$IFS<br> IFS=:<br> for path in $( find $(pwd) -type d -printf "%p$IFS")<br> do<br> ar ru $path".a" $path"/</em>.o" && ranlib $path".a"<br> done<br> IFS=$OLDIFS<br> find "$PWD" -type f ( -iname '</em>.o' ) -print0 | xargs -0 rm -if</p> <p>159.Java批量打包EJB</p> <h1>!/bin/bash</h1> <p>find "$PWD" -type f ( -iname '<em>.java' ) -print0 | xargs -0 javac<br> OLDIFS=$IFS<br> IFS=:<br> for path in $( find $(pwd) -type d -printf "%p$IFS")<br> do<br> jar -cvf "$(path".jar")" "$(path"/</em>.*")" && cp "$(path".jar")" "$(JBOSS_HOME"/server/default/deploy")"<br> done<br> IFS=$OLDIFS</p> <p>find "$PWD" -type f ( -iname '*.class' ) -print0 | xargs -0 rm -if</p> <p>160.获取环境变量</p> <p>161.dd</p> <h1>!/bin/bash</h1> <p>dd</p> <p>162.显示只有小写字母的文件</p> <h1>!/bin/bash</h1> <p>ls -1|awk '/^[[:lower:]].*/'</p> <p>163.Zip压缩目录中的所有文件</p> <h1>!/bin/bash</h1> <p>direc="%%1" #$(pwd)<br> targetpath="%%2"<br> OLDIFS=$IFS<br> IFS=:<br> for path in $( find $direc -type d -printf "%p$IFS")<br> do<br> mkdir -p "$targetpath/${path:${#direc}+1}"<br> for file in $path/*<br> do<br> if [ -f $file ]; then<br> zip -j "$targetpath/${path:${#direc}+1}/${file:${#path}+1}.zip" "$file"<br> fi<br> done<br> done<br> IFS=$OLDIFS</p> <p>164.Zip解压缩目录中的所有文件</p> <h1>!/bin/bash</h1> <p>direc="%%1" #$(pwd)<br> targetpath="%%2"<br> OLDIFS=$IFS<br> IFS=:<br> for path in $( find $direc -type d -printf "%p$IFS")<br> do<br> mkdir -p "$targetpath/${path:${#direc}+1}"<br> unzip -x "$path/*.zip" -d "$targetpath/${path:${#direc}+1}"<br> done<br> IFS=$OLDIFS</p> <p>165.分布式复制文件夹</p> <h1>!/bin/bash</h1> <p>direc="%%1" #$(pwd)<br> targetpath="%%2"<br> OLDIFS=$IFS<br> IFS=:<br> for path in $( find $direc -type d -printf "%p$IFS")<br> do<br> mkdir -p "$targetpath/${path:${#direc}+1}"<br> rm -if "$targetpath/${path:${#direc}+1}/<em>.tmp"<br> for file in $path/</em><br> do<br> if [ -f $file ]; then<br> cp "$file" "$targetpath/${path:${#direc}+1}/${file:${#path}+1}.tmp"<br> mv "$targetpath/${path:${#direc}+1}/${file:${#path}+1}.tmp" "$targetpath/${path:${#direc}+1}/${file:${#path}+1}"<br> fi<br> done<br> done<br> IFS=$OLDIFS</p> <p>166.注册反注册组件</p> <h1>!/bin/bash</h1> <p>regsvr32 "%%1"</p> <p>167.LZMA</p> <h1>!/bin/bash</h1> <p>168.CAB压缩文件</p> <h1>!/bin/bash</h1> <p>169.CAB解压缩文件</p> <h1>!/bin/bash</h1> <p>170.锁定屏幕</p> <h1>!/bin/sh</h1> <p>RUNDLL32.exe USER32,LockWorkStation</p> <p>171.以其它用户的身份运行程序</p> <h1>!/bin/bash</h1> <p>172.添加系统用户</p> <h1>!/bin/sh</h1> <p>useradd "%%1"</p> <p>173.删除系统用户</p> <h1>!/bin/sh</h1> <p>userdel "%%1"</p> <p>174.添加用户组</p> <h1>!/bin/sh</h1> <p>groupadd -g 2000 "%%1"</p> <p>175.删除用户组</p> <h1>!/bin/sh</h1> <p>groupdel "%%1"</p> <p>176.赋予管理员权限</p> <h1>!/bin/bash</h1> <p>177.收回管理员权限</p> <h1>!/bin/bash</h1> <p>178.遍历目录产生删除文件的脚本</p> <h1>!/bin/bash</h1> <p>179.LZW压缩文件</p> <h1>!/bin/bash</h1> <p>z</p> <p>180.LZW解压缩文件</p> <h1>!/bin/bash</h1> <p>z</p> <p>181.递归赋予目录权限</p> <h1>!/bin/bash</h1> <p>direc="%%1" #$(pwd)<br> OLDIFS=$IFS<br> IFS=:<br> for path in $( find $direc -type d -printf "%p$IFS")<br> do<br> chown -R root.root "$path"<br> done<br> IFS=$OLDIFS</p> <p>182.卸载RPM包</p> <h1>!/bin/sh</h1> <p>rpm -e "%%1"</p> <p>183.删除源文件中的注释</p> <h1>!/bin/sh</h1> <p>184.设置目录下所有文件属性为可写</p> <h1>!/bin/sh</h1> <p>185.统计目录下所有文件的总共行数</p> <h1>!/bin/sh</h1> <p>cat * |wc<br> ls <em>|xargs wc -l<br> find ./ -name "</em>c" | xargs wc -l</p> <p>186.删除自身</p> <h1>!/bin/rm</h1> <p>exit 65</p> <h1>rm $0</h1> <p>187.打开终端</p> <h1>!/bin/bash -l</h1> <p>188.弹出光驱</p> <h1>!/bin/sh</h1> <p>eject</p> <p>189.收回光驱</p> <h1>!/bin/sh</h1> <p>eject -t</p> <p>190.磁盘总空间计算</p> <p>191.解析CSV文件</p> <p>192.按行保存文件为数组</p> <p>193.MySQL执行SQL文件<br> mysqladmin -u %%1 -p%%2 < %%3.sql</p> <p>mysql -u %%1 -p%%2 -e "SOURCE %%3.sql"</p> </article> </div> </div> </div> <!--PC和WAP自适应版--> <div id="SOHUCS" sid="1175625368179126272"></div> <script type="text/javascript" src="/views/front/js/chanyan.js"></script> <!-- 文章页-底部 动态广告位 --> <div class="youdao-fixed-ad" id="detail_ad_bottom"></div> </div> <div class="col-md-3"> <div class="row" id="ad"> <!-- 文章页-右侧1 动态广告位 --> <div id="right-1" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_1"> </div> </div> <!-- 文章页-右侧2 动态广告位 --> <div id="right-2" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_2"></div> </div> <!-- 文章页-右侧3 动态广告位 --> <div id="right-3" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_3"></div> </div> </div> </div> </div> </div> </div> <div class="container"> <h4 class="pt20 mb15 mt0 border-top">你可能感兴趣的:(shell文件操作大全)</h4> <div id="paradigm-article-related"> <div class="recommend-post mb30"> <ul class="widget-links"> <li><a href="/article/1835503965563875328.htm" title="python os.environ_python os.environ 读取和设置环境变量" target="_blank">python os.environ_python os.environ 读取和设置环境变量</a> <span class="text-muted">weixin_39605414</span> <a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/os.environ/1.htm">os.environ</a> <div>>>>importos>>>os.environ.keys()['LC_NUMERIC','GOPATH','GOROOT','GOBIN','LESSOPEN','SSH_CLIENT','LOGNAME','USER','HOME','LC_PAPER','PATH','DISPLAY','LANG','TERM','SHELL','J2REDIR','LC_MONETARY','QT_QPA</div> </li> <li><a href="/article/1835501948011376640.htm" title="使用 FinalShell 进行远程连接(ssh 远程连接 Linux 服务器)" target="_blank">使用 FinalShell 进行远程连接(ssh 远程连接 Linux 服务器)</a> <span class="text-muted">编程经验分享</span> <a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7/1.htm">开发工具</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a><a class="tag" taget="_blank" href="/search/ssh/1.htm">ssh</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>目录前言基本使用教程新建远程连接连接主机自定义命令路由追踪前言后端开发,必然需要和服务器打交道,部署应用,排查问题,查看运行日志等等。一般服务器都是集中部署在机房中,也有一些直接是云服务器,总而言之,程序员不可能直接和服务器直接操作,一般都是通过ssh连接来登录服务器。刚接触远程连接时,使用的是XSHELL来远程连接服务器,连接上就能够操作远程服务器了,但是仅用XSHELL并没有上传下载文件的功能</div> </li> <li><a href="/article/1835491353451130880.htm" title="【华为OD技术面试真题 - 技术面】- python八股文真题题库(4)" target="_blank">【华为OD技术面试真题 - 技术面】- python八股文真题题库(4)</a> <span class="text-muted">算法大师</span> <a class="tag" taget="_blank" href="/search/%E5%8D%8E%E4%B8%BAod/1.htm">华为od</a><a class="tag" taget="_blank" href="/search/%E9%9D%A2%E8%AF%95/1.htm">面试</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a> <div>华为OD面试真题精选专栏:华为OD面试真题精选目录:2024华为OD面试手撕代码真题目录以及八股文真题目录文章目录华为OD面试真题精选**1.Python中的`with`**用途和功能自动资源管理示例:文件操作上下文管理协议示例代码工作流程解析优点2.\_\_new\_\_和**\_\_init\_\_**区别__new____init__区别总结3.**切片(Slicing)操作**基本切片语法</div> </li> <li><a href="/article/1835482277870661632.htm" title="简介Shell、zsh、bash" target="_blank">简介Shell、zsh、bash</a> <span class="text-muted">zhaosuningsn</span> <a class="tag" taget="_blank" href="/search/Shell/1.htm">Shell</a><a class="tag" taget="_blank" href="/search/zsh/1.htm">zsh</a><a class="tag" taget="_blank" href="/search/bash/1.htm">bash</a><a class="tag" taget="_blank" href="/search/shell/1.htm">shell</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/bash/1.htm">bash</a> <div>Shell是Linux和Unix的外壳,类似衣服,负责外界与Linux和Unix内核的交互联系。例如接收终端用户及各种应用程序的命令,把接收的命令翻译成内核能理解的语言,传递给内核,并把内核处理接收的命令的结果返回给外界,即Shell是外界和内核沟通的桥梁或大门。Linux和Unix提供了多种Shell,其中有种bash,当然还有其他好多种。Mac电脑中不但有bash,还有一个zsh,预装的,据说</div> </li> <li><a href="/article/1835476476514889728.htm" title="Shell、Bash、Zsh这都是啥啊" target="_blank">Shell、Bash、Zsh这都是啥啊</a> <span class="text-muted">小白码上飞</span> <a class="tag" taget="_blank" href="/search/bash/1.htm">bash</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a> <div>Zsh和Bash都是我们常用的Shell,那先搞明白啥是shell吧。Shell作为一个单词,他是“壳”的意思,蛋壳坚果壳。之所以叫壳,是为了和计算机的“核”来区分,用它表示“为使用者提供的操作界面”。所以这个命名其实很形象,翻译成中文,直译过来叫“壳层”。个人认为这个叫法很奇怪,意译貌似也没有什么好的词汇来匹配。就还是叫shell吧。维基百科给的定义是:Incomputing,ashellisa</div> </li> <li><a href="/article/1835476350190841856.htm" title="ExpRe[25] bash外的其它shell:zsh和fish" target="_blank">ExpRe[25] bash外的其它shell:zsh和fish</a> <span class="text-muted">tritone</span> <a class="tag" taget="_blank" href="/search/ExpRe/1.htm">ExpRe</a><a class="tag" taget="_blank" href="/search/bash/1.htm">bash</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/ubuntu/1.htm">ubuntu</a><a class="tag" taget="_blank" href="/search/shell/1.htm">shell</a> <div>文章目录zsh基础配置实用特性插件`autojump`语法高亮自动补全fish优点缺点时效性本篇撰写时间为2021.12.15,由于计算机技术日新月异,博客中所有内容都有时效和版本限制,具体做法不一定总行得通,链接可能改动失效,各种软件的用法可能有修改。但是其中透露的思想往往是值得学习的。本篇前置:ExpRe[10]Ubuntu[2]准备神秘软件、备份恢复软件https://www.cnblogs</div> </li> <li><a href="/article/1835466523163062272.htm" title="Linux sh命令" target="_blank">Linux sh命令</a> <span class="text-muted">fengyehongWorld</span> <a class="tag" taget="_blank" href="/search/Linux/1.htm">Linux</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>目录一.基本语法二.选项2.1-c字符串中读取内容,并执行2.1.1基本用法2.1.2获取当前目录下失效的超链接2.2-x每个命令执行之前,将其打印出来2.3结合Here文档使用一.基本语法⏹Linux和Unix系统中用于执行shell脚本或运行命令的命令。sh[选项][脚本文件][参数...]⏹选项-c:从字符串中读取内容,并执行。-x:在每个命令执行之前,将其打印出来。-s:从标准流中读取内容</div> </li> <li><a href="/article/1835456560277581824.htm" title="简单说说关于shell中zsh和bash的选择" target="_blank">简单说说关于shell中zsh和bash的选择</a> <span class="text-muted">秋刀prince</span> <a class="tag" taget="_blank" href="/search/MacOS/1.htm">MacOS</a><a class="tag" taget="_blank" href="/search/%E5%B0%8F%E7%8C%BF%E4%BB%AC%E7%9A%84%E5%BC%80%E5%8F%91%E6%97%A5%E5%B8%B8/1.htm">小猿们的开发日常</a><a class="tag" taget="_blank" href="/search/bash/1.htm">bash</a> <div>希望文章能给到你启发和灵感~如果觉得文章对你有帮助的话,点赞+关注+收藏支持一下博主吧~阅读指南开篇说明一、基础环境说明1.1硬件环境1.2软件环境二、什么是shell、bash、zsh?2.1bash2.2zsh三、选择Bash还是Zsh?四、一些常见问题开篇说明本篇主要简单说明一下,shell中bash和zsh的区别和选择;我们经常会把这两个搞混,不知道什么时候用哪一个,以及怎么使用;一、基础</div> </li> <li><a href="/article/1835432854327226368.htm" title="2024春节微信红包封面序列号大全一览" target="_blank">2024春节微信红包封面序列号大全一览</a> <span class="text-muted">帮忙赚赏金</span> <div>2024微信红包封面序列号哪里领取红包封面领取微信搜索公众号:【艺间封面】千万红包封面等你领取2024微信红包封面免费序列号如何设置微信红包封面?1.打开微信,点击好友选择红包。2.单击红包封面。3.单击“添加红包封面”。4.输入接收序列号。来一波免费的微信红包封面序列号微信红包封面序列号红包封面领取微信搜索公众号:艺间封面千万红包封面等你领取微信红包封面序列号kGnkrbw5a7N微信红包封面序</div> </li> <li><a href="/article/1835430214394540032.htm" title="python结束子进程_如何清除python中的子进程" target="_blank">python结束子进程_如何清除python中的子进程</a> <span class="text-muted">weixin_39995943</span> <a class="tag" taget="_blank" href="/search/python%E7%BB%93%E6%9D%9F%E5%AD%90%E8%BF%9B%E7%A8%8B/1.htm">python结束子进程</a> <div>我们使用python进程来管理长时间运行的python子进程。有时需要终止子进程。kill命令不会完全终止进程,只会使其失效。运行以下脚本将演示此行为。importsubprocessp=subprocess.Popen(['sleep','400'],stdout=subprocess.PIPE,shell=False)或者p=subprocess.Popen('sleep400',stdout</div> </li> <li><a href="/article/1835399577818198016.htm" title="linux脚本sed替换变量,sed 命令中替换值为shell变量" target="_blank">linux脚本sed替换变量,sed 命令中替换值为shell变量</a> <span class="text-muted">诺坎普之约</span> <a class="tag" taget="_blank" href="/search/linux%E8%84%9A%E6%9C%ACsed%E6%9B%BF%E6%8D%A2%E5%8F%98%E9%87%8F/1.htm">linux脚本sed替换变量</a> <div>文章目录sed命令中替换值为shell变量替换基本语法sed中替换使用shell变量总结参考文档sed命令中替换值为shell变量替换基本语法大家都是sed有很多用法,最多就应该是替换一些值了。让我们先回忆sed的替换语法。在sed进行替换的时候sed-i's/old/new/g'1.txtecho"hellooldfrank"|sed's/old/new/g'结果如下:hellonewfrank</div> </li> <li><a href="/article/1835397273815707648.htm" title="靠谱的海淘APP大全 可以海淘的软件有哪些" target="_blank">靠谱的海淘APP大全 可以海淘的软件有哪些</a> <span class="text-muted">氧惠评测</span> <div>96KaiFa为您整理了可以海淘的软件有哪些,分别有海淘、ZOZO日本海淘、海淘铺、美芽海淘、海淘1号海外购、高乐高海淘、海淘美瞳、海淘返利网、海淘拼单、豌豆公主海淘,下面一起来看靠谱的海淘APP大全吧!购物、看电影、点外卖、用氧惠APP!更优惠!氧惠(全网优惠上氧惠)——是与以往完全不同的抖客+淘客app!2023全新模式,我的直推也会放到你下面,送1:1超级补贴(邀请好友自购多少,你就推广得多</div> </li> <li><a href="/article/1835391382567612416.htm" title="Shell脚本中sed使用" target="_blank">Shell脚本中sed使用</a> <span class="text-muted">jcrhl321</span> <a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>目录一、sed编辑器1、sed概述2、sed的工作流程3、sed命令的常见格式4、sed命令常用操作二、sed常用命令使用1、sed打印2、sed删除3、sed替换4、sed插入与增加4、sed剪切粘贴与复制粘贴一、sed编辑器sed(StreamEDitor)是一个强大而简单的文本解析转换工具,可以读取文本,并根据指定的条件对文本内容进行编辑(删除、替换、添加、移动等),最后输出所有行或者仅输出</div> </li> <li><a href="/article/1835381929642389504.htm" title="shell脚本中sed命令如何使用变量" target="_blank">shell脚本中sed命令如何使用变量</a> <span class="text-muted">歪歪的酒壶</span> <a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>在shell脚本中我们常常需要使用sed命令进行配置文件的更新,但是更新的内容又往往根据环境相关。值并不是固定的。这里我们介绍一种在sed命令中使用变量的方法。比如,在nginx的配置中,我们需要根据环境来更新/etc/nginx/sites-available/default中的目录配置。通常我们采用一个变量,来记录当前环境需要配置的目录比如:dist_dir=/home/dev/code/ui</div> </li> <li><a href="/article/1835379662918873088.htm" title="【从问题中去学习k8s】k8s中的常见面试题(夯实理论基础)(二十八)" target="_blank">【从问题中去学习k8s】k8s中的常见面试题(夯实理论基础)(二十八)</a> <span class="text-muted">向往风的男子</span> <a class="tag" taget="_blank" href="/search/k8s/1.htm">k8s</a><a class="tag" taget="_blank" href="/search/%E5%AD%A6%E4%B9%A0/1.htm">学习</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a> <div>本站以分享各种运维经验和运维所需要的技能为主《python零基础入门》:python零基础入门学习《python运维脚本》:python运维脚本实践《shell》:shell学习《terraform》持续更新中:terraform_Aws学习零基础入门到最佳实战《k8》从问题中去学习k8s《docker学习》暂未更新《ceph学习》ceph日常问题解决分享《日志收集》ELK+各种中间件《运维日常》</div> </li> <li><a href="/article/1835369569800253440.htm" title="史上最全git命令,git回滚,git命令大全" target="_blank">史上最全git命令,git回滚,git命令大全</a> <span class="text-muted">騒周</span> <a class="tag" taget="_blank" href="/search/%E5%85%B6%E4%BB%96/1.htm">其他</a><a class="tag" taget="_blank" href="/search/git/1.htm">git</a> <div>git命令大全一、Git整体理解二、由暂存区本地仓库三、由本地仓->远程仓库四、冲突处理五、Git分支操作六、bug的分支七、feature分支八、暂存的使用九、远程仓的操作十、标签的使用十一、Git配置全局信息十二、Linux的一些简单操作和一些符号的解释十三、符号解释十四、显示安装详细信息十五、gitconfig十六、Gitclone十七、Gitinit十八、gitstatus十九、gitre</div> </li> <li><a href="/article/1835369443379736576.htm" title="【显示 后台运行 & 的命令】" target="_blank">【显示 后台运行 & 的命令】</a> <span class="text-muted">晨春计</span> <a class="tag" taget="_blank" href="/search/debug/1.htm">debug</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a> <div>目录背景步骤详解示例背景当你在Linuxshell中使用&符号将一个命令放到后台运行时,你可以使用jobs命令来查看这些后台进程的状态。但是,jobs命令并不会直接显示进程的PID(进程ID)。它会显示一个作业列表,其中包括每个作业的状态和一个作业标识符(通常是百分号%后面跟着一个数字),但不会直接显示PID。获取后台进程的PID步骤:1、使用jobs命令查看后台作业。2、使用ps命令配合grep</div> </li> <li><a href="/article/1835369316342657024.htm" title="Android shell 常用 debug 命令" target="_blank">Android shell 常用 debug 命令</a> <span class="text-muted">晨春计</span> <a class="tag" taget="_blank" href="/search/Audio/1.htm">Audio</a><a class="tag" taget="_blank" href="/search/debug/1.htm">debug</a><a class="tag" taget="_blank" href="/search/android/1.htm">android</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>目录1、查看版本2、am命令3、pm命令4、dumpsys命令5、sed命令6、log定位查看APK进程号7、log定位使用场景1、查看版本1.1、Android串口终端执行getpropro.build.version.release#获取Android版本uname-a#查看linux内核版本信息uname-r#单独查看内核版本1.2、linux服务器执行lsb_release-a#查看Lin</div> </li> <li><a href="/article/1835363431893528576.htm" title="Ubuntu常用命令整理" target="_blank">Ubuntu常用命令整理</a> <span class="text-muted">十里染林</span> <div>ubuntu16.04server开启ssh:使用x-shell连接主机,发现22端口没有打开,开启ssh服务:安装openssh-serversudoapt-getinstallopenssh-server检查安装是否成功sudops-e|grepssh开启ssh服务sudoservicesshstartUbuntu开启/关闭防火墙:开启防火墙sudoufwenable关闭防火墙sudoufwd</div> </li> <li><a href="/article/1835350539211206656.htm" title="CentOS7 安装MySQL5.7.44" target="_blank">CentOS7 安装MySQL5.7.44</a> <span class="text-muted">不要Null了</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/centos/1.htm">centos</a><a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a> <div>1.下载mysql安装包,我放在百度网盘里(下方链接)链接:https://pan.baidu.com/s/1_Mn1XW_1mWdTV4mhnLG66A提取码:s31n2.首先看看以前是否安装过mysqlrpm-qa|grep-imysql如果已经安装过mysql会提示卸载mysqlrpm-emysql-…3.使用FinallShell或者Xftp进行上传放到/usr/local/mysql,没</div> </li> <li><a href="/article/1835350289310380032.htm" title="氧券邀请码是多少(最新app邀请码大全及填写步骤讲解)带你玩转" target="_blank">氧券邀请码是多少(最新app邀请码大全及填写步骤讲解)带你玩转</a> <span class="text-muted">日常购物小技巧</span> <div>一、氧券邀请码填什么填多少1、氧券邀请码填写:999999,这样可以获得高级合伙人,高佣金二、怎么才能有氧券邀请码氧券APP是淘宝天猫京东…全网优惠券+返利的搬运工,自购省钱,分享挣钱!注册氧券是必须要填写邀请码的,没有邀请码不能注册。1、填写上面邀请码注册,自己也会升级为高级合伙人,拥有自己的氧券邀请码2、会员自己购物可享受返佣,可以分享赚钱获得佣金三、氧券会员注册怎么弄1、手机下载氧券APP后</div> </li> <li><a href="/article/1835270818494509056.htm" title="Python实现mysql命令行" target="_blank">Python实现mysql命令行</a> <span class="text-muted">xu-jssy</span> <a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a><a class="tag" taget="_blank" href="/search/adb/1.htm">adb</a> <div>一、源码importosimportpymysqldefsql_shell():password=input("EnterPassword:")#访问密码ifpassword.strip()!="yyds":print("Bye")return#清空控制台输出os.system("cls"ifos.name=="nt"else"clear")try:#连接到MySQL数据库conn=pymysql</div> </li> <li><a href="/article/1835247244572454912.htm" title="服务器状态监控php源码,服务器状态监控_监控Linux服务器网站状态的SHELL脚本" target="_blank">服务器状态监控php源码,服务器状态监控_监控Linux服务器网站状态的SHELL脚本</a> <span class="text-muted">温糯米</span> <a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%8A%B6%E6%80%81%E7%9B%91%E6%8E%A7php%E6%BA%90%E7%A0%81/1.htm">服务器状态监控php源码</a> <div>摘要腾兴网为您分享:监控Linux服务器网站状态的SHELL脚本,蜗牛集市,同花顺,探客宝,手柄助手等软件知识,以及日期倒计时插件,云南省教育资源公共,rui手机桌面,小屁孩桌面便签,合金装备崛起复仇,朝夕日历,photoshop图像处理软件,一年级学生每日计划表,悟空找房,饿了吗外卖商家版,逃生,中国民宿网,realpolitiks,交通安全知识竞赛,雅思流利说等软件it资讯,欢迎关注腾兴网。1</div> </li> <li><a href="/article/1835245730810392576.htm" title="华为USG6000E-S12防火墙Key exchange failed.无法SSH解决方案" target="_blank">华为USG6000E-S12防火墙Key exchange failed.无法SSH解决方案</a> <span class="text-muted">redmond88</span> <a class="tag" taget="_blank" href="/search/%E7%BD%91%E7%BB%9C%E6%8A%80%E6%9C%AF/1.htm">网络技术</a><a class="tag" taget="_blank" href="/search/ssh/1.htm">ssh</a><a class="tag" taget="_blank" href="/search/%E5%8D%8E%E4%B8%BA/1.htm">华为</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a> <div>由于目前防火墙算法太新,导致crt和xshell的版本无法登陆,按以下方法解决一、下载华为本地加载除弱安全算法组件包之外的组件包https://download.csdn.net/download/redmond88/89620664?spm=1001.2014.3001.5503二、先改后缀名为.cfg,上传文件到防火墙三、在用户视图下改后缀名为.mod四、move文件到$_install_mo</div> </li> <li><a href="/article/1835239843370725376.htm" title="破解游戏app哪个好用 无限99999钻999999金币的游戏盒子排行榜" target="_blank">破解游戏app哪个好用 无限99999钻999999金币的游戏盒子排行榜</a> <span class="text-muted">诸葛村夫123</span> <div>2024游戏盒子网站排行榜大全随着数位科技的发展,2024年手游市场持续火爆,各种新开手游持续涌现。本文为广大手游爱好者带来巅峰推荐,总结五个最具实力的手游新服发布网站,为您提供最全面的游戏资讯以及专业的游戏攻略。▶无限99999钻999999金币的游戏盒子排行榜TOP1:游戏豹官网特点:内部特权游戏类型:多类型推荐日活跃人数:15万网址链接:www.ystt88.cn游戏介绍:游戏豹官网以快速获</div> </li> <li><a href="/article/1835238039471878144.htm" title="拼多多返利app叫什么名字?拼多多返利靠前的5个软件大全" target="_blank">拼多多返利app叫什么名字?拼多多返利靠前的5个软件大全</a> <span class="text-muted">小小编007</span> <div>拼多多返利app指的是拼多多购物平台的返现或折扣应用。这些应用通过提供优惠券、折扣、返现等方式吸引消费者,增加购物体验的实惠性。在拼多多平台上,有很多返利软件,其中排名前五的软件分别是:1.果冻宝盒果冻宝盒是一个综合导购返利软件,覆盖了淘宝,拼多多、京东、抖音等各大电商平台的商品优惠券和返利服务。还有话费充值,汽车加油,电影票,外卖红包,视频会员充值等各种低折扣生活娱乐权益。果冻宝盒相比其它同行,</div> </li> <li><a href="/article/1835233628628545536.htm" title="Linux下open函数详解" target="_blank">Linux下open函数详解</a> <span class="text-muted">威桑</span> <a class="tag" taget="_blank" href="/search/Linux/1.htm">Linux</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>在Linux中,open函数是文件操作的核心系统调用之一,它用于打开文件并返回一个文件描述符,用于后续的文件操作如读取、写入、关闭等。open函数的原型#include#include#include#includeintopen(constchar*pathname,intflags);intopen(constchar*pathname,intflags,mode_tmode);open函数有</div> </li> <li><a href="/article/1835231814474625024.htm" title="Mac配置环境变量的地方" target="_blank">Mac配置环境变量的地方</a> <span class="text-muted">哪个鹿</span> <div>Mac配置环境变量的地方①/etc/profile(建议不修改这个文件)全局(公有)配置,不管是哪个用户,登录时都会读取该文件。②/etc/bashrc(一般在这个文件中添加系统级环境变量)全局(公有)配置,bashshell执行时,不管是何种方式,都会读取此文件。③~/.bash_profile(一般在这个文件中添加用户级环境变量)每个用户都可使用该文件输入专用于自己使用的shell信息,当用户</div> </li> <li><a href="/article/1835211322527150080.htm" title="linux的安装程序 与 文件 相关的命令" target="_blank">linux的安装程序 与 文件 相关的命令</a> <span class="text-muted">可能只会写BUG</span> <a class="tag" taget="_blank" href="/search/c%E8%AF%AD%E8%A8%80/1.htm">c语言</a><a class="tag" taget="_blank" href="/search/c%2Fc%2B%2B/1.htm">c/c++</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a> <div>软件安装卸载命令软件包介绍软件包命名格式dpkg命令apt-get命令apt-get命令压缩和解压命令压缩文件后缀压缩命令打包和解包命令tar命令文件分割命令split命令文件操作相关命令cat命令head命令tail命令more命令less命令管道命令wc命令grep命令find命令cut命令sort命令uniq命令diff命令文件属性命令chmod命令chown命令chgrp命令ln命令硬链接</div> </li> <li><a href="/article/1835206276364201984.htm" title="python数据分析知识点大全" target="_blank">python数据分析知识点大全</a> <span class="text-muted">编程零零七</span> <a class="tag" taget="_blank" href="/search/python%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90/1.htm">python数据分析</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a><a class="tag" taget="_blank" href="/search/python%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90/1.htm">python数据分析</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E7%9F%A5%E8%AF%86%E7%82%B9%E5%A4%A7%E5%85%A8/1.htm">数据分析知识点大全</a><a class="tag" taget="_blank" href="/search/python%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E7%9F%A5%E8%AF%86%E7%82%B9/1.htm">python数据分析知识点</a><a class="tag" taget="_blank" href="/search/python%E6%95%99%E7%A8%8B/1.htm">python教程</a><a class="tag" taget="_blank" href="/search/python%E5%9F%BA%E7%A1%80/1.htm">python基础</a> <div>Python数据分析知识点大全可以归纳为以下几个主要方面:一、基础概念与目的数据分析定义:数据分析是指用适当的统计分析方法对收集来的大量数据进行分析,提取有用信息和形成结论,对数据加以详细研究和概括总结的过程。其目的在于从数据中挖掘规律、验证猜想、进行预测。Python在数据分析中的优势:Python因其易学性、快速开发、丰富的扩展库(如NumPy、Pandas等)和成熟的框架,成为数据分析领域的</div> </li> <li><a href="/article/117.htm" title="Algorithm" target="_blank">Algorithm</a> <span class="text-muted">香水浓</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/Algorithm/1.htm">Algorithm</a> <div>冒泡排序 public static void sort(Integer[] param) { for (int i = param.length - 1; i > 0; i--) { for (int j = 0; j < i; j++) { int current = param[j]; int next = param[j + 1];</div> </li> <li><a href="/article/244.htm" title="mongoDB 复杂查询表达式" target="_blank">mongoDB 复杂查询表达式</a> <span class="text-muted">开窍的石头</span> <a class="tag" taget="_blank" href="/search/mongodb/1.htm">mongodb</a> <div>1:count    Pg: db.user.find().count();    统计多少条数据 2:不等于$ne    Pg: db.user.find({_id:{$ne:3}},{name:1,sex:1,_id:0});    查询id不等于3的数据。 3:大于$gt $gte(大于等于) &n</div> </li> <li><a href="/article/371.htm" title="Jboss Java heap space异常解决方法, jboss OutOfMemoryError : PermGen space" target="_blank">Jboss Java heap space异常解决方法, jboss OutOfMemoryError : PermGen space</a> <span class="text-muted">0624chenhong</span> <a class="tag" taget="_blank" href="/search/jvm/1.htm">jvm</a><a class="tag" taget="_blank" href="/search/jboss/1.htm">jboss</a> <div>转自 http://blog.csdn.net/zou274/article/details/5552630 解决办法: window->preferences->java->installed jres->edit jre 把default vm arguments 的参数设为-Xms64m -Xmx512m ----------------</div> </li> <li><a href="/article/498.htm" title="文件上传 下载 解析 相对路径" target="_blank">文件上传 下载 解析 相对路径</a> <span class="text-muted">不懂事的小屁孩</span> <a class="tag" taget="_blank" href="/search/%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0/1.htm">文件上传</a> <div>有点坑吧,弄这么一个简单的东西弄了一天多,身边还有大神指导着,网上各种百度着。 下面总结一下遇到的问题: 文件上传,在页面上传的时候,不要想着去操作绝对路径,浏览器会对客户端的信息进行保护,避免用户信息收到攻击。 在上传图片,或者文件时,使用form表单来操作。 前台通过form表单传输一个流到后台,而不是ajax传递参数到后台,代码如下: <form action=&</div> </li> <li><a href="/article/625.htm" title="怎么实现qq空间批量点赞" target="_blank">怎么实现qq空间批量点赞</a> <span class="text-muted">换个号韩国红果果</span> <a class="tag" taget="_blank" href="/search/qq/1.htm">qq</a> <div>纯粹为了好玩!! 逻辑很简单 1 打开浏览器console;输入以下代码。 先上添加赞的代码 var tools={}; //添加所有赞 function init(){ document.body.scrollTop=10000; setTimeout(function(){document.body.scrollTop=0;},2000);//加</div> </li> <li><a href="/article/752.htm" title="判断是否为中文" target="_blank">判断是否为中文</a> <span class="text-muted">灵静志远</span> <a class="tag" taget="_blank" href="/search/%E4%B8%AD%E6%96%87/1.htm">中文</a> <div>方法一: public class Zhidao { public static void main(String args[]) { String s = "sdf灭礌 kjl d{';\fdsjlk是"; int n=0; for(int i=0; i<s.length(); i++) { n = (int)s.charAt(i); if((</div> </li> <li><a href="/article/879.htm" title="一个电话面试后总结" target="_blank">一个电话面试后总结</a> <span class="text-muted">a-john</span> <a class="tag" taget="_blank" href="/search/%E9%9D%A2%E8%AF%95/1.htm">面试</a> <div>今天,接了一个电话面试,对于还是初学者的我来说,紧张了半天。 面试的问题分了层次,对于一类问题,由简到难。自己觉得回答不好的地方作了一下总结:   在谈到集合类的时候,举几个常用的集合类,想都没想,直接说了list,map。   然后对list和map分别举几个类型:   list方面:ArrayList,LinkedList。在谈到他们的区别时,愣住了</div> </li> <li><a href="/article/1006.htm" title="MSSQL中Escape转义的使用" target="_blank">MSSQL中Escape转义的使用</a> <span class="text-muted">aijuans</span> <a class="tag" taget="_blank" href="/search/MSSQL/1.htm">MSSQL</a> <div>IF OBJECT_ID('tempdb..#ABC') is not null drop table tempdb..#ABC create table #ABC ( PATHNAME NVARCHAR(50) ) insert into #ABC SELECT N'/ABCDEFGHI' UNION ALL SELECT N'/ABCDGAFGASASSDFA' UNION ALL</div> </li> <li><a href="/article/1133.htm" title="一个简单的存储过程" target="_blank">一个简单的存储过程</a> <span class="text-muted">asialee</span> <a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a><a class="tag" taget="_blank" href="/search/%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B/1.htm">存储过程</a><a class="tag" taget="_blank" href="/search/%E6%9E%84%E9%80%A0%E6%95%B0%E6%8D%AE/1.htm">构造数据</a><a class="tag" taget="_blank" href="/search/%E6%89%B9%E9%87%8F%E6%8F%92%E5%85%A5/1.htm">批量插入</a> <div>           今天要批量的生成一批测试数据,其中中间有部分数据是变化的,本来想写个程序来生成的,后来想到存储过程就可以搞定,所以随手写了一个,记录在此:            DELIMITER $$ DROP PROCEDURE IF EXISTS inse</div> </li> <li><a href="/article/1260.htm" title="annot convert from HomeFragment_1 to Fragment" target="_blank">annot convert from HomeFragment_1 to Fragment</a> <span class="text-muted">百合不是茶</span> <a class="tag" taget="_blank" href="/search/android/1.htm">android</a><a class="tag" taget="_blank" href="/search/%E5%AF%BC%E5%8C%85%E9%94%99%E8%AF%AF/1.htm">导包错误</a> <div>创建了几个类继承Fragment, 需要将创建的类存储在ArrayList<Fragment>中; 出现不能将new 出来的对象放到队列中,原因很简单;     创建类时引入包是:import android.app.Fragment;      创建队列和对象时使用的包是:import android.support.v4.ap</div> </li> <li><a href="/article/1387.htm" title="Weblogic10两种修改端口的方法" target="_blank">Weblogic10两种修改端口的方法</a> <span class="text-muted">bijian1013</span> <a class="tag" taget="_blank" href="/search/weblogic/1.htm">weblogic</a><a class="tag" taget="_blank" href="/search/%E7%AB%AF%E5%8F%A3%E5%8F%B7/1.htm">端口号</a><a class="tag" taget="_blank" href="/search/%E9%85%8D%E7%BD%AE%E7%AE%A1%E7%90%86/1.htm">配置管理</a><a class="tag" taget="_blank" href="/search/config.xml/1.htm">config.xml</a> <div>一.进入控制台进行修改    1.进入控制台:  http://127.0.0.1:7001/console     2.展开左边树菜单         域结构->环境->服务器-->点击AdminServer(管理) &</div> </li> <li><a href="/article/1514.htm" title="mysql 操作指令" target="_blank">mysql 操作指令</a> <span class="text-muted">征客丶</span> <a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a> <div>一、连接mysql 进入 mysql 的安装目录; $ bin/mysql -p [host IP 如果是登录本地的mysql 可以不写 -p 直接 -u] -u [userName] -p 输入密码,回车,接连; 二、权限操作[如果你很了解mysql数据库后,你可以直接去修改系统表,然后用 mysql> flush privileges; 指令让权限生效] 1、赋权 mys</div> </li> <li><a href="/article/1641.htm" title="【Hive一】Hive入门" target="_blank">【Hive一】Hive入门</a> <span class="text-muted">bit1129</span> <a class="tag" taget="_blank" href="/search/hive/1.htm">hive</a> <div>Hive安装与配置 Hive的运行需要依赖于Hadoop,因此需要首先安装Hadoop2.5.2,并且Hive的启动前需要首先启动Hadoop。   Hive安装和配置的步骤   1. 从如下地址下载Hive0.14.0   http://mirror.bit.edu.cn/apache/hive/    2.解压hive,在系统变</div> </li> <li><a href="/article/1768.htm" title="ajax 三种提交请求的方法" target="_blank">ajax 三种提交请求的方法</a> <span class="text-muted">BlueSkator</span> <a class="tag" taget="_blank" href="/search/Ajax/1.htm">Ajax</a><a class="tag" taget="_blank" href="/search/jqery/1.htm">jqery</a> <div>1、ajax 提交请求 $.ajax({ type:"post", url : "${ctx}/front/Hotel/getAllHotelByAjax.do", dataType : "json", success : function(result) { try { for(v</div> </li> <li><a href="/article/1895.htm" title="mongodb开发环境下的搭建入门" target="_blank">mongodb开发环境下的搭建入门</a> <span class="text-muted">braveCS</span> <a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a> <div>  linux下安装mongodb 1)官网下载mongodb-linux-x86_64-rhel62-3.0.4.gz 2)linux 解压  gzip -d mongodb-linux-x86_64-rhel62-3.0.4.gz; mv mongodb-linux-x86_64-rhel62-3.0.4 mongodb-linux-x86_64-rhel62-</div> </li> <li><a href="/article/2022.htm" title="编程之美-最短摘要的生成" target="_blank">编程之美-最短摘要的生成</a> <span class="text-muted">bylijinnan</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/1.htm">数据结构</a><a class="tag" taget="_blank" href="/search/%E7%AE%97%E6%B3%95/1.htm">算法</a><a class="tag" taget="_blank" href="/search/%E7%BC%96%E7%A8%8B%E4%B9%8B%E7%BE%8E/1.htm">编程之美</a> <div> import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; public class ShortestAbstract { /** * 编程之美 最短摘要的生成 * 扫描过程始终保持一个[pBegin,pEnd]的range,初始化确保[pBegin,pEnd]的ran</div> </li> <li><a href="/article/2149.htm" title="json数据解析及typeof" target="_blank">json数据解析及typeof</a> <span class="text-muted">chengxuyuancsdn</span> <a class="tag" taget="_blank" href="/search/js/1.htm">js</a><a class="tag" taget="_blank" href="/search/typeof/1.htm">typeof</a><a class="tag" taget="_blank" href="/search/json%E8%A7%A3%E6%9E%90/1.htm">json解析</a> <div> // json格式 var people='{"authors": [{"firstName": "AAA","lastName": "BBB"},' +' {"firstName": "CCC&</div> </li> <li><a href="/article/2276.htm" title="流程系统设计的层次和目标" target="_blank">流程系统设计的层次和目标</a> <span class="text-muted">comsci</span> <a class="tag" taget="_blank" href="/search/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/1.htm">设计模式</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/1.htm">数据结构</a><a class="tag" taget="_blank" href="/search/sql/1.htm">sql</a><a class="tag" taget="_blank" href="/search/%E6%A1%86%E6%9E%B6/1.htm">框架</a><a class="tag" taget="_blank" href="/search/%E8%84%9A%E6%9C%AC/1.htm">脚本</a> <div>                               流程系统设计的层次和目标  </div> </li> <li><a href="/article/2403.htm" title="RMAN List和report 命令" target="_blank">RMAN List和report 命令</a> <span class="text-muted">daizj</span> <a class="tag" taget="_blank" href="/search/oracle/1.htm">oracle</a><a class="tag" taget="_blank" href="/search/list/1.htm">list</a><a class="tag" taget="_blank" href="/search/report/1.htm">report</a><a class="tag" taget="_blank" href="/search/rman/1.htm">rman</a> <div>LIST 命令 使用RMAN LIST 命令显示有关资料档案库中记录的备份集、代理副本和映像副本的 信息。使用此命令可列出: • RMAN 资料档案库中状态不是AVAILABLE 的备份和副本 • 可用的且可以用于还原操作的数据文件备份和副本 • 备份集和副本,其中包含指定数据文件列表或指定表空间的备份 • 包含指定名称或范围的所有归档日志备份的备份集和副本 • 由标记、完成时间、可</div> </li> <li><a href="/article/2530.htm" title="二叉树:红黑树" target="_blank">二叉树:红黑树</a> <span class="text-muted">dieslrae</span> <a class="tag" taget="_blank" href="/search/%E4%BA%8C%E5%8F%89%E6%A0%91/1.htm">二叉树</a> <div>    红黑树是一种自平衡的二叉树,它的查找,插入,删除操作时间复杂度皆为O(logN),不会出现普通二叉搜索树在最差情况时时间复杂度会变为O(N)的问题.     红黑树必须遵循红黑规则,规则如下     1、每个节点不是红就是黑。     2、根总是黑的  &</div> </li> <li><a href="/article/2657.htm" title="C语言homework3,7个小题目的代码" target="_blank">C语言homework3,7个小题目的代码</a> <span class="text-muted">dcj3sjt126com</span> <a class="tag" taget="_blank" href="/search/c/1.htm">c</a> <div>1、打印100以内的所有奇数。 # include <stdio.h> int main(void) { int i; for (i=1; i<=100; i++) { if (i%2 != 0) printf("%d ", i); } return 0; }  2、从键盘上输入10个整数,</div> </li> <li><a href="/article/2784.htm" title="自定义按钮, 图片在上, 文字在下, 居中显示" target="_blank">自定义按钮, 图片在上, 文字在下, 居中显示</a> <span class="text-muted">dcj3sjt126com</span> <a class="tag" taget="_blank" href="/search/%E8%87%AA%E5%AE%9A%E4%B9%89/1.htm">自定义</a> <div>#import <UIKit/UIKit.h> @interface MyButton : UIButton -(void)setFrame:(CGRect)frame ImageName:(NSString*)imageName Target:(id)target Action:(SEL)action Title:(NSString*)title Font:(CGFloa</div> </li> <li><a href="/article/2911.htm" title="MySQL查询语句练习题,测试足够用了" target="_blank">MySQL查询语句练习题,测试足够用了</a> <span class="text-muted">flyvszhb</span> <a class="tag" taget="_blank" href="/search/sql/1.htm">sql</a><a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a> <div>http://blog.sina.com.cn/s/blog_767d65530101861c.html 1.创建student和score表 CREATE  TABLE  student ( id  INT(10)  NOT NULL  UNIQUE  PRIMARY KEY  , name  VARCHAR</div> </li> <li><a href="/article/3038.htm" title="转:MyBatis Generator 详解" target="_blank">转:MyBatis Generator 详解</a> <span class="text-muted">happyqing</span> <a class="tag" taget="_blank" href="/search/mybatis/1.htm">mybatis</a> <div>  MyBatis Generator 详解 http://blog.csdn.net/isea533/article/details/42102297   MyBatis Generator详解 http://git.oschina.net/free/Mybatis_Utils/blob/master/MybatisGeneator/MybatisGeneator.</div> </li> <li><a href="/article/3165.htm" title="让程序员少走弯路的14个忠告" target="_blank">让程序员少走弯路的14个忠告</a> <span class="text-muted">jingjing0907</span> <a class="tag" taget="_blank" href="/search/%E5%B7%A5%E4%BD%9C/1.htm">工作</a><a class="tag" taget="_blank" href="/search/%E8%AE%A1%E5%88%92/1.htm">计划</a><a class="tag" taget="_blank" href="/search/%E5%AD%A6%E4%B9%A0/1.htm">学习</a> <div>  无论是谁,在刚进入某个领域之时,有再大的雄心壮志也敌不过眼前的迷茫:不知道应该怎么做,不知道应该做什么。下面是一名软件开发人员所学到的经验,希望能对大家有所帮助   1.不要害怕在工作中学习。 只要有电脑,就可以通过电子阅读器阅读报纸和大多数书籍。如果你只是做好自己的本职工作以及分配的任务,那是学不到很多东西的。如果你盲目地要求更多的工作,也是不可能提升自己的。放</div> </li> <li><a href="/article/3292.htm" title="nginx和NetScaler区别" target="_blank">nginx和NetScaler区别</a> <span class="text-muted">流浪鱼</span> <a class="tag" taget="_blank" href="/search/nginx/1.htm">nginx</a> <div>NetScaler是一个完整的包含操作系统和应用交付功能的产品,Nginx并不包含操作系统,在处理连接方面,需要依赖于操作系统,所以在并发连接数方面和防DoS攻击方面,Nginx不具备优势。 2.易用性方面差别也比较大。Nginx对管理员的水平要求比较高,参数比较多,不确定性给运营带来隐患。在NetScaler常见的配置如健康检查,HA等,在Nginx上的配置的实现相对复杂。 3.策略灵活度方</div> </li> <li><a href="/article/3419.htm" title="第11章 动画效果(下)" target="_blank">第11章 动画效果(下)</a> <span class="text-muted">onestopweb</span> <a class="tag" taget="_blank" href="/search/%E5%8A%A8%E7%94%BB/1.htm">动画</a> <div>index.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/</div> </li> <li><a href="/article/3546.htm" title="FAQ - SAP BW BO roadmap" target="_blank">FAQ - SAP BW BO roadmap</a> <span class="text-muted">blueoxygen</span> <a class="tag" taget="_blank" href="/search/BO/1.htm">BO</a><a class="tag" taget="_blank" href="/search/BW/1.htm">BW</a> <div>http://www.sdn.sap.com/irj/boc/business-objects-for-sap-faq   Besides, I care that how to integrate tightly.   By the way, for BW consultants, please just focus on Query Designer which i</div> </li> <li><a href="/article/3673.htm" title="关于java堆内存溢出的几种情况" target="_blank">关于java堆内存溢出的几种情况</a> <span class="text-muted">tomcat_oracle</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/jvm/1.htm">jvm</a><a class="tag" taget="_blank" href="/search/jdk/1.htm">jdk</a><a class="tag" taget="_blank" href="/search/thread/1.htm">thread</a> <div>【情况一】:    java.lang.OutOfMemoryError: Java heap space:这种是java堆内存不够,一个原因是真不够,另一个原因是程序中有死循环;   如果是java堆内存不够的话,可以通过调整JVM下面的配置来解决:   <jvm-arg>-Xms3062m</jvm-arg>   <jvm-arg>-Xmx</div> </li> <li><a href="/article/3800.htm" title="Manifest.permission_group权限组" target="_blank">Manifest.permission_group权限组</a> <span class="text-muted">阿尔萨斯</span> <a class="tag" taget="_blank" href="/search/Permission/1.htm">Permission</a> <div>结构 继承关系 public static final class Manifest.permission_group extends Object java.lang.Object android. Manifest.permission_group 常量 ACCOUNTS 直接通过统计管理器访问管理的统计 COST_MONEY可以用来让用户花钱但不需要通过与他们直接牵涉的权限 D</div> </li> </ul> </div> </div> </div> <div> <div class="container"> <div class="indexes"> <strong>按字母分类:</strong> <a href="/tags/A/1.htm" target="_blank">A</a><a href="/tags/B/1.htm" target="_blank">B</a><a href="/tags/C/1.htm" target="_blank">C</a><a href="/tags/D/1.htm" target="_blank">D</a><a href="/tags/E/1.htm" target="_blank">E</a><a href="/tags/F/1.htm" target="_blank">F</a><a href="/tags/G/1.htm" target="_blank">G</a><a href="/tags/H/1.htm" target="_blank">H</a><a href="/tags/I/1.htm" target="_blank">I</a><a href="/tags/J/1.htm" target="_blank">J</a><a href="/tags/K/1.htm" target="_blank">K</a><a href="/tags/L/1.htm" target="_blank">L</a><a href="/tags/M/1.htm" target="_blank">M</a><a href="/tags/N/1.htm" target="_blank">N</a><a href="/tags/O/1.htm" target="_blank">O</a><a href="/tags/P/1.htm" target="_blank">P</a><a href="/tags/Q/1.htm" target="_blank">Q</a><a href="/tags/R/1.htm" target="_blank">R</a><a href="/tags/S/1.htm" target="_blank">S</a><a href="/tags/T/1.htm" target="_blank">T</a><a href="/tags/U/1.htm" target="_blank">U</a><a href="/tags/V/1.htm" target="_blank">V</a><a href="/tags/W/1.htm" target="_blank">W</a><a href="/tags/X/1.htm" target="_blank">X</a><a href="/tags/Y/1.htm" target="_blank">Y</a><a href="/tags/Z/1.htm" target="_blank">Z</a><a href="/tags/0/1.htm" target="_blank">其他</a> </div> </div> </div> <footer id="footer" class="mb30 mt30"> <div class="container"> <div class="footBglm"> <a target="_blank" href="/">首页</a> - <a target="_blank" href="/custom/about.htm">关于我们</a> - <a target="_blank" href="/search/Java/1.htm">站内搜索</a> - <a target="_blank" href="/sitemap.txt">Sitemap</a> - <a target="_blank" href="/custom/delete.htm">侵权投诉</a> </div> <div class="copyright">版权所有 IT知识库 CopyRight © 2000-2050 E-COM-NET.COM , All Rights Reserved. <!-- <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">京ICP备09083238号</a><br>--> </div> </div> </footer> <!-- 代码高亮 --> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shCore.js"></script> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shLegacy.js"></script> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shAutoloader.js"></script> <link type="text/css" rel="stylesheet" href="/static/syntaxhighlighter/styles/shCoreDefault.css"/> <script type="text/javascript" src="/static/syntaxhighlighter/src/my_start_1.js"></script> </body> </html>