Showing posts with label cli. Show all posts
Showing posts with label cli. Show all posts

Thursday, January 19, 2012

XTerm CLI colour change

So today I was running a relatively fresh install of Slackware in using virtualbox on Linux Mint and I wanted to change the background colour of my xterm from white to black, making it easier on the eyes to read. So I Googled configure xterm background colour. One of the first links was this site. Here was the solution:

For all [xa]term, put something like the following in your
~/.Xdefaults or ~/.Xresources:

! Defaults for all xterm clients
XTerm*background: yellow
XTerm*foreground: darkblue
XTerm*highlightColor: red

Then run

xrdb ~/.Xresources

"man xrdb" and "man X" and search for "Resources" for more
information.

Wednesday, July 20, 2011

How to search for files using the Linux CLI

I navigated to the directory that I knew the files with the text I wanted to search was and I entered this command:

$ grep -r fizz *


The following command returned more results because it ignored case distinctions:

$ grep -ri buzz *

Tuesday, May 24, 2011

cfdisk

Wow: Whilist tinkering with Slackware for the first time in ages, I came across a little CLI app called cfdisk which is a far superior tool for playing around with partitions when compared with its fdisk cousin. Check it.

Wednesday, September 10, 2008

Note To Self: Linux CLI Commands

On Digg today, there's an article with 743 diggs that reads: Explained: 9 useful Linux commands everyone should use! Of all the commands mentioned, this is the only command that I didn't know:
$ free


At the end of that Digged article, there were links to the Ubuntu Community Documentation for the Terminal, which introduces new users to the command line, and a Unix commandline cheat sheet.

The following commands are new to me and will serve me well in the future:

ctrl+a or Home

Moves the cursor to the start of a line.

ctrl+e or End

Moves the cursor to the end of a line.

ctrl+b

Moves to the beginning of the previous or current word.

ctrl+k

Deletes from the current cursor position to the end of the line.

ctrl+u

Deletes the whole of the current line.

ctrl+w

Deletes the word before the cursor.



This one is worth a million dollars:

ctrl+r

Searches for commands you've already typed. When you have entered a very long, complex command and need to repeat it, using this key combination and then typing a portion of the command will search through your command history. When you find it, simply press Enter.

There are so many times when I scroll up looking of a command I used days ago that I used, but can't recall the full syntax. ctrl + r should remdy this problem. Here is another guide to Bash which clarifies how to use the CTRL + R feature:

1. Easily recall previous commands
Bash keeps track of the commands you execute in a history buffer, and allows you to recall previous commands by cycling through them with the Up and Down cursor keys. For even faster recall, "speed search" previously-executed commands by typing the first few letters of the command followed by the key combination Ctrl-R; bash will then scan the command history for matching commands and display them on the console. Type Ctrl-R repeatedly to cycle through the entire list of matching commands.