KC7MM Wiki

Amateur Radio with KC7MM

User Tools

Site Tools


Making the command line work for you

Topic for October 1, 2018 (KC7MM, NCS)

  • Working at the command line is a scare item that anti-Linux trolls trot out to make Linux sound hard to use.
  • Of course, we who use Linux know that pretty much everything on a Linux system can be done through a GUI, but also are aware that certain things are easier to do in a shell.
  • In fact, once we come to understand how useful the command line can be, we tend to use it a lot.
  • In my case, the first thing I do when the desktop appears at boot-up is to open a shell and run the script that connects to my VPN. I leave it open for the rest of the session, so its there whenever needed. I also have set up a keyboard shortcut (in Cinnamon), so that Super-F9 pops up a terminal whenever I need one.

How one works in a terminal is a matter of personal preference. Tonight I’ll talk about some ways to customize the terminal that can make it work the way we like it to. I’ll also open it up for you all to tell us about customizations that you use and find useful.

Which terminal to use

  • X terminal, comes with desktop, or custom
  • Default shell, if not using X
  • Shell at Ctl+Alt+[F1..F6] from X desktop. Are outside of X session.
  • Install your terminal of choice

Customize the shell

Using alias for shortcuts

Link: 10 handy bash aliases (opensource.com)

  • Includes one for Python -m SimpleHTTPServer <port>. I use that often.
  • Automate by putting in ~/.bashrc or~/.bash_profile.

Customize the prompt

Set the prompt to display the information you want.

Link: How to customize your Ubuntu Terminal prompt

  • Automate by putting in ~/.bashrc or~/.bash_profile

Finding files

Using the find utility

  • Basic use of find to locate files.
  • find vs. locate: locate uses a database, is fast but not necessarily current. find searches from scratch, is very flexible, e.g., can search by date and time.
  • Basic usage: find <start directory> -iname <regex>

Link: Tutorial

lun-topic_optimize_shell.txt · Last modified: 2018/10/03 01:50 by KC7MM