From e6661db7ead994a0f0b93bb06df60452d1b613a1 Mon Sep 17 00:00:00 2001 From: tinogomes Date: Sun, 14 Aug 2011 03:50:25 -0300 Subject: [PATCH] show processes and confirmation for remove files --- lib/aliases.zsh | 7 ++++++- lib/functions.zsh | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/aliases.zsh b/lib/aliases.zsh index e18a7e82f..1f91a8d66 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -23,6 +23,11 @@ alias sl=ls # often screw this up alias afind='ack-grep -il' alias x=extract - alias reload="source ~/.zshrc" alias galias='alias | grep' + +# Request confirmation before attempting to remove each file, regardless of the file's permissions, or +# whether or not the standard input device is a terminal. The -i option overrides any previous -f options. +alias rm="rm -i" + +alias psg='show_processes' diff --git a/lib/functions.zsh b/lib/functions.zsh index ef7cc6383..b503eb0e4 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -15,3 +15,11 @@ function take() { cd $1 } +function show_processes() { + if (($# == 0)); then + ps -ef + else + echo " UID PID PPID C STIME TTY TIME CMD" + ps -ef | grep $* + fi +} \ No newline at end of file