All Tips


3

Tip #564   Remove columns from text

'colrm' is a column removal filter.

If only one parameter is specified, the characters of each line will be removed starting from that specified column number, if called with two parameters (range of character position to remove) the columns/characters from character position x to character position y will be removed.

Some examples:

Read more »

3

Tip #562   Version all unversioned files in an SVN checkout

Sometimes, you want to add a lot of files to SVN from the command line. This simple command will find all unversioned files in an SVN checkout and adds them to SVN versioning.

Read more »

8

Tip #558   Being selfish - Kick all users except you

Kick all users other than you from your box and keep them out.

Read more »

2

Tip #557   Randomize lines in a file

The bash shell has a variable called $RANDOM, which outputs a pseudo-random number every time you call it. This allows you to randomize the lines in a file for example:

Read more »

2

Tip #554   Get your machines IP adress

You sometimes need your machines IP adress without relying on external sources; so here is the command to return your IP adress in one neat line.

Read more »

8

Tip #553   Remove duplicate files

The script below will find duplicate files (files with the same md5sum) in a specified directory and output a new shell script containing commented-out rm statements for deleting them. You can then edit this output to decide which to keep.

Read more »

9

Tip #552   Using ssh as a generic stdin consumer and stdout producer

Many people use netcat on both the remote and local machine in order to transfer stdin and stdout to and from machines over the network, but many don't realize you can do the exact same thing using one line with SSH:

Read more »

20

Tip #551   My code is compiling

Simulate a never-ending compilation so you have an excuse for why you're browsing the net (see http://xkcd.com/303/):

Read more »

10

Tip #550   Go up n directory levels

You often see people using aliases like "alias ..='cd ..'" and "alias ...='cd ../..'". Here is a general version of this kind of '..' command, which takes an argument for how many levels up to go.

Read more »
  • TAGS:
  • cd

4

Tip #549   Splitting arguments with read

The 'read' command can be used to split arguments based on any arbitrary character using IFS:

Read more »