Commands by uid0 (2)


  • -2
    mount | awk '/:/ { print $3 } ' | xargs sudo umount
    uid0 · 2009-11-05 17:19:11 2
  • besure to adjust your find to use to correct location of your VMX files. Show Sample Output


    0
    for x in `find /vmfs/volumes/ -name *vmx -exec grep -H linux.iso {} \; |cut -d : -f 1`; do echo $x; grep -i sync $x; done;
    uid0 · 2009-10-30 16:19:16 2

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

List all open ports and their owning executables
Particularly useful on OS X where netstat doesn't have -p option.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Ease your directory exploration
Usage : tt [OCCURRENCE] tt will display a tree from your actual path tt .svn will display only line containing .svn

Open the current project on Github by typing gh
Written for Mac OSX. When you are working in a project and want to open it on Github.com, just type "gh" and your default browser will open with the repo you are in. Works for submodules, and repo's that you don't own. You'll need to copy / paste this command into a gh.sh file, then create an alias in your bash or zsh profile to the gh.sh script. Detailed instructions here if you still need help: http://gist.github.com/1917716

find an unused unprivileged TCP port
Some commands (such as netcat) have a port option but how can you know which ports are unused?

Kill process by pid
To kill a process in windows by using the PID. Change 10728 to the PID of the process you want to kill.

bash shell expansion
The expansion {,} in bash will repeat the given string once for each item seperated by commas. The given command will result in the following being run: cp /really/long/path/and/file/name /really/long/path/and/file/name-`date -I` These can be embedded as needed, ex: rm file{1,2,3{1,2,3}} would delete the files file1, file2, file31, file32, file32, and no other files.

Find processes stuck in dreaded "D" state aka IO Wait
Lots of fun to run on nfs clients when the server or network connection is having issues

directly ssh to host B that is only accessible through host A
Of course you need to be able to access host A for this ;-)

FizzBuzz in Perl
Just another FizzBuzz in Perl.


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: