Check These Out
run this in another terminal, were xxxx is the process ID of the running dd process.
the progress will report on the original terminal that you ran dd on
Show the command line for a PID with ps
This command could seem pretty pointless especially when you can get the same result more easily using the rpm builtin queryformat, like:
$ rpm -qa --qf "%{NAME} %{VERSION} %{RELEASE}.%{ARCH}\n" | sort | column -t
but nonetheless I've learned that sometimes it can be quite interesting trying to explore alternative ways to accomplish the same task (as Perl folks like to say: There's more than one way to do it!)
I always add this to my .profile rc so I can do things like: "vim *.c" and the files are opened in tabs.
Based on the execute with timeout command in this site.
A more complex script:
#!/bin/sh
# This script will check the avaliability of a list of NFS mount point,
# forcing a remount of those that do not respond in 5 seconds.
#
# It basically does this:
# NFSPATH=/mountpoint TIMEOUT=5; perl -e "alarm $TIMEOUT; exec @ARGV" "test -d $NFSPATH" || (umount -fl $NFSPATH; mount $NFSPATH)
#
TIMEOUT=5
SCRIPT_NAME=$(basename $0)
for i in $@; do
echo "Checking $i..."
if ! perl -e "alarm $TIMEOUT; exec @ARGV" "test -d $i" > /dev/null 2>&1; then
echo "$SCRIPT_NAME: $i is failing with retcode $?."1>&2
echo "$SCRIPT_NAME: Submmiting umount -fl $i" 1>&2
umount -fl $i;
echo "$SCRIPT_NAME: Submmiting mount $i" 1>&2
mount $i;
fi
done
Change to your taste. Much quicker than having to add 'cd' every time. Add it to your .bashrc or .bash_profile.
Grabs the cmdline used to execute the process, and the environment that the process is being run under. This is much different than the 'env' command, which only lists the environment for the shell. This is very useful (to me at least) to debug various processes on my server. For example, this lets me see the environment that my apache, mysqld, bind, and other server processes have.
Here's a function I use:
$ aa_ps_all () { ( cd /proc && command ps -A -opid= | xargs -I'{}' sh -c 'test $PPID -ne {}&&test -r {}/cmdline&&echo -e "\n[{}]"&&tr -s "\000" " "