General Enhancements #2
@ -287,10 +287,13 @@
|
|||||||
clean="Y" ;;
|
clean="Y" ;;
|
||||||
-n | -net | --network )
|
-n | -net | --network )
|
||||||
network="Y" ;;
|
network="Y" ;;
|
||||||
|
-s | -sum | --summarize )
|
||||||
|
summarize="-s" ;;
|
||||||
* )
|
* )
|
||||||
echo "
|
echo "
|
||||||
ERROR: Option '$1' with value '$2' not recognized.
|
ERROR: Option '$1' with value '$2' not recognized.
|
||||||
$PROG [-c|-y|--clean] [-n|-net|--network]
|
$PROG [-c | -y | --clean] [-n | -net | --network] \
|
||||||
|
[-s | -sum | --summarize]
|
||||||
" >&2
|
" >&2
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
@ -318,8 +321,8 @@
|
|||||||
echo "Checking $dir..."
|
echo "Checking $dir..."
|
||||||
$sudo find $dir -name TRASH | while read trash; do
|
$sudo find $dir -name TRASH | while read trash; do
|
||||||
if [[ "$trash" != "" && `$sudo ls -a $trash` ]]; then
|
if [[ "$trash" != "" && `$sudo ls -a $trash` ]]; then
|
||||||
echo "Found $trash with contents:"
|
echo "Found $trash:"
|
||||||
$sudo du -ha $trash | sort -h
|
$sudo du -ha $summarize $trash | sort -h
|
||||||
if [[ "$clean" == "Y" ]]; then
|
if [[ "$clean" == "Y" ]]; then
|
||||||
echo "Cleaning trash..."
|
echo "Cleaning trash..."
|
||||||
$sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
$sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
||||||
@ -328,8 +331,8 @@
|
|||||||
done
|
done
|
||||||
$sudo find $dir $maxdepth -name "*"Trash"*" | while read trash; do
|
$sudo find $dir $maxdepth -name "*"Trash"*" | while read trash; do
|
||||||
if [[ "$trash" != "" && `$sudo ls -a $trash` ]]; then
|
if [[ "$trash" != "" && `$sudo ls -a $trash` ]]; then
|
||||||
echo "Found $trash with contents:"
|
echo "Found $trash:"
|
||||||
$sudo du -ha $trash | sort -h
|
$sudo du -ha $summarize $trash | sort -h
|
||||||
if [[ "$clean" == "Y" ]]; then
|
if [[ "$clean" == "Y" ]]; then
|
||||||
echo "Cleaning trash..."
|
echo "Cleaning trash..."
|
||||||
$sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
$sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
||||||
@ -345,8 +348,8 @@
|
|||||||
echo "Checking $dir..."
|
echo "Checking $dir..."
|
||||||
sudo find $dir -name TRASH | while read trash; do
|
sudo find $dir -name TRASH | while read trash; do
|
||||||
if [[ "$trash" != "" && `sudo ls -a $trash` ]]; then
|
if [[ "$trash" != "" && `sudo ls -a $trash` ]]; then
|
||||||
echo "Found $trash with contents:"
|
echo "Found $trash:"
|
||||||
sudo du -ha $trash | sort -h
|
sudo du -ha $summarize $trash | sort -h
|
||||||
if [[ "$clean" == "Y" ]]; then
|
if [[ "$clean" == "Y" ]]; then
|
||||||
echo "Cleaning trash..."
|
echo "Cleaning trash..."
|
||||||
sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
||||||
@ -355,8 +358,8 @@
|
|||||||
done
|
done
|
||||||
sudo find $dir -name .Trash"*" | while read trash; do
|
sudo find $dir -name .Trash"*" | while read trash; do
|
||||||
if [[ "$trash" != "" && `sudo ls -a $trash` ]]; then
|
if [[ "$trash" != "" && `sudo ls -a $trash` ]]; then
|
||||||
echo "Found $trash with contents:"
|
echo "Found $trash:"
|
||||||
sudo du -ha $trash | sort -h
|
sudo du -ha $summarize $trash | sort -h
|
||||||
if [[ "$clean" == "Y" ]]; then
|
if [[ "$clean" == "Y" ]]; then
|
||||||
echo "Cleaning trash..."
|
echo "Cleaning trash..."
|
||||||
sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user