Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, October 19, 2011

Deleting tons of files at once

Okay, suppose you have tons of files you need to delete.. so many that you can't open up the folder, or use ls to delete them in one fell swoop. Suppose further that your files are labeled like, "x_0_0_1_2.dat". Then you can write a loop in you bash terminal as follows:
$ for i in 0 1 2 ; do rm x_${i}_* ; done
The key thing to note here is the curly braces around the iterating variable. If you leave off the braces, it won't work.
$ for i in 3 4 5 ; do rm x_$i_* ; done
bash: /bin/rm: Argument list too long
bash: /bin/rm: Argument list too long
bash: /bin/rm: Argument list too long


Tuesday, November 30, 2010

cat is for concatenate (tfw?)

I always forget how to use the cat utility. Here's how.

Wednesday, November 10, 2010

Misc Linux Commands

Commands found, here, banner and cal are pretty neat.

Monday, October 11, 2010

SSH and SCP

This is my ssh and scp goto page. (goto. lol.)

Friday, October 8, 2010

Microsoft fonts in Ubuntu

Here is a good tutorial for loading the traditional Microsoft fonts into Ubuntu.