Posted: . At: 2:42 PM. This was 7 years ago. Post ID: 10201
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Very useful Linux tips and tricks for the Linux desktop user.


  1. How to make the Xterm font larger.
  2. Using the .inputrc file to control keybindings in xterm.
  3. Enabling color ls output.
  4. Viewing files with the command-line.

How to make the Xterm font larger.

To make the Xterm font larger, hold the left Ctrl key down and right-click on the xterm window to bring up a menu that allows the user to select a larger font size.

Selecting a larger font size in Xterm with the menu.
Selecting a larger font size in Xterm with the menu.

Using the .inputrc file to control keybindings in xterm.

If you wish to control the key bindings for Backspace, Delete, Home & the End keys in Xterm then read on.

The ~/.inputrc file in your home directory controls this behavior, using the defines in this file you may control the key bindings and make using the BASH shell easier.

$if term=linux
 "\e[1~": beginning-of-line
 "\e[4~": end-of-line
 "\e[3~": delete-char
$else
 "\e[H": beginning-of-line
 "\e[F": end-of-line
 "\C-?": delete-char
$end

The TERM environment variable determines whether the Linux console or the Xterm terminal emulator is affected by this definition. If the Xterm does not use the Backspace key as backspace, then you may enter this into your ~/.bashrc file to configure this: stty erase ^H.

Enabling color ls output.

Using a simple alias, you may enable color directory listing output with ls. This directory listing also enables a human-readable listing of file-sizes with the -h option.

alias ls='ls -hula --color=auto'

The .dircolors file that resides in your home directory controls the colors that are used to represent various files displayed in the directory listing.

Viewing files with the command-line.

To view a text file and scroll through the text file easily, then the less command will help.

cat myfile.txt | less

Many different ways to switch to the root user in Linux with the command line.

http://securitronlinux.com/bejiitaswrath/many-different-ways-to-switch-to-the-root-user-in-linux-with-the-terminal/.

Count the number of files in a directory.

Johns-MacBook-Air:Documents jason$ ls -hul | wc -l
      25

Find all files that have the jpg extension.

Johns-MacBook-Air:Documents jason$ find . -name "*.jpg"
./1514877771595.jpg
./93bffab7a44bc518799a2a68711ad790.jpg
./co60_AW_Invade_Annex_2_85C.Altis/images/heli.jpg
./co60_AW_Invade_Annex_2_85C.Altis/images/humvee.jpg
./co60_AW_Invade_Annex_2_85C.Altis/images/leaflet.jpg
./co60_AW_Invade_Annex_2_85C.Altis/images/mood1_1.jpg
./co60_AW_Invade_Annex_2_85C.Altis/images/multicam.jpg
./co60_AW_Invade_Annex_2_85C.Altis/images/sni.jpg
./co60_AW_Invade_Annex_2_85C.Altis/images/stryker.jpg
./co60_AW_Invade_Annex_2_85C.Altis/images/tacops.jpg
./co60_AW_Invade_Annex_2_85C.Altis/signs/Rules.jpg
./dutton-victoria.jpg

Count the files that are jpeg.

Johns-MacBook-Air:Documents jason$ find . -name "*.jpg" | wc -l
      12

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.