Tuesday, 11 October 2022

IBM: Rational ClearCase all cleartool commands

IBM: Rational ClearCase all cleartool commands

Hi Friends 😊, In today's blog we will talk about some important Cleartool commands which are very useful when you are working with IBM rational ClearCase tool.

What is IBM Rational ClearCase?💁💁

IBM Rational ClearCase provides controlled access to software assets, including code, requirements, design documents, models, test plans and test results.

For more details, please visit at- more info about IBM Rational ClearCase tool.

Now Coming on the Cleartool(ct) commands. While dealing with dynamic view in ClearCase tool, you should must aware about some important commands. Here I am going to index out some important ClearCase commands 👇-

Important ClearCase commands
---------------------------------------------------------------------------------------
ct help <command>                       Usage statement for command
ct man <command>                        Manual page for command
---------------------------------------------------------------------------------------
ct lsvob                                List VOBs
ct mount <vob-tag>                      Mount VOB
ct umount <vob-tag>                     Unmount VOB
---------------------------------------------------------------------------------------
ct lsview                               List views
ct startview <view-tag>                 Start view
ct setview <view-tag>                   Set view (UNIX)
ct endview <view-tag>                   Stop view
ct endview -server <view-tag>           Stop view and kill view server process
net use <drive:> \\view\<view-tag>      Map drive to view
net use <drive:> /d                     Disconnect drive from view
---------------------------------------------------------------------------------------
ct lsvtree <pname>                      Version tree browser
ct lsvtree -gra <pname>                 Version tree browser (graphical)
---------------------------------------------------------------------------------------

ct pwd                                  Print working directory
ct pwv                                  Print working view
ct ls                                   List contents of directory with ClearCase info
ct ls -view                             List only private files in directory
ct ls -vob                              List only vob elements in directory
----------------------------------------------------------------------------------------
ct lsprivate                            List private files in the view
ct lsco [-all] [-cview] [-s]            Find checkouts
----------------------------------------------------------------------------------------
ct mkview -tag <view-tag> <stg-dir>                     Create view
ct mkview -tag <view-tag> -stream <stream> <stg-dir>    Create view (UCM)
ct rmview -tag <view-tag>                               Remove view
----------------------------------------------------------------------------------------
ct mkstream <stream>                    Create stream (UCM)
ct lsact                                List activities at current stream (UCM)
ct setact <act-id> | [-none]            Set activities (UCM)
ct mkact -headline <headline>           Create activity (UCM)
ct rmact <act-id>                       Remove activity (UCM)

ct co [-unres] <pname>                  Checkout
ct ci <pname>                           Checkin
ct unco <pname>                         Uncheckout
ct reserve <pname>                      Change unreserved to reserved checkout
ct unreserve <pname>                    Change reserved to unreserved checkout

ct mkelem <pname>                       Make new file element
ct mkdir <pname>                        Make new directory element

ct mv <src-pname> <dest-pname>          Move an element
ct rmname <pname>                       Logical delete of element
ct ln [-s]                              Create link
------------------------------------------------------------------------------------------
<cmd> <pname>                           Operate on version selected by view
<cmd> <pname@@\version-id>              Operate on version given the version-id

ct diff [-gra] [-pred] <pname>          Diff tool
ct merge [-gra]                         Merge
ct findmerge                            Batch merge

ct mklbtype <label-type-name>           Create label type
ct mklabel <label-type-name> <pname>    Attach label
ct lock lbtype:<label-type-name>        Lock label

ct mkbl [-incremental | -full] <baseline-root-name>                Make baseline (UCM)
ct chbl [-level <promotion-level>]                                 Promote baseline (UCM)
ct chstream [-recommended <baseline-selector>] <stream-selector>   Recommend baseline (UCM)

ct rebase -gmerge -recommended          Rebase stream (UCM)
ct rebase -complete                     Complete rebase (UCM)

ct deliver                              Deliver activities (UCM)
ct deliver -complete                    Complete deliver (UCM)
ct deliver -activites <act-selectors>   Deliver specific activities (UCM)

ct setcs -stream                        Synchronize view

ct catcs                                View config spec
ct edcs                                 Edit config spec
ct setcs                                Set config spec

ct find                                 Search/Reporting utility

------------------------------------------------------------------------------------------

ct lsstgloc                             List all storage locations
ct mkstgloc                             Create storage location
ct rmstgloc                             Remove a storage location

ct mkvob -tag <vob-tag> <stg-dir>       Create VOB
ct rmvob <stg-dir>                      Remove VOB
ct describe vob:<vob-tag>               Display owner and group of VOB
ct protectvob                           Change owner and group of VOB

clearfsimport <src-path> <target>       Import files and directory structures
clearexport_*                           Export versioned files from another tool
clearimport                             Import versioned files

ct rmver                                Physically remove a version from VOB
ct rmbranch                             Physically remove an entire branch from VOB
ct rmelem                               Physically remove an entire element from VOB

ct relocate                             Relocate elements from one VOB to another

ct protect [-chown] [-chgrp] [-chmod]   Change element permission, owner, group
ct describe <element-path@@>            Display element permission, owner, group

mvfsstorage                             Display location of data container
ct dump                                 Display location of source and cleartext container

ct getlog                               Display error logs

ct mktrtype                             Create trigger type
ct mktrigger                            Attach/apply trigger
ct rmtrigger                            Remove a single instance of trigger
ct rmtype [-rmall] trtype:<trig-type>   Remove trigger type

ct mkattype <type-name>                 Create attribute type
ct mkattr <attype> <value> <pname>      Attach/apply attribute
ct rmattr                               Remove a single instance of attribute
ct rmtype [-rmall] attype:<att-type>    Remove attribute type

------------------------------------------------------------------------------------------

site_prep                               Prepare the ClearCase release area
setup / install_release                 Install ClearCase on client or server
clearlicense [-hostid]                  Display license information
rgy_passwd                              Set the registry password
ct hostinfo -l                          Display host ClearCase information

net stop albd                           Stop ClearCase services (Windows)
net start albd                          Start ClearCase services (Windows)
/etc/init.d/clearcase stop              Stop ClearCase services (UNIX)
/etc/init.d/clearcase start             Start ClearCase services (UNIX)

ct lsregion                             Display ClearCase regions
ct mkregion -tag <name>                 Create ClearCase region
ct rmregion [-rmall] -tag <name>        Remove ClearCase region

ct register (-vob|-view) <stg-path>     Register a VOB or view
ct unregister (-vob|-view) <stg-path>   Unregister a VOB or view
ct mktag (-vob|-view) -tag <tag> <stg>  Create a VOB or view tag
ct rmtag (-vob|-view) <tag>             Remote a VOB or view tag

rgy_check [-vobs] [-views] [-storage]   Verify registry integrity

ct lock vob:<vob-tag>                   Lock VOB
ct unlock vob:<vob-tag>                 Unlock VOB

ct recoverview -syn -tag <view-tag>     Recover stranded view private files

fix_prot                                Fix protection problems
dbcheck -a -k <vob_db>                  Scan RAIMA db for corruption
ct checkvob [-fix] -pool <vob-stg-dir>  Scan db/storage pools for consistency
..that's all. I tried to cover almost all commands..but still I missed any, please let me know in comment section. 
Thank You !!!!!!! 😉

Monday, 6 June 2022

How to Search a Text in VIM

 

How to Search a Text in VIM

Hello ! friends, So in today's notes we will talk about how we can search a string in VIM or Vi editor. Well! so lets start without wasting the time -
Vim/Vi is a powerful open -source command-line text editor. It is highly configurable with an extensive manual and ships with a wealth of features, including syntax highlighting and color codes, comprehensive plugin support, and search and replace, to mention a few.
Searching text or a string by manually scrolling up and down can be a very tedious task. Fortunately, the vim editor has a faster and convenient way of doing this.

Mode provided by VIM

Basically , Vim provided three main modes  Command mode, Insert mode and Visual mode.

The Command mode :

By default, the Vim editor is first launched in command mode. In this mode, key-presses are inactive, and a user cannot insert text or modify the file. However, you can navigate up and down, left and right, using the following keys:

– Moves up one row. (Equivalent of Arrow up key )

j – Moves down one row. (Equivalent of Arrow down key )

l – Navigates one character to the right or moves forwards. (Equivalent of Arrow right key)

h – Navigates one character to the left or moves backward. (Equivalent of Arrow down key )

You can also prefix the keys with a numeric letter to move up or down a certain number of rows or move forward and backward a certain number of characters. For example,

6k – moves up 6 rows

4j – Moves down 4 rows

The Insert mode :

This mode allows you to type in text and make changes to a text file as you deem fit. The insert mode can be accessed from the command mode by pressing the following keys.

The ‘i’ key ( insert ) allows you to insert a character at the cursor’s current position.

The ‘a’ key ( append ) – This moves the cursor one character to the right and gets you to insert mode.

The ‘o’ key – This creates a new line below the current row and switches to insert mode.

The Visual mode :

The visual mode is usually used to highlight text, similar to clicking and dragging with a mouse. To start making a text selection, simply type ‘v’ then leverage the arrow keys to highlight text.

Perform basic search operation in vim

To search text, you need to be in command mode. If you are in insert mode, simply press the ‘ESC’ key.

To perform a basic search of the string or text that you want, move to the beginning of the file and simply press the forward-slash ( / ) key. Then type the search string and press ENTER on the keyboard to start searching.

The forward-slash ( / ) key performs a forward search. It searches for the string or pattern from the current cursor position right up to the end of the file. To search for the next pattern, simply press the letter n on the keyboard.

To search backward, press the question mark symbol ( ? ), type the search string, and press ENTER on the keyboard. This searches the string from the current cursor position to the start of the file.

Search a complete word

To search for a complete word, begin by pressing the / or? Symbol. After that, type the \< symbol to mark the beginning of the word to be searched then /> to signify the end of the search word. Then finally, hit ENTER to commence the search.