Welcome to WebmasterWorld Guest from 54.226.62.251

Forum Moderators: travelin cat

Message Too Old, No Replies

Unix commands every Mac webmaster user should know

Some useful tricks for the command line phobics

     

jamesa

9:37 am on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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

2:52 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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

3:25 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



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

3:42 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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

6:41 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



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

8:34 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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

8:37 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



nslookup google.com

traceroute google.com

zCat

9:15 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



grep -rl "string I want to find" *

whoisgregg

11:45 pm on Mar 21, 2006 (gmt 0)

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



whereis php
(and for other binaries)

Birdman

12:18 am on Mar 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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

6:23 pm on Mar 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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:44 pm on Mar 23, 2006 (gmt 0)

10+ Year Member



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

6:47 am on Mar 27, 2006 (gmt 0)

10+ Year Member



top -o vsize

websteve

5:05 am on Mar 30, 2006 (gmt 0)

5+ Year Member



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.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month