handy OS X command line tricks

| No Comments | No TrackBacks

apparently, this is the only photo i have of a computer!

There's nothing secret or new about the following list, and a lot of it pulls from unix.  It's certainly not all encompassing!  If I can remember to, I'll keep updating this entry with the nifty bits.  Also, its really hard to remember these, without needing to use them!  If you're really into apple secrets, check out secrets! 

Use 'serial' to connect a usb/serial ftdi modem etc...:  screen /dev/tty.YOURDEVICE BAUD ...substitute BAUD with, well, the baud rate and YOURDEVICE, with what you find using: ls /dev/tty.*

use 'nc' aka netcat to send/receive tcp/udp commands
i.e. nc -u 192.168.1.55 700 

Forgot to sudo and got denied?  Simply hit 'sudo !!' 

'pmset -g' lists you the power management settings, and pmset can change them all

need to make a user admin over the terminal?: 
sudo dseditgroup -o edit -a usernametoadd -t user admin 
sudo dseditgroup -o edit -a usernametoadd -t user wheel

use 'top' to see more than 'ps'

'crontab -e' well, kinda obvious...

osx version?  'sw_vers' will give you a little, 'system_profiler' all of it

want to read only the last 20 lines of a log file?: 'tail -c 20 system.log'
read xkcd? 'open http://uni.xkcd.com/' ;)

need to invent an admin?  Use single-user mode and:
    /sbin/fsck -y
    /sbin/mount -uaw
    rm /var/db/.AppleSetupDone
    reboot
    ...this let's you own, really any os x machine, though its not fun to go through the apple welcome stuff again...

    how much battery is left? 'ioreg -l | grep Capacity'
    ioreg has a plethora of info and is worth running without the pipe.   If you need to find out any other peripheral info in ioreg, you can change the grep option.

    i'll add more soon!
    Enhanced by Zemanta

    No TrackBacks

    TrackBack URL: http://www.imlichenit.com/cgi-bin/mt/mt-tb.cgi/31

    Leave a comment

    About this Entry

    This page contains a single entry by admin published on July 26, 2012 3:58 PM.

    san francisco shakes shaketable shakedown was the previous entry in this blog.

    tAmp is the next entry in this blog.

    Find recent content on the main index or look in the archives to find all content.