Check These Out
################################################################################
# get all modified files since last commit and zip them to upload to live server
################################################################################
# delete previous tar output file
rm mytarfile.tar -rf
#rm c:/tarOutput/*.* -rf
# get last commit id and store in variable
declare RESULT=$(git log --format="%H" | head -n1)
# generate file list and export to tar file
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $RESULT | xargs tar -rf mytarfile.tar
# extract tar files to specified location
tar -xf mytarfile.tar -C c:/tarOutput
This is easy to type if you are looking for a few (hundred) "missing" megabytes (and don't mind the occasional K slipping in)...
A variation without false positives and also finding gigabytes (but - depending on your keyboard setup - more painful to type):
$du -hs *|grep -P '^(\d|,)+(M|G)'|sort -n
(NOTE: you might want to replace the ',' according to your locale!)
Don't forget that you can
modify the globbing as needed! (e.g. '.[^\.]* *' to include hidden files and directories (w/ bash))
in its core similar to:
http://www.commandlinefu.com/commands/view/706/show-sorted-list-of-files-with-sizes-more-than-1mb-in-the-current-dir
I have come across a situation in the past where someone has unlinked a file by running an 'rm' command against it while it was still being written to by a running process.
The problem manifested itself when a 'df' command showed a filesystem at 100%, but this did not match the total value of a 'du -sk *'.
When this happens, the process continues to write to the file but you can no longer see the file on the filesystem. Stopping and starting the process will, more often than not, get rid of the unlinked file, however this is not always possible on a live server.
When you are in this situation you can use the 'lsof' command above to get the PID of the process that owns the file (in the sample output this is 23521).
Run the following command to see a sym-link to the file (marked as deleted):
$ cd /proc/23521/fd && ls -l
Truncate the sym-link to regain your disk space:
$ > /proc/23521/fd/3
I should point out that this is pretty brutal and *could* potentially destabilise your system depending on what process the file belongs to that you are truncating.
works on Linux and Solaris. I think it will work on nearly all *nix-es
Handle any bad named file which contains ",',\n,\b,\t,` etc
Store the file name as null character separated list
$find . -print0 >name.lst
and retrieve it using
$read -r -d ""
Eg:
$find . -print0 >name.lst;
$cat name.lst| while IFS="" read -r -d "" file;
$do
$ls -l "$file";
$done
usefull in case of abuser/DoS attacks.
ethstatus part of ethstatus package, is a consolle based monitor for network interfaces. Nicely display on screen a real time summary about bandwidth, speed and packets.