western willow ventures inc.

eye on the net
  • Home
  • Contact
  • Web
  • Graphics
  • ARDi
  • Samples
  • Terms of Service
  • Fun
  • Privacy

Search

Home

command line

Reclaiming disk space on Ubuntu server

Thu, 2012-02-09 10:17 |  Franco

Here are a few command lines to help reclaim disk space:
this one displays folders off the root larger than 1 gigabyte

sudo du -h --max-depth=1 / | grep '[0-9]G\>'

Same thing but inside the /var folder
sudo du -h --max-depth=1 /var | grep '[0-9]G\>'

THis one will monitor disk space in a term window while you work in another
clear;watch  df -h

this command will remove old packages you dont need, and free up a few hundred megs. a good move to instantly get some space, but just not very much.
sudo apt-get autoremove

Read more
Franco's blog |  Login to post comments |  117 reads |  Tags: command line, diskspace, server, ubuntu

Quickly fixing SSH when the remote key changes!

Thu, 2011-03-17 09:32 |  Franco

So, you cloned your virtual machine and made sure it has the same MAC addresses so that it would pull the same IP from the DHCP server lease. but the next time you click on your SSH icon, it fails.

Does this look familiar?

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

Well this is the magic line:

Offending key in /home/someuser/.ssh/known_hosts:19

Read more
Franco's blog |  Login to post comments |  530 reads |  Tags: command line, linux, ssh, ubuntu

Easy batch renaming in Ubuntu (and other debian systems)

Thu, 2011-03-17 09:27 |  Franco

Ever want to rename 300 .foo files to .bar? wish you could do this:

mv *.foo *.bar

Here is the answer: Debian Rename included in ubuntu.
this example renames all .php5 files to .php

rename ‘s/\.php5/.php/’ *.php5

Franco's blog |  Login to post comments |  1275 reads |  Tags: command line, debian, linux, ubuntu

Recursive search for files with specific content using GREP

Fri, 2011-02-18 14:03 |  Franco

So you know that somewhere in your source folder (/source) that there is a script that uses the foo() function but you cant remember which one and there are thousands of files, what do you do?

You grep them!

grep -R -i -n 'foo()' *

Lets break it down, first we are grepping files, the -R indicates to search recursively, -i indicates we want to ignore case, and -n indicates we want to know which line of the file grep finds our search string on. then the search string in single quotes and lastly, a finame wildcard, in this case, search through every file.

Franco's blog |  Login to post comments |  1317 reads |  Tags: command line, grep, linux, ubuntu

Popular content

Today's:

  • Contact
  • Raven Lovers
  • Setting up a new Ubuntu

All time:

  • Contact
  • Web
  • ARDi - Aerial Research Drone One

Last viewed:

  • Flight Training and simulation
  • Whats going on on my network?
  • Contact

Navigation

  • Login
  • Album photos
  • Contact form
  • Feed aggregator
© 2010 Western Willow Ventures Inc.

Designed by Heidi Selzler.