Skip to content

Instantly share code, notes, and snippets.

@draganczukp
Last active June 5, 2019 10:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save draganczukp/275db0b5d534054eb8f1b0ddbc44b9b9 to your computer and use it in GitHub Desktop.
  1. B
  2. A
  3. C
  4. A
  5. (Nie widać za dobrze, ale zakładam że kursor jest na literce "z", czwarta linijka od dołu) <Escape>d4d4kP
if [ $# -lt 2 ]; then
	echo "Za mało parametrow"
	exit
fi

if [ -d $2 ]; then
	find $2 -size $1c -exec ls -l {} \;
else
	echo "$2 nie jest katalogiem"
fi
if [ $# -lt 2 ]; then
	echo "Za mało parametrow"
	exit
fi

username=$(grep "^.*:\*:$1:" /etc/passwd | cut -d: -f1)
home=$(grep "^$username:" /etc/passwd | cut -d: -f6)
echo "Logname: $username"
find $home -size -$2c -exec ls -rS {} +
if [ $# -lt 2 ]; then
	echo "Za mało parametrow"
	exit
fi

if [ -d $2 ]; then
	case $1 in
		-r)
			find $2 -perm -u+r
			;;
		-w)
			find $2 -perm -u+w
			;;
		-x)
			find $2 -perm -u+x
			;;
		*)
			echo "Zly przelacznik"
			;;
	esac
else
	echo "$2 to nie katalog"
fi
if [ $# -lt 2 ]; then
	echo "Za mało parametrow"
	exit
fi

home=$(grep "^$1:" /etc/passwd | cut -d: -f6)
find $home -mtime $2 -exec ls -S {} +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment