This document provides a summary of common Clearcase user commands organized into the following categories: configuring user aliases, commands for viewing information, commands for working with elements such as check-out and check-in, commands for working with labels and branches, and help commands. Some key commands include ct to run Clearcase, ct lsvob to list VOBs, ct lsview to list views, ct co and ct ci to check-out and check-in elements, and ct lsvtree to view version trees.
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
1K views
Clear Case User Commands
This document provides a summary of common Clearcase user commands organized into the following categories: configuring user aliases, commands for viewing information, commands for working with elements such as check-out and check-in, commands for working with labels and branches, and help commands. Some key commands include ct to run Clearcase, ct lsvob to list VOBs, ct lsview to list views, ct co and ct ci to check-out and check-in elements, and ct lsvtree to view version trees.
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 10
Clearcase User Commands:
Confgure user aliases:
File: $HOME/.bashrc alias ct=/usr/atria/bin/cleartool alias sv='/usr/atria/bin/cleartool setview' umask 022
File: $HOME/.cshrc alias ct /usr/atria/bin/cleartool alias sv '/usr/atria/bin/cleartool setview' umask 022
This umask will set the default privileges on new fles and direcotries. Default protection will be set so that the user may write data but others can read. Commands: ClearCase Command Description ct -ver Display Clearcase, cleartool, db_server and VOB database schema version. ct lsvob List vob mount table: * /vob/VOB-NAME.vbt /hosts/host- name/rvob/vobs/vobstore/VOB- NAME.vbs !ublic * /vob/!ractice"vob.vbt /hosts/host-name/view- name/#obs/vobstore/!ractice"vob.vbs !ublic ct $um! element-or-DO Print internal Clearcase info. ct lsview List all views: millesc"view /hosts/host- name/view- name/#iews/millesc"view.vws * user-name /hosts/host- name/view-name/#iews/re%"view.vws ct lsview view-tag List view path. ct mkta% -view -ta% dynamic-view- name -nstart /hosts/node- name/home/clear$ata/views/dynamic- view-name or ct mkta% -vob vob-tag ... Create a view-tag or VOB-tag. ct mkview -ta% user1_view - st%locviewstore Create a new view in "viewstore" Clearcase server view mount point (see YoLinux client or serverinstallation tutorial). List view storage locations: ct lsst%loc ct mkview -ta% tmpA_view/hosts/node- name/home/clear$ata/views/tmpA_view Create a new view. ct setview user-name_view Set current view to user-name_view. ct startview common_view Set current view to common_view without starting a Clearcase shell environent. It allows one to view (only) the fles. Path: /view/common"view/vob/vob- name/... ct en$view common_view ct en$view -server user-name_view Deactivate a Clearcase view. (First exit view) Useful if you get stale NFS handles. ct rmview -ta% temp_view or ct rmview temp_view Remove view temp_view. cleartool setview username_view sv user-name_view Set Clearcase view. See alias defned above. ct !wv Print working view/current view: &orkin% $irector' view( username_view )et view( username_view echo $*+E,-*,)E"-OO. Print current view path. ct ls -l ct ls -vob"onl' Using current view, show fles, private fles, fle version and rule. -vob_only: List elements and not derived objects Format: ... version ile!e"t///main/2 -ule( element */main/+,.E). $irector' version Directoy- name///main/2 -ule( element * /main/+,.E). view !rivate ob0ect 1ile2.c ... ct lst'!e -kin$ lbt'!e -list labels List labels ct lsvtree -all ile-name!e"t List fle version label and build label: (version tree) ile-name!e"t///main ile-name!e"t///main/0 ile-name!e"t///main/ 2345+6""07 ile-name!e"t///main/2 2345+6""7 ct lsvtree -all pre# List fle version label and build label for fles beginning with "pref" ct lshistor' 8all9 ile-or-directory ct lshistor' ile-name List fle or directory version history. List event rocords for a given fle. ct chevent -c 'new-comment-%oes- here' -re!lace -event event-id ct chevent -c 'new-comment-%oes- here' -re!lace -lbt'!e label Change the comment on a version of an element. Lookup event id: ct lsh -event ile- or-element $hange the comment on a label! ct lsco ct lsco -r ct lsco -avobs -me ct lsco -avobs -cview List all checked out fles in current directory. Flag "-r" recusivly looks in sub directories. List all fles checked out to all views. List checkouts in view. ct lscheckout -l ct lsco -l ct lsco -recursive -me -cview List checked out fles. (same) List fles in current directory and subdirectories checked out to you in current view. Omit -cview tag to get all. ct catcr ile-name List confguration record for a fle. ct 1in$ ./ -branch 'brt'!e2branch- name7' -!rint ct 1in$ ./ -version2main/+,.E).7 :: ;< version2&ABE&_'7' -!rint ct fnd -avobs -nxname -element 'brtype(view_name)' -print List fles in branch with search name or attribute. List fles with label "LATEST" but not LABEL_X. ct ls!rivate ct ls! -co List all private fles in current view. View private fles are fles residing in the Clearcase flesystem but not under the control of Clearcase. i.e. object fles as a result of a compile. May not be viewable by others. List fles checked out to current view. ct mklbt'!e -nc &ABE&_NAME ct mklbt'!e -c =comment= &ABE&_NAME Create a label to be used later. ct lst'!e -kin$ lbt'!e -short > sort List labels. ct $escribe -l ile!e"t Describe object in VOB. Lists branch and version of fle and confgspec used in view. ct $escribe ile-or-directory List fle or directory information. ct $escribe -lon% element(ile-or- directory List fle or directory information. ct $escribe -lon% vob((vob List vob information. ct mklabel &ABE&_NAME ile-name!e"t ct mklabel -r &ABE&_NAME Apply label to a fle. Label elements in directory tree. ct mklabel -re!lace NE)_&ABE&_NAME ile-name!e"t**(main(+ Apply label to a newer version of the fle. ct rmt'!e -rmall -1orce lbt'!e(&ABE&_NAME ct rmt'!e -lbt'!e -rmall &ABE&_NAME Remove a label of the name given. The option "-rmall" causes the removal of all instances of the label on all fles / directories.Remove label type and all occurrences of the label. ct rmt'!e lbt'!e(&ABE&_NAME Remove label from Clearcase. It will not be removed if label has been applied. Use option "-rmall" to remove label and all instances of its application. ct rmt'!e -rmall -brt'!e branch-type Remove branch and all fles / directories in branch from Clearcase. Data disposed in "lost-found". ct 1in$ -avobs -version =lbt'!e 2Build-&abel7= -!rint ct 1in$ . -name '*.8hc9' -element 'lbt'!e"sub2&ABE&_NAME7' -!rint Print all fles and fle versions going into build specifed. list all .h and .c fles whith the given label. ct co -nc ile-name Check-Out fle (RCS command) -No Comment ct mk$ir directory-name Create a directory. Checkout parent directory frst. ct ln -s source-directory-namelocal- directory-name Create a symbolic link to a directory. Checkout parent directory frst. ct mkelem -ci -nc ilename Add fle to Clearcase control. ct rmelem ilename Remove fle from Clearcase control. All history and knowledge of the element is completely removed. By contrast, the "ct rm" command will remove the fle and not the history and the directory must be checked out in order to make this change. ct rmelem -rm ilename Remove fle from Clearcase control and remove private view fle. ct rmelem directory-name(# Remove directory, revision history and its contents from Clearcase control. ct rmver ilename///main/+,.E). or ct rmver ilename or ct rmver ilename///main/22 or remove specifed version on main branch: ct rmver -1orce -?label -ver /main/22 ile-or-element-name Remove latest version checked in of the fle from Clearcase. Second example removes version 22 from the Clearcase change management system. Previous versions will be available from the archive. ct rm ilename Remove fle from Clearcase view. First perform a checkout ("ct co") of the fle and directory. Past versions will be available from the archive although not visible in current view. Safer than "ct rmelem" which removes all knowledge of the fle old and new. ct reserve ile-name Lock fle. Convert unreserved checkout to reserved. ct unco ile-name ct unco -rm ile-name ct uncheckout ile-name UN-Check-Out fle. Cancel a checkout of a fle. Cancel a checkout of a fle and remove fle which was checked out. Not removed from Clearcase, just view private the checked out fle is deleted/cleaned up. ct co -unr -nc ile-name Checkout fle even though fle is checked out by another. Checkout "unreserved", must be merged at a later time. ct checkout -unreserve$ ile-name Not locked. Checkout to read, print, etc. Same as above command. ct ci ile-name Check-In fle. (also ct checkin ile- name) Enter comment,enter "." as sole character on line and enter. ct $i11 -%ra -!re ile-name : Graphical Dif/Merge tool. ct $i11 -!re$ ile-name ct ?$i11 -!re$ ile-name Clearcase dif between current fle and predecessor. X-windows dif with predecessor. ct mv ile-name_A ile-name_B Rename a fle. Be sure to checkout the parent directory frst. If moving fle to a new directory, check out the target directory as well. ct !rotect -r -chmo$ @@A directory- or-ile-name Set directory/fle/element protection. Confgspec commands ct catcs ct catcs -ta% view_tag Print rules of current view (confgspec): element * *HE*BE6O4. element * /main/+,.E). Look at the confgspec associated with another view. ct e$cs Edit current rules of view (confg spec): Change from: element * *HE*BE6O4. element * /main/+,.E). To: element * Build-&abel element -$irector' * /main/+atest Close vi: wq )et con1i% s!ec 1or view =username_view=C 8'es9 ct setcs -$e1ault ct setcs -cur Reset to default view rules. Re-evaluate current confgspec. ct u!$ate -a$$"loa$rules Updates elemets in snapshot view. GUI tool. Reevaluates confg spec and reselects VOB elements to show. The option "-add_loadrules" allows you to load rules to your confg spec and load elements which satisfy the rules. Help and Information commands ct man clearcase-command ct man env"ccase Man page for Clearcase command. List Clearcase environment variables. ct a!ro!os search-word List commands and man page summaries for related Clearcase command. ct hel! ct hel! clearcase-command Help facility (simple). Lists possible command arguments. Tree/Branch commands ct lst'!e -kin$ brt'!e ct lst'!e -kin$ brt'!e -invob /vob/vob-name List all branches. List all branches in the vob specifed. ct 1in$ -avobs -version 'brt'!e2branch-type7' -!rint Find all fles of the specifed branch name in all mounted VOB's. Find branch name with the ct lst'!e command.. ct lsvtree -all * ct lsvtree ile-name ct lsvtree -% ile-name List version trees (labels and branches) of fles (even those without labels or branches). List all branches of specifed fle. Launch GUI display and show version tree (labels and branches) for a given fle. ([Potential Pitfall]: You may have to issue the command e?!ort +,DE=* prior to launching GUI.) ct cht'!e Change element type or rename branch. ct mkbranch ct mkbranch -nc branch-name ile-to- branch!cpp Create a new branch in version tree. Use the command mkbrt'!e to create the branch type (name) frst. This command also checks out the fle. The confg spec needs to include this branch so fle can be viewed. ct rmbranch Remove a branch in version tree. ct mkbrt'!e mkbrt'!e -c =*omment %oes here=branch_name Create a new branch type object. ct mer%e Merge changes/diferences of a fle from another branch. ct 1in$mer%e ct 1in$mer%e ./ -1la% V,E)--A. - !rint Determines whether a merge is required for a fle in your view. Find fles in current directory tree which need to be merged. Use the $escribe command to see if branch has been merged. If so it wil be stated as such. Derived Objects commands ct ls$o -l List derived objects. ct rm$o Remove a derived object. ct winkin *.o *.a e"ecutables Wink-in a derived object. Admin commands cleare?!ort"11ile -r directory-name Create fle cvt_data which is the result of a recursive export of fles from given directory name.. clearlicense List number of allowable client connections and list who is holding a license. clearlicense -rel user Release license from user who is holding a license. %etcache ct %etcache -mv1s Display Clearcase view or MVFS cache parameters. Troubleshoot by listing cache misses (Cache misses are bad). Perform this command on the server itself. %etlo% Examine Clearcase log fles. hostin1o Display confguration data for a Clearcase host. lock o ct lock vob(/vob/!ro0ect o ct lock -brt'!e -obsoletebranch-type o ct lock lbt'!e(&ABE&_NAME o ct lock ile-name!cpp o ct lock -nusers userF user2 brt'!e(branchG Command to lock a VOB, element, branch, type object or storage pool. o Lock vob for read-only access.Disable write, create, delete, modify o Hide branch permanently. o Lock code with given label. o Lock a fle from use. o Lock all users except user1 and user2 on branchX unlock ct unlock -brt'!e branch-type Unlock a VOB object. lslock List locks. lsclients List client list for lisence or registry host server. lsre!lica List replicas of a VOB. mk!ool Create or modify VOB storage pool. rm!ool Remove a storage pool from a VOB. ls!ool List storage pools. ch!ool Change the storage pool to which an element is assigned. mkre%ion Register a new Clearcase network region. rmre%ion Unregister a Clearcase network region. lsre%ion List Clearcase network region. mktri%%er Attach a trigger to an element. rmtri%%er Remove trigger from an element. mktrt'!e Create a trigger object. mkvob ct mkvob -ta% VOB-tag -c =comment= /vobpath Create and register a versioned object base. rmvob ct rmvob /vobpath Remove a VOB. lsvob List of mounted VOBs. checkvob Fix inconsistancies between VOB database and storage pools. !rotectvob Change owner or group of a VOB. re1ormatvob Update the format of a VOB. Use command "ct -ver" to fnd the current VOB database schema version. rmta% Remove a VOB tag from a storage registry. com!lete"mi%ration Take VOB out of migration mode. mount ct mount VOB-tag Activate a VOB. unmount ct umount VOB-tag Deactivate a VOB. ("ct describe -vob" to show VOB info/owner) re%ister Create an entry in the VOB/view storage registry. unre%ister Remove a VOB/view from storage registry. relocate Move elements and directory trees from one VOB to another. rename Asign a new name to a Clearcase object (i.e. pool, replica, label). Use mv to change the name of a fle or directory. setcache ct setcache -view -host -cachesiHe 02Ik ct setcache -view -site -cachesiHe 2m ct setcache -view -cachesiHe Amview_tag Set Clearcase view or MVFS cache parameters. Set cache size for all views on server to 1024 Kb. Set cache size for all views site-wide to 2 Mb. set cache size for a single specifed view. View with ct lssite -inJuire mv1scache Controls and monitors MVFS caches (dynamic views only). ct lssite -inJuire List site-wide properties in the site confg registry. setsite Sets or unsets site-wide properties in the site confg registry. o View cache size o defaults for Windows clients o defaults for chechin and checkout preserve s!ace Report VOB disk space usage.