Prepending env LC_CTYPE=C fixes a problem with bad bytes in /dev/urandom on Mac OS X
commandline for mac os x
adjusting the field "f1" will give you additional information such as f1 = 98% f2 = discharging f3 = 2:02 remaining Show Sample Output
Feel free to put this in your ~/.profile:
random(){ cat /dev/urandom | env LC_CTYPE=C tr -dc $1 | head -c $2; echo; }
Then use it to generate passwords:
random [:alnum:] 16
Or DNA sequences:
random ACGT 256
Searches from present dir forward and removes all Mac generated . (dot) files.
The closer to zero the better.Credit to TheSeb on macrumors: http://forums.macrumors.com/showthread.php?t=1289884 Show Sample Output
Similarly for last wake time:
sysctl -a | grep waketime
If the password for the share your trying to mount contains special characters you can use URL escape characters. The above command uses an example as follows: username: user password: p@ss URL Encoded password: p%40ss All credit goes to Richard York: http://www.smilingsouls.net/Blog/20110526100731.html Also check out this URL Decoder/Encoder to convert your passwords. http://meyerweb.com/eric/tools/dencoder/
Insert an additional (moveable) spacer on the left side of the Dock in Mac OS X
Insert an additional (moveable) spacer on the right side of the Dock in Mac OS X
In Mac OS X, by default, you have to click the mouse on a Terminal window before you can type in it. You can change this behavior to mimic the X11 behavior of focusing on the window on mouseover.
Purges DNS cache of OS X. dscacheutil -flushcache does not work since OS X 10.7. Show Sample Output
Copying and pasting from Office documents open in Office:mac can dirty your files with Windows CRLF and (inexplicably) Classic Mac OS LF newlines, which can break some tools. This snippet replaces them with good ol' Unix LF newlines.
This gets the Nth argument in the last line of your history file. This is useful where history is being written after each command, and you want to use arguments from the previous command in the current command, such as when doing copies/moving directories etc. I wrote this after getting irritated with having to continually type in long paths/arguments. You could also use $_ if all you want is the last argument. Show Sample Output
If the HISTTIMEFORMAT is set, the time stamp information associated with each history entry is written to the history file, marked with the history comment character. Show Sample Output
This command will open the AVD Manager in Mac OS X.
Ruby Version Manager (RVM) - https://rvm.io/ Show Sample Output
This is the best way to fix this issue on OS X. If you don't have homebrew installed, now is the perfect time to fix that too. ;-) see http://crosstown.coolestguidesontheplanet.com/os-x/40-setting-up-os-x-lion-to-plug-into-homebrew-package-manager Show Sample Output
Its possible to user a simple regex to extract de username from the finger command. The final echo its optional, just for remove the initial space Show Sample Output
Also resolves hostname
Shows the WiFi signal strength without having to display thousands of lines Show Sample Output
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.
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
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: