Useful command lines in Ubuntu that help using terminals

My favorite terminal application

Terminator allows you to open multiple terminals in one window, which can boost your productivity by operating two or more shells side by side or in grids.

It can be installed to Ubuntu by running the following code:

sudo apt-get install terminator

Shortcut keys:

Action Shortcut
Split horizontally Shift + Ctrl + O
Split Vertically Shift + Ctrl + E
Focus on above terminal Alt + UP
Focus on terminal below Alt + Down
Focus on left terminal Alt + Left
Focus on right terminal Alt + Right
Create a new Tab Shift + Ctrl + T
Switch to previous Tab Ctrl + PageUp
Switch to next Tab Ctrl + PageDown
Create a new Window Shift + Ctrl + I
Focus on next window Alt + TAB
Close window Shift + Ctrl + Q
Close terminal Shift + Ctrl + W
Increase font size Ctrl + +
Decrease font size Ctrl + -
Restore original font size Ctrl + 0
Resize termainal Shift + Ctrl + Arrow
Toggle Full Screen F11

Useful commands

Show running processes in Linux

  • top
  • ps -A

For more infomation, please find from:

Get root permission for GUI file manager

  • sudo nautilus

Find previous commands

  • history
    Display a list of previous commands

  • !n
    where n is the index of a command displayed by history, e.g. !4

  • Ctrl + R
    Find the historical commands. Suggest a previous command that starts with the chars as you type

Execute a shell script

In Ubuntu, a shell script is a .sh file that contains a series of commands in a Unix shell, similar to a batch (.bat) file in Windows. In a .sh file, it is often typed with #! /bin/bash in the first line to indicate that is a bash script. For example,

#! /bin/bash

echo "System"
uname -o
echo "Memory Usage"
free -m
echo "Local Library Path"
echo $LD_LIBRARY_PATH

Save as test.sh, and then need the file executable, by running the following command in the terminal:

chmod +x test.sh

chmod is a command to change file permission, +x is the argument to set execute permission to the file.

After that, you can ./ in front of the filename to execute the shell file in the terminal, i.e.

./test.sh

Read More:

See Also:

Chris F. Author of this blog, M.Phil.
Loading Disqus Comments...
Please enable JavaScript to view the comments powered by Disqus.