Commands by sunny256 (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

Change Windows Domain password from Linux
If you use Linux in a Windows domain and there are N days to expiry, this is how you can change it without resorting to a windows machine.

Copy via tar pipe while preserving file permissions (run this command as root!)
It's the same like 'cp -p' if available. It's faster over networks than scp. If you have to copy gigs of data you could also use netcat and the tar -z option in conjunction -- on the receiving end do: # nc -l 7000 | tar -xzvpf - ...and on the sending end do: # tar -czf - * | nc otherhost 7000

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

live netcat network throughput test
On the another machine write this command. pv -r /dev/zero | nc 192.168.1.1 7777 It will show live throughput between two machine.The destination machine ip is at our example 192.168.1.1 You must multiply by 8 for the network calculation. You must install pv and netcat commands for this commands usage. kerim@bayner.com http://www.bayner.com/

Copy uncommitted changes from remote git repository
Copy changed files from remote git repository, _including binary ones_, staged and unstaged alike. Note that this command doesn't handle deleted files properly.

Convert JSON to YAML
Requires installing json2yaml via npm: npm install -g json2yaml (can also pipe from stdin) Ref: https://www.npmjs.com/package/json2yaml

Count lines using wc.

download specific files only from a website

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"

Adjust display hardware brightness [dbus way]


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: