find-fun
Take a break and have some fun in the terminal. $ = user
= root
copy/paste this code into a terminal... better still type it youself .)
$ find . -type f -exec ls -s {} \; | sort -n -r | head -50 | cat -n | tee ~/bigfile.list
when it completes type:
$ ls -l You should find a file
bigfile.list
You should see the 50 largest files in your home directory printed to the screen. Also a file has been created called bigfile.list in your home directory.
$ edit bigfile.list
Now you can delete your unwanted junk.
Have fun, dave.


Do it faster... (theme and variations)
Cool! However, it took 2 minutes on just my Download directory (11,790 files).
Here's some variations on the theme (output is identical except for white space), and they run a lot faster:
FASTEST (1 sec): $ time find . -type f -print0 | xargs --null du -s | sort -n -r | head -50 | cat -n | tee ~/bigfile.list
(Note: on 176,268 files in my $HOME, it took 1 minute 20 sec)
RUNNER-UP (2 sec): $ time find . -type f -print0 | xargs --null ls -s | sort -n -r | head -50 | cat -n | tee ~/bigfile.list
Some explanation:
xargs: It gathers up filenames and runs ls or du only once for every few hundred files (as many as it can fit on the command line). The -print0 and --null arguments are used to handle when file names have spaces in them.
du: 'Disk Usage.' Learn this tool. When doing cleanup, I often will do:
$ du -s * | sort -n
At the bottom of the list are the largest files or directories.
Peace, Gabriel
first run results
Very nice :-)
$ time find . -type f -print0 | xargs --null du -s | sort -n -r | head -50 | cat -n | tee ~/bigfile.list
real 0m0.179s user 0m0.049s sys 0m0.050s
$ du -s * | sort -n > du-list $ du -s * | sort -n | tee ~/du-list2
$ history | grep find $ history | grep du
Cheers, dave
history
Wow. I never saw the 'history' command before. That's pretty nice.
...but what's the purpose of doing 'history | grep find'?
command line recording
64Studio doesn't include ecasound by default, but installing it from Debian repos is a doddle (so I won't go there..)
Anyways. Ecasound is an alsa/jackd compatible multichannel recorder, which is controlled at the command line. It supports recording over a TCP/IP connection in its daemon mode. The syntax of the program quite complex, but here are some examples. See "man ecasound" and the html documentation in /usr/share/doc/ecasound for more elaborate examples.
(copy)
These first two commands do the exact same thing, conver somefile.wav to somefile.cdr (CDR is the CD-Audio track format). As no chains are specified, the default chain is created and used.
(copy)
To get a liiittle more complex, here's another example:
(copy)
ecasound -a:1,2 -i somefile.wav -a:1 -o somefile.cdr -a:2 -o somefile.mp3
(copy)
A useful addition to the previous would be this:
ecasound -a:1,2,3 -i somefile.wav -a:1 -o somefile.cdr -a:2 -o somefile.mp3 -a:3 -o alsahw,0
so you can listen to what the file is about. Of course, jackd is the name of the game:
Use with JACK audio server
Ecasound manages complex audio input setups by creating so called chains of input/output.
So test it - you'll be amazed at how little resources a (reltime) command line audio recorder (as ecasound) uses. I mainly use ecasound for capturing icecast streams over the internet. Of course I must make note that the author of ecasound is Kai Vehmanen - Finnish, like me.
Cheers!
history find history
Hi Gabriel,
I get quite a list. e.g. find -name ".txt" find find /media/hpdx3/ -name ".txt" find -name ".wav" find /media/hpdx3/ -name ".wav" history | grep find emacs find-fun.txt find /media/hpdx7/ -type f -exec ls -s {} \; | sort -n -r | head -50 | cat -n | tee /tmp/bigf.list find | grep ".mozilla" find /mnt/fd0/ -exec grep "grep" {} \; find . -type f -print | sort | uniq find . -type f -exec ls -s {} \; time find . -type f -print0 | xargs --null du -s | sort -n -r | head -50 | cat -n | tee ~/bigfile.list etc.,
$ cp .bash_history bash_history_backup
$ grep "find" bash_history_backup $ grep "cp" bash_history_backup $ grep "emacs" bash_history_backup $ grep "ls" bash_history_backup $ grep "du" bash_history_backup
Cheers! dave
ecasound
http://www.eca.cx/ecasound/
apt-get update
apt-cache search ecasound
swh-plugins - Steve Harris's LADSPA plugins ecamegapedal - an audio effects pedal application ecasound - Multitrack-capable audio recorder and effect processor ecasound-el - emacs binding files for ecasound sound editing environment ecawave - graphical audio file editor libecasound-ruby1.8 - ruby binding files for ecasound libecasound2.2-dev - development files for ecasound libecasoundc2.2-dev - c binding files for ecasound (devel) libkvutils2.2-dev - kvutils library required for ecasound - development python-ecasound2.2 - python binding files for ecasound 2.2
apt-cache show ecasound
Version: 2.4.4-6
apt-get install ecasound
dpkg -l | grep ecasound
ii ecasound....................2.4.4-6.....Multitrack-capable audio recorder and effect ii python-ecasound2.2...2.4.4-6.....python binding files for ecasound 2.2
*** for emacs ***
http://www.emacswiki.org/cgi-bin/wiki?EcasoundMode
apt-get install ecasound-el
dpkg -l | grep ecasound
ii ecasound-el............2.4.4-6.....emacs binding files for ecasound sound editi
Thanks porisija :-) now I have to get it all up and running.
dave.
find-Software
$ df -hT
$ dpkg --get-selections > software1 and again $ dpkg --get-selections > software2
This will create 2 files in your home directory software1 software2 These list the software installed, leave software1 alone.
grep "cups" software2
grep "blue" software2
grep "bluetooth" software2
etc.,etc., only you know what is not needed.
apt-get remove --purge (not needed software)
Watch very carefully for shared libs and others apt might try to remove. This method will also keep a .bash_history of the software you have removed.
[ctrl]+[d] drops you back to user.
$ dpkg --get-selections > software2
software1 (default_software) software2 (installed_software)
$ cp .bash_history bh_find-software
$ df -hT
$ dpkg -l | grep "linux"
$ dpkg -l | grep "64studio"
$ dpkg -l | grep "alsa"
$ dpkg -l | grep "sound"
$ dpkg -l | grep "fun"
Cheers, dave
Disk Usage 2
Nice little bit of typing practice:
Get an ordered list of subdirectory sizes $ du -sk ./* | sort -n | awk 'BEGIN{ pref[1]="K"; pref[2]="M"; pref[3]="G";} { total = total + $1; x = $1; y = 1; while( x > 1024 ) { x = (x + 1023)/1024; y++; } printf("%g%s\t%s\n",int(x10)/10,pref[y],$2); } END { y = 1; while( total > 1024 ) { total = (total + 1023)/1024; y++; } printf("Total: %g%s\n",int(total10)/10,pref[y]); }'
or you could just copy/paste into a terminal ;-)
From Here.
http://www.shell-fu.org/lister.php?tag=du
http://www.shell-fu.org/lister.php?tag=awk
Cheers, dave