Slashdot Mirror


Ask Slashdot: Command Line Interfaces -- What Is Out There?

Mars729 writes "GUIs are walled gardens in that features available in one piece of software is not available to other pieces of software. However, there is software out there with command-line options that can make software features accessible to power users and programmers. Some important ones I have uncovered are:
  • Exiftool: A command-line application that can read/write almost any kind of metadata contained in almost any filetype
  • Imagemagick: This and similar software like GraphicsMagick is a full-feature toolkit for displaying, converting and editing image files.
  • Irfanview: Like Imagemagick but faster, although it has much fewer features.
    FFMpeg: For video files
  • VLC: For audio and video files
  • Aspell: A command line spell checker
  • Google Static Maps API: A URL with coordinates, markers, zoom levels and other options to show a custom map from Google Maps. (I just uncovered this: no need to learn KML!)

Less useful but still useful are command shells. These provide file management mostly. I believe some of them may allow for sending and retrieving email messages. Also useful but less accessible and with a steeper learning curve are software with APIs and scripting. Examples would be Visual Basic for Applications in office software and groovy scripting for Freeplane. What else is out there?"

25 of 383 comments (clear)

  1. What is this? by Anonymous Coward · · Score: 4, Insightful

    This isn't worthy of being a story, we all grew up using command lines.

    1. Re:What is this? by weilawei · · Score: 4, Informative

      I'd like to bash the submitter. Command shells less useful my ass. Pretty much the entire *nix world is built around shells and files, with variations on a theme thrown in (pipes, sockets, etc.). Welcome to what the rest of us have known for decades.

    2. Re: What is this? by Anonymous Coward · · Score: 5, Insightful

      It appears that lots of people recently have been condemned to reinvent Unix, poorly.

    3. Re:What is this? by hsa · · Score: 4, Informative

      OP is just discovering the command line and finding out, that you can actually do almost anything with it.Don't bash his learning process (pun intended).

      Take a webcam picture:
      streamer -f jpeg -o image.jpg

      Do magic with that picture:
      convert image.jpg -colorspace Gray image_gray.jpg

      And do check out rest of the ImageMagick:
      http://www.imagemagick.org/

    4. Re:What is this? by geoskd · · Score: 4, Interesting

      You haven't worked with corporate VB programmers too much, have you?

      As someone who has done an unfortunate amount of "corporate VB programming", I can say several things with certainty.

      1) Anyone who must admit that they have more experience with VBA than anything else should not claim to be a programmer. At best, the title script kiddie should apply.

      2) I am actually functionally dumber for having learned VBA.

      3) The world will be a better place when Microsoft is dead and buried. VBA was a bad idea that looked really good on paper. It gave a large number of people the ability to write quick and dirty tools for doing things in spite of the fact that these people had no business writing software in the first place. In the short term, these "programmers" filled a direct need, but in the long run, they have created a nightmare of sustainability that costs more to maintain / recreate than it ever saved in the first place. I have spent entirely too much time debugging and rewriting VBA tools because some unqualified hack made a tool to save themselves time on processing reports, and now I have to waste huge amounts of time fixing it to be robust, when they should have just hired a programmer to do it right in the first place. I find that most of the time its best to just scrap what was written and start over rather than try to follow the existing schizophrenic and undocumented code.

      --
      I wish I had a good sig, but all the good ones are copyrighted
    5. Re:What is this? by dgatwood · · Score: 4, Informative

      And do check out rest of the ImageMagick: ...

      And if you happen to be using OS X, also check out sips(1). It does much of what ImageMagick + DCRaw does, but a lot faster.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    6. Re:What is this? by i.r.id10t · · Score: 4, Interesting

      And based on the students I teach in my "intro to linux" class, a good 30% are dependent on GUIs and aren't capable of becoming half way competent in using a command line only system over a 14 week term.

      Typically, these are the same students that are in a networking track because "i'm good at helping grandma with facebook and I like to play world of warcraft" - not because they are curious about computers and networking

      --
      Don't blame me, I voted for Kodos
    7. Re:What is this? by msauve · · Score: 5, Insightful
      "could start saying that pop3 is a commandline then too"

      It isn't?

      locke:~# telnet 127.0.0.1 110
      Trying 127.0.0.1...
      Connected to 127.0.0.1.
      Escape character is '^]'.
      +OK Dovecot ready.
      user myname
      +OK
      pass mypass
      +OK Logged in.
      stat
      +OK 863 28261240
      retr 1
      +OK 3108 octets
      ...[email text]...

      Of course, what you'll quickly find is that the OP isn't the only clueless one. Other Internet newbies like Microsoft and Google have gone out of their way to make their customer's emails illegible.

      --
      "National Security is the chief cause of national insecurity." - Celine's First Law
    8. Re:What is this? by serviscope_minor · · Score: 4, Insightful

      hate on me ALL you want but anybody who is honest will admit its true,

      the hating on you will be for using a blatant "no true scotsman" fallacy, not for disliking the gui. You're a massive wanker for claiming I'm a liar because I disagree with you.

      you can completely remove CLI access from Windows and OSX and ya know what? The user would be fine,most wouldn't even notice that it was gone.

      Not if the user in question was me. In fact I know quite a lot of people who install the cygwin commandline stuff for Windows because the builtin commandline is not very good. And then there's the MinGW effort. Apparently enough people miss the commandline that there are not one but two competing efforts to bring a good commandline to windows.

      Fiven that they're Free that means there are enough people wanting that that there are enough developers from withing that subset to make two.

      That's a lot of people and you're dishonest if you don't agree, naturally.

      Try removing access to the CLI for just one year in the Linux of your choice, I DARE you.

      Why the fuck would I want to do that?

      The first time you run into a problem the ONLY CHOICE you will have to fix it is "Open up Bash and Type"...that's it, that is all.

      Well, no. That's true in some cases, but then registry hacks are true in some cases in Windows and commandline-fu is the only solution in some cases in OSX. Not sure what your point is.

      Hell just ask for a non Bash solution and watch the howls of impotent rage!

      So basically, you ask people to donate their time to you for free and they do. They give you an answer in a clear, succint way which doesn't involve the rather tricky comminucation of visual information in a forum and you have the entitledness to complain that they're not helping you "the right way".

      Wow, you sound like an asshole.

      If there is anything that Android and ARM should have taught it is that the future is NOT some 40+ year old throwback to the age of disco UIs, its intuitive, easy to discover,and easy to learn is THE way of the future!

      Except that it's not unless you have very limted horizons. And ARM was in fact developed to run an OS with an integrated commandline.

      So, mr. intiutive, how do I script repetitive actions in my workflow on Android?

      Linux....except that too many have taken CLI as their religion, their way to "test the faith" and see if the user is "worthy" to be part of the little club.

      You're the one who sounds like a religious nutball. I happen to like the commandline. I really don't care if you do. You seem to care that I like it. that's got religious quackery written all over it.

      Oh and almost forgot, of course you're dishonest if you don't agree with me.

      --
      SJW n. One who posts facts.
  2. My head just exploded. by philip.paradis · · Score: 4, Insightful

    Quoting the summary:

    Less useful but still useful are command shells. These provide file management mostly. I believe some of them may allow for sending and retrieving email messages.

    Yes, my head just exploded. Please pardon the mess, aggressive renovations are in progress. I'm absolutely awestruck that this made it to the front page of /., and suddenly feel extremely old at 32.

    In short, if you are experiencing a lack of flexibility with GUIs, which is a completely normal response in my book, please proceed to install your favorite Linux/BSD/Whatever-nixish distribution and learn to use the following:

    • Shells, at minimum a Bourne-compatible shell
    • Bash, Perl, and Python
    • Man pages

    I really, truly, honestly, brain-explodingly do not know what else to say here. Holy crap.

    --
    Write failed: Broken pipe
    1. Re:My head just exploded. by mvar · · Score: 4, Insightful

      First this Tips for your new laptop and then this.
      I have a feeling that there's more shitty noob advice to come on this site from now on..Holy crap indeed

  3. "Less useful but still useful are command shells"! by Viol8 · · Score: 4, Insightful

    I'm sorry, is this a joke? The Windows command line - even with powershell - might be a crippled joke, but the unix command line allows you to control *everything* going on in the OS itself and most features of whichever Desktop you're using. Plus the ability to pipe commands together creates a level of poweruser control that is far greater than the sum of its parts. Something Microsoft took 2 decades to realise and a paradigm that a lot of Windows admins still don't "get".

  4. PowerShell by jones_supa · · Score: 4, Informative

    PowerShell deserves a mention too. Some people hate it, some people love it.

    It is object oriented so the data transfer between processes is more robust. Also all the commands' manual pages come with extensive documentation and lots of great examples. UNIX man pages usually lack examples.

    1. Re:PowerShell by benjymouse · · Score: 5, Informative

      It is object oriented so the data transfer between processes is more robust. Also all the commands' manual pages come with extensive documentation and lots of great examples. UNIX man pages usually lack examples.

      Most bashers (no pun intended) miss several aspects of PowerShell simply because they view it as just another shell.

      One such aspect is the fact that PowerShell is designed to operate directly with an application's core logic (the object model) whether that application was designed using COM or .NET. Virtually *all* of Window's features and even 3rd party applications for Windows are designed using one of those models. So the barrier to exposing the functionality to the CLI (PowerShell) is really, really low, and even older applications that predates PowerShell or that were never designed for PowerShell (like iTunes) lend themselves to CLI manipulation. Forget about needing to craft a suite of external CLI tools - your app is inherently exposed to command line manipulation.

      Another often overlooked aspect is how PowerShell is designed to run in-process within an application. The CLI is just *one* possible host for PowerShell. Alas, you can add the PowerShell engine to your app and immediately leverage existing commands to manipulate the in-process memory objects of your application. So not only is it *easy* to expose your application to automation, you can actually take advantage of the PowerShell engine to save work for your own in-application automation. With workflow engine integration in PowerShell 3.0 (it is now at 4.0) this is a great way to orchestrate workflows activities in an easy-to-manage way.

      --
      Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
  5. Great topic by Ceriel+Nosforit · · Score: 4, Informative

    mulk - much needed modernization of wget's functionality
    qrencode - copy-paste from the desktop to a mobile device, or maintain an airgap
    iotop - like htop for IO
    history - built into bash, re-issue old commands as !number
    pkill - kill programs indiscriminately
    youtube-dl - keeps working even though google has almost killed youtube
    netstat -lnp - see which program is bound to which port
    vim - it won't make sense until you install plugins like spf-13, learn a few key combinations and set :color ir_black
    tar -zxvf - you can remember it because the keys are right next to each other
    pxz - parallel LZMA compressor
    alasamixer - volume control
    locate - find files, update the index with updatedb

    Looking forwards to see more!

    --
    All rites reversed 2010
  6. What the f**king f**k? by YuppieScum · · Score: 4, Insightful

    "GUIs are walled gardens in that features available in one piece of software is not available to other pieces of software.

    Never mind it should be "are" not "is", under what circumstances would you ever be surprised that the features provided by Excel are not available in PhotoShop... with the exception of cut/copy/paste?

    Did I miss a meeting where meretricious twaddle on this site became de rigour?

    Maybe I should resign my ID...

    --
    This sig left unintentionally blank.
    1. Re:What the f**king f**k? by philip.paradis · · Score: 4, Insightful

      Man, my original ID was in the 75K-ish range, and I'm seriously debating whether this was (1) a troll submission that got through, or (2) a tactical move to get folks like us to finally just say "fuck it" here and move along while Dice moves along to pursue the new, hip, trendy, GUI-loving, tablet-toting, no-fucking-idea-whatsoever-how-things-work-at-all crowd for ad views. I honestly don't know, but I can safely say this is the most ridiculous thing I've ever seen posted to this site.

      --
      Write failed: Broken pipe
  7. Don't start bashing the curious by cerberusss · · Score: 5, Insightful

    Obviously the submitter didn't grow up with a unix background, as lots of people here have. And now I see lots of people asking what the hell submitter is thinking, "is this a joke", "not worthy of a story" et cetera.

    But think about it. Submitter came from a GUI background and now discovers the commandline. I'm thinking back when I started with Linux, feeling totally amazed about so much utilities, so much power and I kinda envy the submitter :)

    So give it a rest and just chip in.

    --
    8 of 13 people found this answer helpful. Did you?
  8. Re:Mod parent up by Anonymous Coward · · Score: 5, Funny

    Mod parent up

    I can't because /. doesn't have a command line interface for moderation.

  9. Soulskill: please don't drink and post by wjcofkc · · Score: 4, Insightful

    GUIs are walled gardens in that features available in one piece of software is not available to other pieces of software.

    Setting aside the fact that this statement makes no sense, I suspect it was crafted around using the term "walled garden" in a misguided effort to establish nerd street cred. Mission failed.

    However, there is software out there with command-line options that can make software features accessible to power users and programmers.

    Out of all of the CLI based software the submitter could have chosen, the selection demonstrates that they are neither a power user or a programmer.

    Less useful but still useful are command shells.

    Holy fuck. Seriously? What I am supposed to run my CLI based software in to begin with. Never mind everything else about a shell that runs deep.

    The bullet points caught my eyes first, I knew right away it was going to be bad, but this? This article making the front page is an insult to the majority of Slashdot's user base and an affront to our intellect and skill sets. Also, it reads like it was written by a second-grader.

    --
    Brought to you by Carl's Junior.
  10. Re:CLI's Are Not Walled? by gtall · · Score: 4, Informative

    The best mix I ever saw was with Apple's MPW Commando interface. They had a unix like script language, but when you couldn't recall the special arcane syntax of some command, you could just hilite the command name and hit a key. A Commando dialog box came up formatted with radio buttons, checkboxes, etc. which recorded every dodad the command could use. Clicking and typing into the dialog fields built the text command for you in a pane at the bottom of the dialog box. When you were done, you could hit the run button or copy and paste the command into a command line window or paste it into a script you were building.

  11. 2014 resolution: mellow out by hodet · · Score: 4, Insightful

    The elitists are out in full force today. Ya the submission is nothing new to many of us but instead of ripping submitter a new one why not share your knowledge with him. Back in 97 I bought Oreilly's Linux in a Nutshell reference book. That book is still on my desk today, beaten up an tattered but sill useful.

    Happy New Year fellow neckbeards! ;-)

  12. More CLI-Fu by Bob9113 · · Score: 4, Informative

    Less useful but still useful are command shells. These provide file management mostly.

    Ohhh, baby. If you think ImageMagick is cool by itself (and it is), just wait 'til you start to grok how powerful those "less useful" command shells are for gluing those complex tools together. It will blow your hair back.

    Say you have a directory tree with a few hundred images scattered through it, and you want to create thumbnails for all of the images in a parallel directory structure; ImageMagick will do the thumbnail part, CLI-Fu will handle the directory traversal and turn a three hour job in to a three minute one.

    Learn these for starters:

    sed - text parser and transformer, for mutating file names and munging commands
    awk - ultra-terse programming language, great for building more complex commands than you would with sed
    find - traverse a directory tree and list files with conditional matching
    xargs - process a large list of things (like files found with find) in batches
    grep - filter out elements of a list based on string pattern matching
    egrep - enhanced grep, includes more advanced patterns and wildcards
    sort - sort lists numerically or alphabetically
    wc - count the elements of a list, words in a line, or other things
    wget - download a URL
    curl - read a URL to stdout

    Seriously, when you start piping those things together with the more complex command line tools like ImageMagick and FFMpeg, you will be astonished at the mass data processing you can do with a few dozen characters on the command line.

  13. Re:New users don't know about CLI by Half-pint+HAL · · Score: 4, Interesting

    We live in the 21th century. By now no one should use things like grep, sed or awk anymore.

    Yes. It would be wrong to use tried, tested and computationally efficient tools. If it doesn't have a GUI that slows me down and reduces my operational efficiency, and a crapload of bugs that won't be fixed before being obsoleted, I don't want to know about it.

    --
    Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
  14. Re:New users don't know about CLI by hawguy · · Score: 5, Informative

    New users never heard about bash. We live in the 21th century. By now no one should use things like grep, sed or awk anymore. The developers around systemd make sure that this functionality is soon hidden away from the audience.

    Right, and that's the problem, new users don't understand how to use command line tools so everything gets loaded into a GUI like Excel or Access. We had a user insist that he had to have MS Access so he could process a big log file to extract a few records from it -- it was too big for Excel. He was a couple hours into figuring out how to get the file loaded into an Access table when someone asked me if I could help. 10 minutes after installing ActiveState Perl, I wrote a script to extract the records they needed, it ran for a couple hours to churn through over 100 gigabytes of data (limited by the speed of the fileserver), then after we had the data, I used a couple regular expressions to pull the data fields they needed out of a free form text field, and then 20 minutes later, used the data in the file to output the SQL commands that they needed to fix up the database (which is why they where looking through the file in the first place). They had originally planned on spending at least 3 days on this project. The Windows "find" command line took may have helped preprocess the file, but its lack of regular expression support would have meant running it dozens of times to get all of the data they needed.

    Command line tools are still useful, even in the 21th century. If I didn't have Perl, then grep and/or awk would have been able to extract the data with a single pass through the file.