I just learned about the --forest switch for ps. If you use it, you'll get a tree representing all of the parent and child processes running rather than just a straight up list.
Thanks! I've been using a tool called pstree for the same thing (I didn't even realize ps had such a feature). It looks like the ps utility on OS X doesn't support --forest though, so pstree is still useful there.
Metaphors are sometimes confusing. Call it what it is. "Reflection" should have been called "type information", for example, and "--forest" should have been called "--nested".
the command 'tee': let's you see what is happening at an intermediate stage of a pipeline (I originally thought your blog post would be about tee)
the -S flag to objdump: If you're trying to learn how compilers work or assembly, the '-S' flag to objdumb is absolutely beautiful. If you compile a binary with debugging symbols (-g in gcc), 'objdump -S binary' will intersperse the assembly with the original code, letting you see what each line compiled into.
I use 'pushd' and 'popd' bash builtins. It lets you remember current directories and have a stack of locations that you've been. Very valuable when you're jumping around a large source tree.
Even though not a command, I usually follow ls by "-ltr". That arranges it such that the most recently modified file is on the bottom. Very easy to see what files were modified.
"du -sk * | sort -rn" for a nice listing of directory sizes.
Pressing "esc, ." (That's the Esc key, followed by a period. Not together) in bash would insert the previous command's argument.
i.e.:
bash# ls /some/really/long/path/to/a/huge/file.c
bash# vi [esc, .] # <-- that would insert the path
bash# vi $_ # <-- same effect
mmv (moves multiple files based on a simple pattern replacement language). Example:
mmv "*.mp3" "old_#1.mp3"
prefixes all files in the current directory ending with .mp3 with 'old_'. Btw., the quotes around the arguments are necesssary because mmv uses some of the same metacharacters as the shell does.
I find xargs handy, it lets you use the output of one command as arguments for another command. As an example, I have a little alias that I use to grep through my ruby/rails source trees:
alias gr 'find . -name \*.rb -o -name \*.rhtml -o -name \*.erb -o -name \*.rjs | xargs egrep \!*'
(backticks can be used similarly, but can run into command line length limits)
This sounds useful but I don't like the fact that it's named "pv". I've always associated "pv" with physical volume and lvm... might be a little confusing.
Sometimes, pv(1) doesn't help. For example, `tar cf - foo | bzip2 -9v >foo.tar.bz2'. You don't know the size of the data that needs to pass down the pipe. But I sometimes find watching tar(1) open the files to read is handy; `strace -e trace=open $(pidof tar)'.
[+] [-] aston|17 years ago|reply
[+] [-] raamdev|17 years ago|reply
http://freshmeat.net/projects/pstree/
[+] [-] palish|17 years ago|reply
Metaphors are sometimes confusing. Call it what it is. "Reflection" should have been called "type information", for example, and "--forest" should have been called "--nested".
[+] [-] FlorinAndrei|17 years ago|reply
As in:
ps axf
[+] [-] ivank|17 years ago|reply
[+] [-] pkrumins|17 years ago|reply
[+] [-] yan|17 years ago|reply
the command 'tee': let's you see what is happening at an intermediate stage of a pipeline (I originally thought your blog post would be about tee)
the -S flag to objdump: If you're trying to learn how compilers work or assembly, the '-S' flag to objdumb is absolutely beautiful. If you compile a binary with debugging symbols (-g in gcc), 'objdump -S binary' will intersperse the assembly with the original code, letting you see what each line compiled into.
I use 'pushd' and 'popd' bash builtins. It lets you remember current directories and have a stack of locations that you've been. Very valuable when you're jumping around a large source tree.
Even though not a command, I usually follow ls by "-ltr". That arranges it such that the most recently modified file is on the bottom. Very easy to see what files were modified.
"du -sk * | sort -rn" for a nice listing of directory sizes.
Pressing "esc, ." (That's the Esc key, followed by a period. Not together) in bash would insert the previous command's argument. i.e.:
'tree' is nice to picture a directory hierarchy.[+] [-] jsrn|17 years ago|reply
Multiple substitutions are allowed, e.g.:
renames blub.xyz to blub___xyz.[+] [-] pwk|17 years ago|reply
[+] [-] gcv|17 years ago|reply
[+] [-] pwk|17 years ago|reply
[+] [-] jacquesm|17 years ago|reply
tail -1000 logfile | cut -d ' ' -f 1 | sort | uniq -c | sort -n
Bots should stand out in the last couple of lines and have a linecount that is substantially higher than a normal user.
[+] [-] migpwr|17 years ago|reply
[+] [-] kaens|17 years ago|reply
[+] [-] akkartik|17 years ago|reply
[+] [-] wmf|17 years ago|reply
http://0pointer.de/lennart/projects/bidilink/
[+] [-] cliffy|17 years ago|reply
[+] [-] newt0311|17 years ago|reply
[+] [-] ralph|17 years ago|reply
[+] [-] Keyframe|17 years ago|reply
[+] [-] blasdel|17 years ago|reply