一些自己实践得出的技巧1

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

locate xboing > test

tar -cvf xboing.tar -T test

gzip xboing.tar

cp xboing.tar.gz /mnt/usb

the above command can copy a software which have been installed on someone system to your own system^-^

#!/bin/sh

for fname in *;do

tmp=`echo $fname|tr [a-z] [A-Z]` #note ,tr can't act like this'tr fname [a-z] [A-Z]'

# it must run as this'tr <fname [a-z] [A-Z]',but this will upcased the content of fname

#so,if you want rename a file list,you must redirect tr's stdin to some command's stdout

mv $fname $tmp

done

the above code cost me lots of time!^-^

it can rename file name in your current dir from lowercase to upper case

this is very useful while you untar a tarball which is tared in a dos/windows system

date +%m-%d-%Y

the above cmd can output current time in MM-DD-YYYY format

tr -s '\n' '\n' <test.txt

the above cmd will del all empty line

ls {*.wav,*.mp3}

the above cmd list all mp3 or wav files in current dir

ls {*.wav,*.mp3,*.log}

the above cmd list all mp3 or wav or log files in current dir

if [ $(date +%H) -ge 22 ]; then

echo whp; else

echo dll; fi

you can do diffrent work in diffrent time

grep 'd\+' test.txt

grep 'd\{1,\}' test.txt

the above cmd match lines which contain one or more 'd'

if you want to use xpdf,you must install /slackware/l/lesstif

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航