Commands by pooryorick (1)

What's this? 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

Give any files that don't already have it group read permission under the current folder (recursive)
Makes any files in the current directory (and any sub-directories) group-readable. Using the "! -perm /g=r" limits the number of files to only those that do not already have this property Using "+" on the end of the -exec body tells find to build the entire command by appending all matching files before execution, so invokes chmod once only, not once per file.

Remove all .svn folders
-depth argument will cause find to do a "depth first" tree search, this will eliminate the "No such file or directory" error messages

List the binaries installed by a Debian package
This shell function displays a list of binaries contained in an installed package; works on Debian based Linux distributions.

Create a large test file (taking no space).

Execute a sudo command remotely, without displaying the password
The ssh command alone will execute the sudo command remotely, but the password will be visible in the terminal as you type it. The two stty commands disable the terminal from echoing the password back to you, which makes the remote sudo act as it does locally.

Coping files, excluding certain files
Preserve file structure when coping and exclude some file o dir patterns

Create a false directory structure for testing your commands
This will make a false directory with the same file names as whatever directory you choose. This is wise to use when testing scripts that alter contents, filenames, or move files. I wrote this after an OOPS I made when renaming a directory of JPGs, PNGs, PSDs that were mixed. I recommend this as I lost over 2000 vacation pictures and some graphics I designed for software and web sites. :( NOTE: This only creates name copies, that data itself is not copied.

Find usb device
I often use it to find recently added ou removed device, or using find in /dev, or anything similar. Just run the command, plug the device, and wait to see him and only him

List PHP-FPM pools by total CPU usage

poor man's vpn
this easy to install tool redirects all traffic to internet through ssh. it's very usefull when connecting to free wifi. you need to start it as root because it needs permissions to change iptables settings. ofcourse you also need a shell account

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.


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: