Commands by root (52)

  • ps returns all running processes which are then sorted by the 4th field in numerical order and the top 10 are sent to STDOUT. Show Sample Output


    106
    ps aux | sort -nk +4 | tail
    root · 2009-01-23 17:12:33 293
  • See http://dev.mysql.com/doc/refman/5.0/en/myisamchk.html for further details. You can also repair all tables by running: myisamchk -r *.MYI


    -2
    myisamchk /path/to/mysql/files/*.MYI
    root · 2009-01-22 10:20:00 133
  •  < 1 2 3

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

Display packages and versions on Debian/Ubuntu distrib
Need admin right to run dpkg-query

pattern match in awk - no grep
Rather than chain a string of greps together and pipe them to awk, use awk to do all the work. In the above example, a string would be output to stdout if it matched pattern1 AND pattern2, but NOT pattern3.

Insert the last argument of the previous command
for example if you did a: $ ls -la /bin/ls then $ ls !$ is equivalent to doing a $ ls /bin/ls

A sorted summary of disk usage including hidden files and folders
Same result as with 'du -ks .[^.]* * | sort -n' but with size outputs in human readable format (e.g., 1K 234M 2G)

Rename .JPG to .jpg recursively
This command is useful for renaming a clipart, pic gallery or your photo collection. It will only change the big caps to small ones (on the extension).

check open ports without netstat or lsof

One-liner to generate Self-Signed SSL Certificate+Key without any annoying prompts or CSRs
Handy if you want to quickly generate a self-signed certificate. Also can be used in your automated scripts for generating quick-use certificates.

List only locally modified files with CVS

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"

ps a process keeping the header info so you know what the columns of numbers mean!
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1828 0.0 0.0 5396 476 ? Ss 2008 0:00 /usr/sbin/sshd


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: