LinuxCommandLibrary

bw

Manage Bitwarden password vault

TLDR

Log in to a Bitwarden user account

$ bw login
copy

Log out of a Bitwarden user account
$ bw logout
copy

Search and display items from Bitwarden vault
$ bw list items --search [github]
copy

Display a particular item from Bitwarden vault
$ bw get item [github]
copy

Create a folder in Bitwarden vault
$ [echo -n '{"name":"My Folder1"}' | base64] | bw create folder
copy

SYNOPSIS

bw [width]

PARAMETERS

width
    An integer representing the desired terminal width in characters. If omitted, the command typically reports the current width.

DESCRIPTION

The `bw` command (often an alias or shell function, not a standard utility) is used to set or report the terminal width. Typically, it interacts with the `COLUMNS` environment variable. When used without arguments, it usually reports the current terminal width. When used with a numeric argument, it sets the `COLUMNS` environment variable to that value, thus influencing the behavior of applications like `ls`, `man`, and other programs that dynamically format output to fit the terminal.

This command is crucial for ensuring that text-based applications display their output correctly within the boundaries of your terminal window. If your terminal window size changes, running `bw` with the new width value can resolve formatting issues, particularly when dealing with tools that cache terminal dimensions.

CAVEATS

The `bw` command is not a standard Unix utility. It's often a custom alias or shell function defined in a user's shell configuration file (e.g., `.bashrc`, `.zshrc`). Therefore, its behavior can vary depending on how it's implemented.

The effect of changing the `COLUMNS` variable might not be immediate for all applications. Some applications cache the terminal width when they start, so you might need to restart them to see the changes.

IMPLEMENTATION EXAMPLES

Here are a few possible implementations of the `bw` command (as shell functions):

Bash/Zsh:

bw() {
if [ $# -eq 0 ]; then
echo "$COLUMNS"
else
COLUMNS=$1
export COLUMNS
fi
}


Alternative Bash/Zsh (using stty):

bw() {
if [ $# -eq 0 ]; then
stty size | awk '{print $2}'
else
stty cols $1
fi
}

SEE ALSO

tput(1), stty(1)

Copied to clipboard