MORE PRODUCTIVE USE OF LINUX COMMAND LINE
Naming of Files and Folders
Do not name your files and folders in Linux platform using special symbols like blank space, brackets, /, \, $, *, ~, !, :, &, etc. When naming a file or folder with multiple words and numbers, use dash (-), underline (_), plus (+), equal sign (=) and dot (.) as divider or connector.
Here are some examples of suitable naming convention:
• Inpute_size=10.50m_time=8.5sec.txt
• PANI4_+dp_solv-Na.gjf
• 1_Ligand_bound_MD__9_3A9E_atRA_F286X
The following names are not recommended as they are not friendly to manipulate in Linux environment:
• Program 1: Air Quality in CBD.dat
• Human_Heart (Left Ventricle).jpg
Model-Size=100m*20m & Time=10mins.prj
Use of Tab key
You can press the “Tab” key on the keyboard to prompt for the matching command and filename when you type in the command line prompt. Hence, you do not have to go through the trouble of typing out the whole word.
For example, to launch Abaqus software you need to enter command “abaqus”; however, you can also do the following:
• Type “aba” only and press “Tab” key on the keyboard once:
# aba <Tab>
• The full command “abaqus” is prompted in the command line:
# abaqus
• Continue to press “Tab” key twice. Other commands matching “abaqus*” will be prompted. In this case, it lists out the commands for the older versions.
# abaqus < Tab> < Tab> # abaqus abaqus abaqus613 abaqus614
Here is another example. Suppose you have two job submission script files named “case1_Reynolds=100_Cycles=5.sh” and “case2_Reynolds=500_Cycles=5.sh”. You can submit the job for case1 easily using “Tab” key as below. It saves you time typing the full script and help you avoid keying in the wrong keystroke that may happen in typing a long filename.
# bsub < case1 < Tab> # bsub < case1_Reynolds=100_Cycles=5.sh <Enter>
Command history
Sometimes, you may wish to re-run a command that you just entered in the command line prompt a few steps back. If the command is short, you probably do not mind retyping it; however, it will be tedious to re-type a complex long command. Here is a time saving tip: press the up-arrow-key in the keyboard to recall that complex command. You can also scroll among the command history, using the up-arrow-key and down-arrow-key, to search for the right command to re-run. Once the command is searched, press enter to proceed.
Copy and paste
Command line window opened via Xterm/SSH/Putty responds to mouse clicks. You can use mouse clicks to copy-and-paste on the window to save time typing keystrokes.
• Mouse click for Copy:
double-left-click on the filename/string on the screen; or press and drag left-button to highlight text on the screen
• Mouse click for Paste:
middle-click on Xterm/SSH window; right-click on Putty window
REMINDER
The wheel-mouse’s wheel functions as middle-button.