86 responses

  1. Steve
    January 26, 2016

    Need a better Gui.

    Reply

  2. stib
    September 6, 2011

    The people who are carrying on about the gui alternative for screencapture are missing the point somewhat. The strength of command line applications is that they can be easily automated, and chained together to create useful tools. For example if I wanted to take a screenshot every minute for a whole day, it would be trivial to do this on the command line, but I’d love to see you try it with the keyboard shortcuts.
    Or even more fun: I can log in to my desktop machine from my phone using a ssh client and have access to all the command line tools, even on a slow 3G connection.
    The more I use the command line, the more I feel limited by the GUI.

    Reply

  3. dogboi
    January 25, 2011

    I’d like to recommend htop as a replacement for top. There are a few prebuilt versions, or of course, you can compile it yourself. I also use iterm instead of terminal.app.

    Reply

  4. oteller tatil
    April 4, 2010

    Nice post…Thanks

    Reply

  5. Sikis izle
    January 10, 2010

    This is a good article, but I have to say the GNU comment is pretty out there. Mac OS X is built on various BSDs, notably FreeBSD, which has its own set of command-line tools that have nothing to do with GNU.

    Although OS X does use GNU tools (notably the compiler, ‘gcc’), none of the programs in this list are by the GNU foundation except the catch-all final two ‘programs’ which of course let you install your own GNU utilities if you like.

    What about the GUI? That’s the evolution of NextStep, a proprietary interface that came out of Steve Jobs’ previous company.

    Reply

  6. macdet
    January 8, 2010

    You make my day & live better than before. Big hands

    Reply

  7. Guz
    November 2, 2009

    For the Screen Capture, you can do the thingy with the camera by just pressing CMD+SHITF+4 and then SPACE.

    For just a portion of the screen is just CMD+SHIFT+4…

    Reply

  8. Büyü
    October 23, 2009

    Although OS X does use GNU tools (notably the compiler, ‘gcc’), none of the programs in this list are by the GNU foundation except the catch-all final two ‘programs’ which of course let you install your own GNU utilities if you like.

    Reply

  9. hom
    July 8, 2009

    for all those plebs that kept banging on about cmd shift 4, it only allows you to save the image as a PNG and not the extension of you choice, cocky little bstrds

    Reply

  10. Joe
    April 28, 2009
  11. buddy
    February 22, 2008

    Window problems? Go to Terminal>Preferences>Settings

    Reply

  12. raymond Martino
    November 15, 2007

    Everytime I try and open terminal all I get is a small box with only the round red x button – cant grab corner to expand and see what’s in it. Any kelp would be appriciated – e-mail [email protected]

    Reply

  13. anon
    August 17, 2007

    Regarding softwareupdate, I’ve been using this for awhile, and while it’s always been reliable for me in the past, the last two major Mac OS X updates that I tried to install via softwareupdate completely hosed my machine. I’m now waiting to get to my machine to do updates. Not worth it, in my experience. Just a warning.

    Reply

  14. Aaron
    May 9, 2007

    Consider explaining the “lipo” joke to non-native English speakers. International vowel pronunciation would make the word sound like “lee’po”, not “lai’po” as in liposuction.

    Reply

  15. Lou
    May 9, 2007

    I didn’t notice the most widely used and arguably the most useful classic *nix utility: man – the manpages!

    As in:
    man say

    Did you know you can get say to dictate from a file? (use -f filename)
    Write to an aiff file? (-o filename)
    Use a voice other than the system default? (use -v)
    Very cool – I so can’t wait to turn on ssh access to my wife’s PB so I can shell in from work and ‘tell’ her things :)

    ‘man lipo’ gives you the full manual page for the lipo command. The man utility can help you figure out the finer points of almost any command line utility.

    As a developer, it has many many (MANY) times reminded me of the syntax for different C/C++ library calls, Perl functions, shell script commands, etc. And as my own sysadmin, it has helped me tweak the formats and parameters of countless system and application configuration files, makefiles, etc.

    type ‘man man’ to get man to tell you about himself :)

    man is your friend :)

    Reply

  16. Eduo
    May 9, 2007

    Aaah. The smell of political agendas in the morning air.

    WzDD: If you’re going to be pedantic about it then you have to consider that “leverage” in this context means “to influence” or, if you press me “to adopt best practices”. So leveraging the work of others just means doing things the same way, it may not mean using the other’s work directly. If that wasn’t enough then I’d have to turn your attention to the “and others” part of that same sentence which clearly means “others that are not GNU in the open source community”.

    Further, since you seem to be one of the anal types and you’ll try to nitpick: Do note that “open source” is in lowercase, which implies it’s not referring to any specific license (and definitely not to GNU, as that’s mentioned specifically and separately, probably because someone like you made a similarly snarky comment once).

    Also, the paragraph clearly says that thanks to open source tools and ideas Mac OSX now has an interface that doesn’t require to use the terminal at all. What in heaven could that have anything to do with your clarification that the tools mentioned aren’t GNU? Is that even relevant other than two show us how much you know about GNU and how little about reading comprehension?

    Obviously, if you ignored the article’s opening paragraph, clear as it was to the rest of us (admittedly, we don’t feel we have to defend our chosen politic cause), it’d be unfair to point out that your comment about NextStep is also unrelated (as previously explained) to whether there are GNU tools mentioned in the article, included in OSX or part of the GUI.

    To summarise in a single line: “open source != GNU, BSD = open source (among others)”. Is OSX built on the shoulders of giants (to use a cliché, the giants here being open source works like GNU and BSD, as well as others less publicized), even if OSX’s GUI is believed (by those that need to brush up their computer history lessons) to be based in NextStep’s? Yes. It is. OSX has a LOT in debt to open source tools and movements.

    FWIW, this attitude is what’s made Apple steadily remove all traces of GNU from OS X.

    Reply

  17. WzDD
    May 9, 2007

    This is a good article, but I have to say the GNU comment is pretty out there. Mac OS X is built on various BSDs, notably FreeBSD, which has its own set of command-line tools that have nothing to do with GNU.

    Although OS X does use GNU tools (notably the compiler, ‘gcc’), none of the programs in this list are by the GNU foundation except the catch-all final two ‘programs’ which of course let you install your own GNU utilities if you like.

    What about the GUI? That’s the evolution of NextStep, a proprietary interface that came out of Steve Jobs’ previous company.

    Reply

  18. Blake
    May 8, 2007

    For screencapture if you really want .jpg format use -tjpg, or for GIF -tgif and the one that’s really cool: -tpdf

    Any format Quartz supports should work, a reference for all of them is here in table 3: http://developer.apple.com/graphicsimaging/workingwithimageio.html

    Reply

  19. Peter
    April 13, 2007

    Tip :

    http://rixstep.com/4/0/clix/

    Free & brilliant !

    Reply

  20. MCkin
    March 26, 2007

    Rob, you need to have developer tools installed, it is on the first install disk for your mac.

    apple doesnt think people want it, but they do its the firs thitng yous oudl do hwen yous inatll a new mac

    when you get a new mac youw ant delveopre tolls if you dont ahve tools then you are msising a lot of your amcs ptoentails

    Reply

  21. Rob
    March 20, 2007

    Not listed here, but I’m scouring Google to no avail trying to find out why every tutorial to build software from source says to use “make,” yet for some reason, when I try to do this, it says “make: command not found.” Email me?

    Reply

  22. lana
    January 1, 2007

    I can’t find ‘say’ utility. Can anyone help?
    Thanks

    Reply

  23. LrdDark
    December 19, 2006

    Actually, in response to an earlier post…No underneath Mac OS X is not UNIX at all, it is a flavour or a UNIX type of OS called FreeBSD. Check it out, your MAC will tell you this. God forbid if they actually used UNIX we would have fewer ports for it and the price of your MAC would be even higher, as if it doesn’t cost enough to get a MAC already. I love MACs especially now they lay over the top of FreeBSD, but jesus! Trynig to buy a decent MAC you practically need to get a house loan to pay for it!

    Reply

  24. dasfanvia
    December 10, 2006

    Great great

    Reply

  25. Klaith
    December 1, 2006

    Thanks for your kindness!
    I have already finished the translation and published here :)

    Reply

  26. Klaith
    November 29, 2006

    Hi, I’m a Mac user from China.
    I leant something in this post. I hope more Chinese Mac users are able to read it. So I want to translate it to Chinese and publish on my blog. Can I?
    I will appreciate your consideration about it.Thanks in advance.

    Reply

  27. Lorin Rivers
    November 28, 2006

    Another one, right up there with “top”, is ps. It’s frequently invoked with “-aux”. My favorite way is with “-auxwww” which returns all the detail, not just the first 80 characters. It help a lot with greping for things buried at the end of long file paths and what not.

    Reply

  28. Peter Hosey
    November 25, 2006

    lsbom: You can also do this in Installer. Choose “Show Files” from the File menu. Also, “cd ~Desktop” will cd to the home folder of the user named “Desktop”. You meant “cd ~/Desktop”.

    And what part of the OS X GUI is GNU?

    Reply

  29. Greg
    November 25, 2006

    Along with any of the screen capture hotkeys that people have mentioned, if you hold down ctrl while you do them the result will be saved to your clipboard rather than a file. Great for quickly getting them into photoshop.

    Reply

  30. JunkKai
    November 25, 2006

    A detail, the author should have been aware of: You may use the command ‘screencapture -iW ~/Desktop/screen.jpg’, but the file suffix will NOT tell the tool what picture file format to use. I normally use PNG for screen shots (default on Tiger) and the ‘screen.jpg’ truely becomes a PNG. Just try: screencapture -iW ~/Desktop/screen.txt

    Reply

  31. JunkKai
    November 25, 2006

    Lots of people mentioned cmd-shift-4 + spacebar, but there’s another handy feature while doing screen shots. Pressing ctrl while clicking your window or releasing the mouse while defining your rectangle, the pictures destination isn’t a file on the desktop, it’s the system clipboard. Using GraphicConverter type cmd-J, here it is. If you plan to continue working with the screenshot, this is the best way – avoiding a temporary file on the desktop.

    Reply

  32. JunkKai
    November 25, 2006

    Bryan, type ‘arch’ in the terminal and you know the architecture spec you have to use.

    Reply

  33. David Barragán
    November 25, 2006

    Muy interesante y útilísimo para los que nos gusta los atajo.
    ¿Nos puede enviar una lista de más mandos para el terminal?
    Siempre he tenidomiedo hacer algo con el termial pero ahora no gracias a ustedes.
    ¡Buen trabajo!
    David

    Reply

  34. Bryan Fonder
    November 25, 2006

    One question with the Lipo command. How would you tell it to strip away the Intel binary leaving only the PPC??

    Reply

  35. Bill Eccles
    November 24, 2006

    Hey! That’s nifty!

    Granted, I knew about “ssh” a long time ago, but never knew about “say.” That makes it easy to get someone’s attention if they’re near the server room. (How many times have you had to get someone to turn off the “Caps lock” when VNC’d into a machine? I’d resorted to opening TextEdit and using TextEdit>Services>Speach. This is a lot easier.)

    But it tends to scare people. Guess there’s a downside to everything.

    Reply

  36. jack
    November 24, 2006

    I recently found a very interesting website:
    http://alreadylinked.com/
    There you can purchase ad space for your Blog etc.

    Reply

  37. author of the article
    November 24, 2006

    yes, connect to an ssh server using -D8080, then in your browser prefs, tell it to you use a proxy server (socks proxy) tell it localhost, port 8080.

    Reply

  38. bikeham
    November 24, 2006

    In tip 1, you talk about your favourite use of ssh – to browse the web securely. That sounds exactly what I need, can you elucidate?

    Reply

  39. Dave
    November 23, 2006

    OK, seriously – how many people are going to add that “Screen Capture Tip” without realizing it’s already been said, a bazillion times!

    Anyhow, nice list. Thanks.

    Reply

  40. George Rich
    November 23, 2006

    lipo, lol i love it

    Reply

  41. Van Mardian
    November 23, 2006

    Regarding #8, there are better ways to do this.

    Entire Screen: Cmd-Shift-3
    Selection: Cmd-Shift-4
    Window: Cmd-Shift-4, spacebar

    Reply

  42. joe
    November 23, 2006

    Depending on what you do with your machine,
    I find
    lsof -i handy to see what you are connected to as well as who is connected to you via tcp or udp

    df -h will give you your drive space used and left as well as the drive space used and left on a mounded drive or share

    then if you are looking for a file be sure to look at the find command
    also if you want to compare 2 test files you should look at diff

    These are commands I use often that a user who is new to the CLI might not know about and it might make their lives easier

    Reply

  43. Thomas
    November 23, 2006

    As for screencapture.. I hope you are aware that cmd-shift-4 followed by space gives the exact same functionality as creencapture -iW ~/Desktop/screen.jpg

    Reply

  44. Greg Peel
    November 23, 2006

    Excellent, I like that lsbom, someone needs to make a drap and drop app like this

    Reply

  45. Nuno Sousa
    November 23, 2006

    Regarding the screencapture command, you can take a screenshot of a single window by pressing command+shift+4 and then spacebar.

    Reply

  46. Zac
    November 23, 2006

    Note, the same can be done for the screen capture by pressing Command-shift-4, then, rather than dragging out a custom window, pressing space. It will once again bring up the camera icon, and is much quicker to type.

    Reply

  47. Ari
    November 23, 2006

    There’s also textutil, which provides Cocoa apps with the ability to convert MS Word files to RTF, text, Web archives and WordXML as well as vice-versa.

    Reply

  48. Scott Stevenson
    November 23, 2006

    I don’t think it’s a good idea to muck around with stripping your application binaries of various bits of code. Aside of the possibility of mistyping something, some applications might inspect themselves to do sanity checks and version comparisons. You’re probably saving a few megabytes at most anyway. Less than one song.

    Let the application be itself. :)

    Reply

  49. Aidan Kehoe
    November 23, 2006

    ~/Desktop would be better as the path in #3.

    Reply

  50. Tice
    November 23, 2006

    Nice list, thanks! Didn’t know that say also works in the terminal.

    Reply

  51. alex santos
    November 23, 2006

    Regarding tip #8…instead of a command in term (which is cool to know about) try command-shift-4,he space bar will toggle the camera and a target.

    The camera is used for snapping up shots of windows you roll the mouse over and the target is used snap shots of a selection.

    I prefer this method myself.

    Reply

  52. smqt
    November 23, 2006

    About the screenshots:
    apple-shift-4
    you now see a crosshair
    press the space bar
    voila, you can select one window to cap
    :)

    Reply

  53. serenity
    November 23, 2006

    Regarding to taking screenshots – you do know that you can take pictures of parts of the screen (same as screencapture -i), or windows (screencapture -iW), using shift-cmd-4, and toggle between manual selection and capturing whole windows with the space bar?
    No need for command line utilities for simple tasks like that.

    Reply

  54. Billifer
    November 23, 2006

    The ditto command is also very useful. I think of it as cp on steroids. Or, rather, it’s cp, cpio, gzip, zip, and part of lipo all rolled into one! The good thing about ditto is that it preserves resource forks — or optionally ditch them — or even sequester them into a separate directory.

    ditto is my friend.

    Reply

  55. core
    November 23, 2006

    this is a pretty cool collection of commandline tools. thanks!

    Reply

  56. Luigi
    November 23, 2006

    DarwinPorts has switched its name to MacPorts:

    http://www.macports.org/

    Reply

  57. anonymous
    November 23, 2006

    I got a good laugh out of “say” :)

    nice tip. you may want to post a warning about “lipo”; always backup the file before surgery. if only that were possible in real life.

    Reply

  58. Mike Bedar
    November 23, 2006

    Command-Shift-4 will bring up a marquee tool to take a screenshot of a selected area. Pressing the space bar will change it to the camera window capture tool described in tip 8. Of course, you can’t specify the name this way..

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

`;e.insertAdjacentHTML(i,s)}return document.getElementById(t)}_repeatDynamicAds(t){const i=[],n=this._removeRecipeCapExperiment.result&&t.location===d.Recipe?99:this.locationMaxLazySequence.get(t.location),s=t.lazy?w(n,0):0,o=t.max,r=t.lazyMax,a=0===s&&t.lazy?o+r:Math.min(Math.max(s-t.sequence+1,0),o+r),l=Math.max(o,a);for(let n=0;n=o;i.push(e({},t,{sequence:s,lazy:r}))}}return i}_locationEnabled(e){const t=this._clsOptions.enabledLocations.includes(e.location),i=this._clsOptions.disableAds&&this._clsOptions.disableAds.all||document.body.classList.contains("adthrive-disable-all"),n=!document.body.classList.contains("adthrive-disable-content")&&!this._clsOptions.disableAds.reasons.has("content_plugin");return t&&!i&&n}constructor(e,t){this._clsOptions=e,this._adInjectionMap=t,this._recipeCount=0,this._mainContentHeight=0,this._mainContentDiv=null,this._totalAvailableElements=[],this._minDivHeight=250,this._densityDevice=u.Desktop,this._pubLog={onePerViewport:!1,targetDensity:0,targetDensityUnits:0,combinedMax:0},this._densityMax=.99,this._smallerIncrementAttempts=0,this._absoluteMinimumSpacingByDevice=250,this._usedAbsoluteMinimum=!1,this._infPageEndOffset=0,this.locationMaxLazySequence=new Map([[d.Recipe,5]]),this.locationToMinHeight={Below_Post:Ae,Content:Ae,Recipe:Ae,Sidebar:Ae};const{tablet:i,desktop:n}=this._clsOptions.siteAds.breakpoints;this._device=((e,t)=>{const i=window.innerWidth;return i>=t?"desktop":i>=e?"tablet":"phone"})(i,n),this._config=new ue(e),this._clsOptions.enabledLocations=this._config.enabledLocations,this._clsTargetAdDensitySiteExperiment=this._clsOptions.siteAds.siteExperiments?new we(this._clsOptions):null,this._stickyContainerAdsExperiment=new Oe,this._stickyContainerRecipeExperiment=new xe,this._removeRecipeCapExperiment=new ge}}function Pe(e,t){if(null==e)return{};var i,n,s={},o=Object.keys(e);for(n=0;n=0||(s[i]=e[i]);return s}class ke{get enabled(){return!0}}class De extends ke{setPotentialPlayersMap(){const e=this._videoConfig.players||[],t=this._filterPlayerMap(),i=e.filter((e=>"stationaryRelated"===e.type&&e.enabled));return t.stationaryRelated=i,this._potentialPlayerMap=t,this._potentialPlayerMap}_filterPlayerMap(){const e=this._videoConfig.players,t={stickyRelated:[],stickyPlaylist:[],stationaryRelated:[]};return e&&e.length?e.filter((e=>{var t;return null==(t=e.devices)?void 0:t.includes(this._device)})).reduce(((e,t)=>(e[t.type]||(C.event(this._component,"constructor","Unknown Video Player Type detected",t.type),e[t.type]=[]),t.enabled&&e[t.type].push(t),e)),t):t}_checkPlayerSelectorOnPage(e){const t=this._potentialPlayerMap[e].map((e=>({player:e,playerElement:this._getPlacementElement(e)})));return t.length?t[0]:{player:null,playerElement:null}}_getOverrideElement(e,t,i){if(e&&t){const n=document.createElement("div");t.insertAdjacentElement(e.position,n),i=n}else{const{player:e,playerElement:t}=this._checkPlayerSelectorOnPage("stickyPlaylist");if(e&&t){const n=document.createElement("div");t.insertAdjacentElement(e.position,n),i=n}}return i}_shouldOverrideElement(e){const t=e.getAttribute("override-embed");return"true"===t||"false"===t?"true"===t:!!this._videoConfig.relatedSettings&&this._videoConfig.relatedSettings.overrideEmbedLocation}_checkPageSelector(e,t,i=[]){if(e&&t&&0===i.length){return!("/"===window.location.pathname)&&C.event("VideoUtils","getPlacementElement",new Error(`PSNF: ${e} does not exist on the page`)),!1}return!0}_getElementSelector(e,t,i){return t&&t.length>i?t[i]:(C.event("VideoUtils","getPlacementElement",new Error(`ESNF: ${e} does not exist on the page`)),null)}_getPlacementElement(e){const{pageSelector:t,elementSelector:i,skip:n}=e,s=V(t),{valid:o,elements:r}=s,a=Pe(s,["valid","elements"]),l=L(i),{valid:c,elements:d}=l,u=Pe(l,["valid","elements"]);if(""!==t&&!o)return C.error("VideoUtils","getPlacementElement",new Error(`${t} is not a valid selector`),a),null;if(!c)return C.error("VideoUtils","getPlacementElement",new Error(`${i} is not a valid selector`),u),null;if(!this._checkPageSelector(t,o,r))return null;return this._getElementSelector(i,d,n)||null}_getEmbeddedPlayerType(e){let t=e.getAttribute("data-player-type");return t&&"default"!==t||(t=this._videoConfig.relatedSettings?this._videoConfig.relatedSettings.defaultPlayerType:"static"),this._stickyRelatedOnPage&&(t="static"),t}_getMediaId(e){const t=e.getAttribute("data-video-id");return!!t&&(this._relatedMediaIds.push(t),t)}_createRelatedPlayer(e,t,i,n){"collapse"===t?this._createCollapsePlayer(e,i):"static"===t&&this._createStaticPlayer(e,i,n)}_createCollapsePlayer(t,i){const{player:n,playerElement:s}=this._checkPlayerSelectorOnPage("stickyRelated"),o=n||this._potentialPlayerMap.stationaryRelated[0];if(o&&o.playerId){this._shouldOverrideElement(i)&&(i=this._getOverrideElement(n,s,i)),i=document.querySelector(`#cls-video-container-${t} > div`)||i,this._createStickyRelatedPlayer(e({},o,{mediaId:t}),i)}else C.error(this._component,"_createCollapsePlayer","No video player found")}_createStaticPlayer(t,i,n){if(this._potentialPlayerMap.stationaryRelated.length&&this._potentialPlayerMap.stationaryRelated[0].playerId){const s=this._potentialPlayerMap.stationaryRelated[0];this._createStationaryRelatedPlayer(e({},s,{mediaOrPlaylistId:t}),i,n)}else C.error(this._component,"_createStaticPlayer","No video player found")}_shouldRunAutoplayPlayers(){return!(!this._isVideoAllowedOnPage()||!this._potentialPlayerMap.stickyRelated.length&&!this._potentialPlayerMap.stickyPlaylist.length)}_determineAutoplayPlayers(){const e=this._component,t="VideoManagerComponent"===e,i=this._context;if(this._stickyRelatedOnPage)return void C.event(e,"stickyRelatedOnPage",t&&{device:i&&i.device,isDesktop:this._device}||{});const{player:n,playerElement:s}=this._checkPlayerSelectorOnPage("stickyPlaylist");n&&n.playerId&&n.playlistId&&s?this._createPlaylistPlayer(n,s):Math.random()<.01&&setTimeout((()=>{C.event(e,"noStickyPlaylist",t&&{vendor:"none",device:i&&i.device,isDesktop:this._device}||{})}),1e3)}_initializeRelatedPlayers(e){const t=new Map;for(let i=0;ie-t))}filterUsed(){this._map=this._map.filter((({dynamicAd:e})=>!e.used))}reset(){this._map=[]}constructor(){this._map=[]}}class Me extends Ie{}try{(()=>{const e=new W;e&&e.enabled&&(new Ee(e,new Me).start(),new Re(new K(e),e).init())})()}catch(e){C.error("CLS","pluginsertion-iife",e),window.adthriveCLS&&(window.adthriveCLS.injectedFromPlugin=!1)}}();
Back to top
mobile desktop