homepage Welcome to WebmasterWorld Guest from 54.161.246.212
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / The Macintosh Webmaster
Forum Library, Charter, Moderators: travelin cat

The Macintosh Webmaster Forum

    
Unix commands every Mac webmaster user should know
Some useful tricks for the command line phobics
jamesa

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 949 posted 9:37 am on Mar 21, 2006 (gmt 0)

A friend of mine was asking about whois lookups. Very easy:

Open Terminal (/Applications/Utilities/Terminal) and type:

whois bbc.co.uk

Now for fun let's find out their IP address:

host bbc.co.uk

And let's find out who owns the IP block (using the IP gleaned from the previous command):

whois 212.58.224.131

Inspired by this I thought it would be cool to give our GUI-only friends a few tricks to make their lives easier. What's in your Unix bag of tricks?

 

timster

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 949 posted 2:52 pm on Mar 21, 2006 (gmt 0)

What's in your Unix bag of tricks?

As much as I can fit, but for starters...

ftp myname@www.example.com
ftp -h
It might not be as easy as other FTP clients, but it never crashes, it's free, and it's on every Mac OS X machine.

I've found that as a Mac webmaster, the more Unix I know the better.

tstaheli

10+ Year Member



 
Msg#: 949 posted 3:25 pm on Mar 21, 2006 (gmt 0)

ssh user@host.com -p
Changing my ssh port has helped fight spammers/hackers/DOS etc.
pico index.html
Definetly the fastest/easiest way to edit any file.

bedlam

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 949 posted 3:42 pm on Mar 21, 2006 (gmt 0)

When installing downloadable software on a remote server (or even locally...):

curl -o filename.ext http://example.com/path/to/filename.ext

Forget this 'download-to-workstation-and-upload-to-server' nonsense!

-b

jezra

10+ Year Member



 
Msg#: 949 posted 6:41 pm on Mar 21, 2006 (gmt 0)

scp /file/on/local/machine /location/on/remote/machine
secure copy is great when I need to move a few files and I know exactly where they are going.

jamesa

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 949 posted 8:34 pm on Mar 21, 2006 (gmt 0)

Here's a fun one. When you're out of town and missing that special someone, paste this into the Terminal (all on one line):

say -v Agnes "For Pete's sake, are you reading that web master world again? Oh for crying out loud, make yourself useful for once and take out that fricken trash it stinks."

hehe ;)

JerryOdom

10+ Year Member



 
Msg#: 949 posted 8:37 pm on Mar 21, 2006 (gmt 0)

nslookup google.com

traceroute google.com

zCat

10+ Year Member



 
Msg#: 949 posted 9:15 pm on Mar 21, 2006 (gmt 0)

grep -rl "string I want to find" *

whoisgregg

WebmasterWorld Senior Member whoisgregg us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 949 posted 11:45 pm on Mar 21, 2006 (gmt 0)

whereis php (and for other binaries)
Birdman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 949 posted 12:18 am on Mar 22, 2006 (gmt 0)

which
awk
cat
sed
ping
ifconfig
man (duh)
ls
dmesg
cp
rm
mkdir
rmdir
cd
find
chmod
chown...

Those were in my console history :)

Oh, my fav is:

emerge (Gentoo)

I'm a Linux man, but it's the same right?

jamesa

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 949 posted 6:23 pm on Mar 23, 2006 (gmt 0)

Just encountered this: Have a 25+MB file that's a long list, and I needed to strip out the duplicates.

sort original_filemane uniq > new_filename

uniq only finds duplicates on adjacent lines, hence the need to sort first.

zCat

10+ Year Member



 
Msg#: 949 posted 10:44 pm on Mar 23, 2006 (gmt 0)

I'm a Linux man, but it's the same right?

"Similar but different" would be a better description. AFAIK OS X adopted FreeBSD's userland utilities, so some things are subtly not quite the same (netstat is the only thing that comes to mind right now though).

(Linux on the desktop and webservers, OpenBSD on the firewall and OS X on the laptop = recipe for command-line confusion ;-).

mhhfive

10+ Year Member



 
Msg#: 949 posted 6:47 am on Mar 27, 2006 (gmt 0)

top -o vsize

websteve

5+ Year Member



 
Msg#: 949 posted 5:05 am on Mar 30, 2006 (gmt 0)

Heres my list I could not live with out!

Wanna watch whos at your site in real time?

tail -f /var/log/httpd/access_log

wanna see your errors in real time?

tail -f /var/log/httpd/error_log

Having trouble with your mysql tables?

mysqlcheck -u root -p --all-databases --analyze --optimize

Im making a site right now about commands and such related to os x server commands if your interested in the site message me and ill give you the address.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / The Macintosh Webmaster
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved