Monday, March 30, 2009

一些常用命令

更多精彩请到 http://www.139ya.com


find ./ -type f -print | wc -l


cd folder
cleartool mklbtype -nc LABEL_NAME
cleartool mklabel -r LABEL_NAME .


/apps/vendor/bin/bsub -I -q zch07e-sim 'cd /vobs/linuxjava/platform && clearmake PRODUCT=keywest TEST_ENGBLD=1 BUILD_DEPS=0 build/mediafinder'


/apps/vendor/bin/bsub -I -q zch07e-sim 'cd /vobs/linuxjava/platform && clearmake PRODUCT=marco PRODUCT_CONF=p0a_lp_128ram TEST_ENGBLD=1 BUILD_DEPS=0 FEAT_APLOG_LEVEL=8 build/mediafinder'

clearmake PRODUCT=marco PRODUCT_CONF=p0a_lp_128ram TEST_ENGBLD=1 BUILD_DEPS=0 FEAT_APLOG_LEVEL=8 build/metadata_service

c find -version {version(.../libpp88888_zch07e_e13370/LATEST)} -print

clt find . -version " lbtype(LJ6.1_ALARM_INT_200604101559) && (! lbtype(LJ6.1_ALARM_INT_200603201406))" -print



strace -o /mnt/msc_int0/s.out -p {this-xp-pid}


c rename brtype:dbg_zch68_e13370_delay_mme_0422_1 brtype:libpp54743_zch68_e13370_0424


mount -o bind

clt find . -version " lbtype(LJ6.1_ALARM_INT_200604101559) && (! lbtype LJ6.1_ALARM_INT_200603201406))" -print

init cs for new project
#element /vobs/linuxjava/multimedia_apps/fmradio/... .../dbg_zch68_e13370_fl_fmradio/LATEST
#mkbranch dbg_zch68_e13370_fl_fmradio
# element /vobs/linuxjava/multimedia_apps/fmradio/... MAGX_N_06.31.60I
# element /vobs/linuxjava/multimedia_apps/fmradio/... /main/LATEST
#end mkbranch


maps_parser –i –p xxx(pid) |grep DP

maps_parser –aluki –p xxx(pid) |grep DP


1. How to create branch ?
clt mkbrtype -nc branch-name

example: clt mkbrtype -nc libkk82849_zch07_cknr34_13306
comments: current directory must be "/vobs/linuxjava/utilapps/utilapps"

2. How to rename branch ?
clt rename brtype:rel2_bugfix brtype:r2_maint

3. How to remove branch ?
clt rmtype -rmall brtype:branch-name

4. How to checkin/checkou/uncheckout all files ?
c lsco -r -s -cview |xargs cleartool unco
c lsco -r -s -cview |xargs cleartool ci -nc
c lsco -r -s -cview |xargs cleartool co -nc

5. How to merge code from a branch to another branch ?
A: c findmerge . -fver .../dbg_zch07e_cknr34_63_bugfix/LATEST -print
B list all files which are need to merge:
c findmerge /vobs/linuxjava/utilapps/utilapps -fver .../dbg_zch07e_cknr34_63_bugfix/LATEST -print
C merge all files:
c findmerge /vobs/linuxjava/utilapps/utilapps -fver .../dbg_zch07e_cknr34_63_bugfix/LATEST -merge -nc
D merge a file:
c findmerge DLM_UI_UICtrl.cpp -fver .../dbg_zch07e_cknr34_63_bugfix/LATEST -merge -nc

6. How to list all files which are from a special branch ?
c ls -s -r path_name | grep branch_name
example:
c ls -s -r /vobs/linuxjava/utilapps/utilapps | grep libmm01869_zch07e_cknr34
c ls -s -r /vobs/lj_browser_oss/code/downloadagent/engine | grep dbg_zch07e_cknr34_63_prt


7. How to remove a special version?
c rmver -xbranch util.c@@/main/2
clt rmver main.cpp@@/main/par_n_ljutilapps_lj_6.2/libmm01869_zch07e_cknr34/1


10: How to make label?
a. create label name
clt mklbtype -nc LABEL_NAME;
example: clt mklbtype -nc DLM_13306
** current dir must under /vobs/linuxjava/utilapps/utilapps or its subdir

b. make label to files
clt mklabel DLM_13306 DLM_TransSession.h //make a file.
clt mklabel DLM_13306 PHONE_SI_HomeScreen.cpp@@/main/par_n_ljhomescrn_lj_6.2/libkk39689_zch07e_e5539c_hs_20061113/1 //make a file
clt mklabel DLM_13306 $(clt ls -r -s | grep dbg_zch07_e12725_13306_6_3)
//make label in all modify files.
clt find . -name '*' -element 'lbtype_sub(DLM_13306)' -print //list all
files from special label.

make label to folder
>cd folder
>cleartool mklbtype -nc LABEL_NAME
>cleartool mklabel -r LABEL_NAME .

11: How to compare local file with special version file.
vimdiff DLM_UI_DlgCtrl.cpp@@/main/par_n_ljutilapps_lj_6.2/libkk49617_zch07_e12725_13306/1 DLM_UI_DlgCtrl.cpp

12: How to add new file to clearcase?
a. check out the directory includes the files.
b. use command: umask 0000
c. use command: clt mkelem -ci -nc filename;

13: How to stats modified code?
/vobs/linuxjava/platform/tools/bin/clear_dlc -src brtype:libkk49617_zch07_cknr34_13306 -base lbtype:LJAP_N_03.14.20I

14: How to delete special char from a file?
cat 03.17.21.txt | tr -d '\015' > 03.17.21.txt.new

No comments: