Workspaces/Advanced Features/ws register: Difference between revisions
Jump to navigation
Jump to search
(Created page with "= ws_register - Register Workspace Links = The <tt>ws_register</tt> command creates or updates symbolic links to your workspaces in a directory of your choice. This provides a convenient way to access all your workspaces from a single location. == Syntax == <tt>ws_register [-h] [--version] [-F FILESYSTEM] directory</tt> == Usage == $ ws_register ~/workspaces This will create symbolic links to all your workspaces in the <tt>~/workspaces</tt> directory. The comman...") |
mNo edit summary |
||
| Line 1: | Line 1: | ||
= ws_register - |
= ws_register - Create Workspace Links = |
||
Creates symbolic links to all your workspaces in one convenient directory. |
|||
== |
== Basic Usage == |
||
$ ws_register ~/workspaces # Create links in ~/workspaces |
|||
<tt>ws_register [-h] [--version] [-F FILESYSTEM] directory</tt> |
|||
The command creates subdirectories for each filesystem (e.g., <tt>scratch/</tt>) with links to your workspaces. |
|||
| ⚫ | |||
| ⚫ | |||
$ ws_register ~/workspaces |
|||
This will create symbolic links to all your workspaces in the <tt>~/workspaces</tt> directory. The command creates subdirectories for each filesystem (e.g., <tt>scratch/</tt>) and places workspace links inside them. |
|||
Example: |
|||
$ mkdir -p ~/my_workspaces |
$ mkdir -p ~/my_workspaces |
||
$ ws_register ~/my_workspaces |
$ ws_register ~/my_workspaces |
||
$ ls -l ~/my_workspaces/scratch/ |
$ ls -l ~/my_workspaces/scratch/ |
||
lrwxrwxrwx |
lrwxrwxrwx ... user-myWs -> /work/workspace/scratch/user-myWs-0 |
||
lrwxrwxrwx |
lrwxrwxrwx ... user-project1 -> /work/workspace/scratch/user-project1-0 |
||
'''Note:''' Links |
'''Note:''' Links include the full workspace name (with username prefix). |
||
== Options == |
== Options == |
||
| Line 31: | Line 27: | ||
|- |
|- |
||
|<tt>directory</tt> |
|<tt>directory</tt> |
||
| |
|Target directory for links (required) |
||
|- |
|- |
||
|<tt>-F |
|<tt>-F <filesystem></tt> |
||
| |
|Only create links for workspaces on specific filesystem |
||
|- |
|- |
||
|<tt>-h</tt>, <tt>--help</tt> |
|<tt>-h</tt>, <tt>--help</tt> |
||
|Show help |
|Show help |
||
|- |
|- |
||
|<tt>--version</tt> |
|<tt>--version</tt> |
||
|Show |
|Show version |
||
|} |
|} |
||
== When to |
== When to Use == |
||
* Working with multiple workspaces |
|||
* Need quick access from one location |
|||
| ⚫ | |||
== Automatic Updates == |
|||
* '''Recommended''' if you work with multiple workspaces and want quick access |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
== Example in login script == |
|||
<pre> |
<pre> |
||
| ⚫ | |||
# In ~/.bashrc or ~/.profile |
|||
| ⚫ | |||
if [ -t 0 ] && [ -z "$SSH_ORIGINAL_COMMAND" ] && command -v ws_register >/dev/null 2>&1; then |
if [ -t 0 ] && [ -z "$SSH_ORIGINAL_COMMAND" ] && command -v ws_register >/dev/null 2>&1; then |
||
mkdir -p ~/workspaces >/dev/null |
mkdir -p ~/workspaces 2>/dev/null |
||
ws_register ~/workspaces >/dev/null |
ws_register ~/workspaces 2>/dev/null |
||
fi |
fi |
||
</pre> |
</pre> |
||
For more information: <tt> |
For more information: <tt>ws_register -h</tt> or <tt>man ws_register</tt> |
||
Latest revision as of 16:51, 2 December 2025
ws_register - Create Workspace Links
Creates symbolic links to all your workspaces in one convenient directory.
Basic Usage
$ ws_register ~/workspaces # Create links in ~/workspaces
The command creates subdirectories for each filesystem (e.g., scratch/) with links to your workspaces.
Example
$ mkdir -p ~/my_workspaces $ ws_register ~/my_workspaces $ ls -l ~/my_workspaces/scratch/ lrwxrwxrwx ... user-myWs -> /work/workspace/scratch/user-myWs-0 lrwxrwxrwx ... user-project1 -> /work/workspace/scratch/user-project1-0
Note: Links include the full workspace name (with username prefix).
Options
| Option | Description |
|---|---|
| directory | Target directory for links (required) |
| -F <filesystem> | Only create links for workspaces on specific filesystem |
| -h, --help | Show help |
| --version | Show version |
When to Use
- Working with multiple workspaces
- Need quick access from one location
- Organizing workspaces by project
Automatic Updates
Add to ~/.bashrc to update links automatically at login:
# Only run in interactive shells
if [ -t 0 ] && [ -z "$SSH_ORIGINAL_COMMAND" ] && command -v ws_register >/dev/null 2>&1; then
mkdir -p ~/workspaces 2>/dev/null
ws_register ~/workspaces 2>/dev/null
fi
For more information: ws_register -h or man ws_register