| Both sides previous revision Previous revision Next revision | Previous revision |
| rdms:access:linux:icommands [2026/07/13 11:48] – burcu | rdms:access:linux:icommands [2026/11/15 19:56] (current) – [iCommands] admin |
|---|
| * ''iCommands'' consist of a whole set of different commands that allow interaction with the RDMS from the CLI. Next to [[https://docs.irods.org/4.3.0/icommands/user/|commands relevant to general users]] (navigation, data transfer, etc.), it has [[https://docs.irods.org/4.3.0/icommands/metadata/|commands specifically for metadata]], and [[https://docs.irods.org/4.3.0/icommands/groupadmin/|commands for management of groups]]. | * ''iCommands'' consist of a whole set of different commands that allow interaction with the RDMS from the CLI. Next to [[https://docs.irods.org/4.3.0/icommands/user/|commands relevant to general users]] (navigation, data transfer, etc.), it has [[https://docs.irods.org/4.3.0/icommands/metadata/|commands specifically for metadata]], and [[https://docs.irods.org/4.3.0/icommands/groupadmin/|commands for management of groups]]. |
| * ''iCommands'' are already installed on the LWP and Habrók HPC cluster. In these environments, you just need to: | * ''iCommands'' are already installed on the LWP and Habrók HPC cluster. In these environments, you just need to: |
| - Create a ''~\.irods'' directory in your home directory. | - Create a ''~/.irods'' directory in your home directory. |
| - Create an ''irods_environment.json'' file in that directory. | - Create an ''irods_environment.json'' file in that directory. |
| * For other Linux distributions, instructions to install ''iCommands'' are also explained in this section. | * For other Linux distributions, instructions to install ''iCommands'' are also explained in this section. |
| |
| ==== Switching Between Different Zones ==== | ==== Switching Between Different Zones ==== |
| If you have access to more than one iRODS zone, you can configure shell aliases to quickly switch between different iRODS environment files. | If you have access to more than one iRODS zone, such as the default zone and Sensitive Data (SD) zone, you can configure shell aliases to quickly switch between different iRODS environment files. |
| |
| 1. Open your ''~/.bashrc'' file in a text editor. | 1. Open your ''~/.bashrc'' file in a text editor. |
| ienv | ienv |
| </code> | </code> |
| The selected alias sets the `IRODS_ENVIRONMENT_FILE` environment variable to the corresponding iRODS environment file. Any subsequent iCommands will use that environment until you switch to another one or open a new terminal session. | The selected alias sets the ''IRODS_ENVIRONMENT_FILE'' environment variable to the corresponding iRODS environment file. Any subsequent iCommands will use that environment until you switch to another one or open a new terminal session. |
| |
| ===== Installing iCommands ===== | ===== Installing iCommands ===== |
| </hidden>\\ | </hidden>\\ |
| |
| **(Un)bundling**\\ | **Bundling**\\ |
| The ''ibun'' command allows bundling directories or extracting bundled directories within the RDMS. Without specifying additional flags, tar bundles will be created when bundling a directory, but it is also possible to specify other types (available are: tar, gzip, bzip2, and zip). | The ''ibun'' command allows bundling directories directly within the RDMS. Without specifying additional flags, tar bundles will be created when bundling a directory, but it is also possible to specify other types (available are: tar, gzip, bzip2, and zip). |
| |
| |
| </code> | </code> |
| </hidden>\\ | </hidden>\\ |
| The additional ''-x'' flag is used to indicate extraction. Additionally, you have to specify which bundle you want to extract, as well as specify an RDMS directory to which the content of the bundle is extracted. | |
| <hidden> | |
| <code> | |
| # Extract tar archive | |
| $ ibun -x bundled_folder.tar unbundled_tar | |
| |
| # Extract gzip archive | |
| $ ibun -x bundled_folder.gz unbundled_gzip | |
| |
| # Extract bzip2 archive | |
| $ ibun -x bundled_folder.bz2 unbundled_bzip2 | |
| |
| # Extract zip archive | |
| $ ibun -x bundled_folder.zip unbundled_zip | |
| </code> | |
| </hidden>\\ | |
| **Notes:** | **Notes:** |
| * The bundling and extraction operations do not display progress. For large folders/archives, it might take a longer time to finish, while your terminal seems to be stuck. | * The unbundling functionality of ''ibun -x'' has been **disabled** due to a security issue. |
| | * The bundling operations do not display progress. For large folders/archives, it might take longer time to finish, while your terminal seems to be stuck. |
| * If you want to overwrite, you can again use the additional ''-f'' flag. | * If you want to overwrite, you can again use the additional ''-f'' flag. |
| * Notes that extraction via ''ibun -x'' will fail if your archive contains symlinks, as they are not supported by ''ibun'' (also see info in the [[rdms:bestpractices|Best Practices]] section). | |
| |
| **Assigning Data Permission**\\ | **Assigning Data Permission**\\ |
| The ''iCommands'' can also be used to add metadata to a file/folder, list already existing metadata, modify existing metadata, and also query (search) for objects that contain certain metadata. | The ''iCommands'' can also be used to add metadata to a file/folder, list already existing metadata, modify existing metadata, and also query (search) for objects that contain certain metadata. |
| |
| Within the RDMS, metadata is always added as so-called 'attribute-value-units' triples, AVUs. The 'attribute' specifies the metadata key (e.g., 'Author') while the 'value' specifies the corresponding value for this key (e.g., 'John Doe'). The 'unit' entry is optional, but can be useful in cases where the entries could be otherwise ambiguous (e.g., A: 'Distance:, V: '100', U: 'km'). This can be left blank if no unit is desired. | Within the RDMS, metadata is always added as so-called 'attribute-value-units' triples, AVUs. The 'attribute' specifies the metadata key (e.g., 'Author') while the 'value' specifies the corresponding value for this key (e.g., 'John Doe'). The 'unit' entry is optional, but can be useful in cases where the entries could be otherwise ambiguous (e.g., A: 'Distance ', V: '100', U: 'km'). This can be left blank if no unit is desired. |
| |
| The command that is used to work with metadata from the CLI is the ''imeta'' command, which has additional subcommands depending on the desired operation : | The command that is used to work with metadata from the CLI is the ''imeta'' command, which has additional subcommands depending on the desired operation : |
| **Notes:** | **Notes:** |
| * The ''imeta'' command requires that you also specify the additional ''-C'' or ''-d'' flag. | * The ''imeta'' command requires that you also specify the additional ''-C'' or ''-d'' flag. |
| * Use ''-C'' if you want to work with a folder (collection). For example ''imeta ls -C <foldername>''. | * Use ''-C'' if you want to work with a folder (collection). For example, ''imeta ls -C <foldername>''. |
| * Use ''-d'' if you want to work with a file (data object). For example ''imeta ls -d <filename>''. | * Use ''-d'' if you want to work with a file (data object). For example, ''imeta ls -d <filename>''. |
| * There are additional help pages available for the different ''imeta'' subcommands, which can be displayed by executing ''imeta help <subcommand>''. For example: ''imeta help qu'' to display more information about the query (search) command. | * There are additional help pages available for the different ''imeta'' subcommands, which can be displayed by executing ''imeta help <subcommand>''. For example: ''imeta help qu'' to display more information about the query (search) command. |
| |
| | ''iput [-K, -r, -P, -T, -X]'' | Upload data to the RDMS\\ ''-K'': Calculate and verify checksum\\ ''-r'': Upload whole folder structure (recursive)\\ ''-P'': Display progress during transfer\\ ''-T'': Renew socket connection (long transfers)\\ ''-X'': Specify restart file (long transfers) | | | | ''iput [-K, -r, -P, -T, -X]'' | Upload data to the RDMS\\ ''-K'': Calculate and verify checksum\\ ''-r'': Upload whole folder structure (recursive)\\ ''-P'': Display progress during transfer\\ ''-T'': Renew socket connection (long transfers)\\ ''-X'': Specify restart file (long transfers) | | |
| | ''irsync [-K]'' | Synchronize data between RDMS and local | | | ''irsync [-K]'' | Synchronize data between RDMS and local | |
| | ''ibun [-x, -c, -D]'' | (Un)bundle data in the RDMS | | | ''ibun [-c, -D]'' | (Un)bundle data in the RDMS | |
| | ''iuserinfo <user>'' | Display information (name, groups, etc) of a user, displays information about yourself if no user is specified | | | ''iuserinfo <user>'' | Display information (name, groups, etc) of a user, displays information about yourself if no user is specified | |
| | ''iquest'' | Execute complex queries using metadata | | | ''iquest'' | Execute complex queries using metadata | |