Boost Your Linux Productivity with 4 Powerful Command-Line Tricks
Learn four practical Linux techniques—including the bd shortcut for fast directory navigation, multi‑window management with Terminator, Vim configuration tips, and custom shell commands—to streamline your workflow, enhance terminal efficiency, and create a personalized, high‑productivity development environment.
Directory navigation
bd command
The bd script jumps directly to a parent directory that matches a given name, avoiding long cd ../../.. sequences. After installing the script you can type: bd python to move from /home/radia/work/python/tkinter/one/two to the python directory, or use a prefix such as bd p to match the nearest directory starting with the given letters.
Installation (Ubuntu example):
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 ~/.bashrcReplace -si with -s in the alias for case‑sensitive matching.
https://github.com/vigneshwaranr/bd
cd shortcuts
cdor cd ~ – return to the home directory. cd - – go back to the previous directory.
Custom alias for frequent directories
Create a shortcut, e.g. cl, to jump to a commonly used path:
echo 'alias cl="cd /home/radia/work/linux/linux-3.16.6/"' >> ~/.bashrc
source ~/.bashrcMulti‑terminal operations with Terminator
Install Terminator to split the terminal window into multiple panes: sudo apt-get install terminator Typical pane layout:
Bottom‑left pane – real‑time serial logs.
Top‑left pane – compilation output.
Right pane – file editing.
Key bindings (default):
Resize panes – Ctrl+Shift+←/→/↑/↓ Open new tab – Ctrl+Shift+T Switch panes within a tab – Alt+←/→/↑/↓ Switch tabs – Ctrl+PageUp/PageDown These shortcuts can be remapped to personal preferences.
File editing
Typora (Markdown editor)
Install Typora on Ubuntu:
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
Install Vim: sudo apt-get install vim A pre‑packed Vim configuration (including plugins) is available as a tar archive. Download, extract, and place it in the home directory: tar -xvf vim-config.tar -C ~ The configuration enables mouse support, file and tag navigation, and split‑window management. To disable mouse support, comment out set mouse=a in ~/.vimrc.
Generate a tags file for fast navigation with ctags: ctags -R * After the tags file is created, jump to a definition with Ctrl+] and return with Ctrl+T.
Custom shell commands
Implementing the cl alias
Add the alias to ~/.bashrc (replace the path with your own):
echo 'alias cl="cd /home/radia/work/linux/linux-3.16.6/"' >> ~/.bashrc
source ~/.bashrcenv_switch script
Save the following script as env_switch.sh in any directory, make it executable, and source it from ~/.bashrc to switch between predefined work environments:
#!/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
}Make it executable: chmod +x env_switch.sh Source it automatically for every new terminal:
echo 'source /home/radia/cmd/env_switch.sh' >> ~/.bashrc
source ~/.bashrcConclusion
Using the bd utility, cd shortcuts, custom aliases, Terminator pane management, a lightweight Markdown editor, a ready‑made Vim configuration, and small shell scripts such as cl and env_switch can significantly streamline a Linux development workflow.
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.
