Skip to content

Instantly share code, notes, and snippets.

View mayurbhangale's full-sized avatar

Mayur Bhangale mayurbhangale

View GitHub Profile
@mayurbhangale
mayurbhangale / dup.sh
Created April 14, 2017 07:18
./dup.sh runs the shell script ./dup.sh -h shows help along with the options(-l,-m,-d) for list,merge and delete respectively of duplicate files along with example commands
if [ "$1" = "-h" ]; then
printf "\n ./dup.sh arg1 arg2\n ./dup.sh -l <path>: for listing of duplicate files \n ./dup.sh -m <path>: for merging of duplicate files \n ./dup.sh -d <path>: for deleting of duplicate files\n Example:\n ./dup.sh -l /home/username/ will list all the duplicate files in /home/username directory \n ./dup.sh -m /home/username/ will merge all the duplicate files in /home/username directory \n ./dup.sh -d /home/username/ will delete all the duplicate files in /home/username directory\n"
elif [ -n "$2" ]; then
answer=$(find "$2" -type f -printf "%f %s\n"|sort -k1,1nr -k2,2n|uniq -d| cut -d" " -f1 )
if [ "$1" = "-l" ]; then
for i in $answer;
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".GhostActivity"
android:id="@+id/ghost">
<TextView
android:layout_width="wrap_content"
package com.google.engedu.ghost;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;
import java.io.IOException;
import java.util.Random;
package com.google.engedu.ghost;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Random;