Boost Your Linux Productivity with 4 Powerful Command‑Line Tricks
This guide presents four practical Linux techniques—including the bd shortcut for fast directory jumps, Terminator for multi‑pane terminals, Typora for seamless Markdown editing, and a compact Vim configuration—plus custom shell commands, providing clear commands, scripts, and shortcuts to streamline everyday development workflows.
Directory Navigation
bd script
The bd utility jumps to the nearest parent directory matching a given name, avoiding long cd ../../.. sequences. Install it system‑wide and enable an alias for interactive use:
sudo wget --no-check-certificate -O /usr/bin/bd https://raw.githubusercontent.com/vigneshwaranr/bd/master/bd
sudo chmod +rx /usr/bin/bd
echo 'alias bd=". bd -si"' >> ~/.bashrc
source ~/.bashrcUse bd python or a prefix such as bd p to move to the nearest matching directory. Replace -si with -s in the alias for case‑sensitive matching.
https://github.com/vigneshwaranr/bd
cd shortcuts
Common built‑in shortcuts:
cd # go to $HOME
cd ~
cd - # return to previous directoryCustom alias for frequent paths
Create a permanent shortcut, e.g. cl, to jump to a frequently used directory:
echo 'alias cl="cd /home/radia/work/linux/linux-3.16.6/"' >> ~/.bashrc
source ~/.bashrcMulti‑terminal operation with Terminator
Terminator splits a terminal window into multiple panes, reducing mouse usage. sudo apt-get install terminator Typical key bindings (customizable): CTRL+SHIFT+T – new tab CTRL+SHIFT+E – vertical split CTRL+SHIFT+O – horizontal split ALT+←↑↓→ – move focus between panes CTRL+PAGEUP / PAGEDOWN – switch tabs
File editing tools
Typora (Markdown editor)
Install Typora on Ubuntu‑based systems:
wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -
sudo add-apt-repository 'deb https://typora.io/linux ./'
sudo apt-get update
sudo apt-get install typoraVim with pre‑packed configuration
Install Vim and unpack a ready‑made configuration archive:
sudo apt-get install vim
# Assuming vim-config.tar is obtained from the author
tar -xvf vim-config.tar -C ~/
source ~/.vimrcKey features provided by the configuration:
File explorer toggle – F3 Function list toggle – F9 Pane navigation – CTRL+W h/j/k/l Jump to definition – generate tags with ctags -R * (or limit languages, e.g. ctags --languages=c,c++,java -R) and use CTRL+] to jump, CTRL+T to return.
ctags -R *
# or
ctags --languages=c,c++,java -RCustom shell commands
cl alias
Define a shortcut to a specific directory (replace the path with your own):
echo 'alias cl="cd /home/radia/work/linux/linux-3.16.6/"' >> ~/.bashrc
source ~/.bashrcenv_switch script
A sample script to toggle groups of applications for different work scenarios. Save the following as env_switch.sh (adjust the echo statements to actual start/stop commands), make it executable, and source it from ~/.bashrc:
#!/bin/bash
function env_switch() {
if [ "$1" = "A" ]; then
echo "A1,A2,A3"
if [ "$2" = "start" ]; then
echo "will be opened"
elif [ "$2" = "stop" ]; then
echo "will be closed"
fi
elif [ "$1" = "B" ]; then
echo "B1,B2,B3"
if [ "$2" = "start" ]; then
echo "will be opened"
elif [ "$2" = "stop" ]; then
echo "will be closed"
fi
fi
} chmod +x env_switch.sh
echo 'source ~/env_switch.sh' >> ~/.bashrc
source ~/.bashrcbd script reminder
The bd utility is a compact Bash script (~50 lines) that can be extended or customized to fit personal workflows, illustrating how small scripts can significantly improve efficiency.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
