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?"
You all will love to use
systemctl
journalctl
The first shows all services running on Linux
The last shows all binary logging on Linux
Get used to those commands because its the defacto standard now.
This isn't worthy of being a story, we all grew up using command lines.
There is even more to uncover there!
How is this news for nerds? Maybe it's for nerds, but it's far from being news. It's more like common knowledge around Slashdot.
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:
I really, truly, honestly, brain-explodingly do not know what else to say here. Holy crap.
Write failed: Broken pipe
are the mods are all drunk?
If you are doing windows and still doing Visual Basic for Applications for general scripts you are part of the problem and really behind in your skill level.
Powershell has easily replaced most VBA script usage, there are still a few special cases where it has to be used.
Is this some sort of joke?
A Unix-style shell is the most useful command line interface. It is itself its own scripting language.
There are various ones. The most popular is bash, but there are also fairly different ones like fish.
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".
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.
mulk - much needed modernization of wget's functionality :color ir_black
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
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
I have been reading Slashdot for over 10 years.. this would have to be one of the worst 'news for nerds' stories I have ever seen.
I need to find a new watering hole.
"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.
GUIs are walled gardens in that features available in one piece of software is not available to other pieces of software.
The best programs do have scripting interfaces but just because a program lacks a graphical interface doesn't mean it's properly scriptable.
Howdy howdy howdy
The movie Titanic was rendered, in no small part, with Amigas running AREXX to control the per-frame rendering and result submission. Many Amiga applications included an AREXX interface port (I used the one in the terminal emulator for automated dialing).
PC-DOS 6 (The IBM release, that also included CDROM drivers, and came on CD), had an IBM port of mainframe REXX, as well.
Are you going to tell these old fossils about bookmarklets too? =)
All rites reversed 2010
and that is the VMS DCL
Built-n context sensitive help with examples. Not need for those terrible things called 'man' pages. Nary and example in sight in them.
VB was BASIC, then it was Pascal, then pretty well cut down Java. Where do you want to go today?
You won't be able to do it the same way tomorrow.
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?
although it has a built-in python command prompt i.e. it's python it does have that as an actual tab, with the electrum python module pre-loaded. really handy.
... of any less value than the others.
From http://abstractionphysics.net/pmwiki/index.php
Primary computer user interfaces:
Nature likes three (3) in primaries, as color in light (additive - red, blue, green) and paint (subtractive - blue, yellow, red) from which we can create all other colors in the rainbow. This applies to abstraction physics as well, as applied through the tool of computer, for there are three primary user interfaces. The command line, the Graphical User interface (GUI) and the side door port to application and functionality access (known by many different names and application levels such as API, IPC, DCOM, dcop, D-BUS, Plumber, computer sockets, etc., but each having its limitation and typically not so end user friendly as the concept should be.) And like the primary colors, if you take one away or limit its use, you constrain the ability of the user in putting new automatons together or modifying existing ones. Causing false limitations in user ability also applies to the abstraction actions mentioned above, constrain access and you constrain users ability to create or modify.
Why The Matrix was inside it green until the end of the third where the sky was full color. Why there were "THREE" power lines to the robot city...
Mod parent up
I can't because /. doesn't have a command line interface for moderation.
Others have already pointed out how bizarre the original story is, but there seems to be no mention of AppleScript. If you're on OS X, you get the Unix command line plus scriptable applications through AppleScript with raw scripts or GUI-built actions through Automator. It's all built in to a clean installation of the OS. Amiga afficionados should be familiar with the concept via ARexx.
Many third party application support AppleScript, though as the environment seems to gain more and more inexperienced and/or lazy programmers, proper integration into the OS X framework environment seems to get worse and worse. That includes code from Apple. Given the extremely sharp decline in Apple's software quality over the last couple of years across all of their platforms, it's currently rather hard to recommend any of it. Probably needs to be filed under "a very good idea, destroyed by the incompetence of the modern software industry".
Looks like the you are a windows user.
In which case, there is only one thing you need, and that's Cygwin. It is a GNU environment on Windows.
http://www.cygwin.com/
-- Sig Sig Sputnik
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.
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.
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.
isint ffmpeg superseded? Don't know if the new one is better or not...
GUIs are walled gardens in that features available in one piece of software is not available to other pieces of software.
If only Members of Congress were programmers, companies would be modular entities instead of the monolithic monsters they are now.
If Pandora's box is destined to be opened, *I* want to be the one to open it.
The AT&T Documenters Workbench has the best spell checker I have ever used. If you keep spelling "the" as "xqy", it learns and copes to the point where it can will offer "then" to xqyn". It knows that "rhw" might be "the" as well as "tje" is "the" as it knows keyboard layout. It was also the best spell checker for then/than lose/loose and it would adapt its dictionary based on reading level so it won't get tripped up on efficiency/efficacy
Someone needs to find out who (if anyone) owns the copyright and make it open source friendly.
AT&T had other tool kits too that would be very useful to the modern world but they seemed to have disappeared.
Nah let's forget it and go into space.
You can always improve the situation by submitting articles. I do that every now and then, and that way get to govern what appears on the front page.
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.
Shell commands do provide file management, and the moment you realize that almost everything is a file you can start to understand the power of shells. Email messages are nothing but files, they are just on another computer and the shell gives you access to them. The same goes for web pages (wget, links/lynx and even telnet to port 80), video, pictures, sound, invoices, games, even your screen/keyboard/printer/network have an abstraction as a file, whatever...
I used to teach a 3 months Linux system administration class. The first two weeks my students had no GUI at all, just a shell prompt. The idea behind it was: whatever problem you have, once you have shell access you can start to solve it.
After using the system for two weeks in shell mode, I let them install whatever GUI they like. About half my class was on gnome, the other half on KDE and a couple were using OpenBox or something else. The point is: it did not matter which GUI they were on, it was just a tool to open a terminal window, everything was done on the shell anyway. In the beginning of the course, everybody had to use the same distro (SuSE), but by the end of the course the students could use any distro or even BSD or HP/UX (we had an HP Itanium system on loan, because I had called it "Itanic" to one of their sales reps and he wanted me to prove me wrong). For most things this again did not matter, and for the things where it did matter (for example firewalls, boot sequences, virtual file systems) it was interesting. For the final exam they had to install an operating system with mail/SaMBa/Apache server using a distro they had never used before, manually editing the configuration files using vi or whatever text editor they liked most. They also received a spreadsheet with usernames and default passwords which they had to convert to a text file and write a script to create the user accounts with correct privileges from that file (they did not get enough time to click on "add user" 200 times). My students went on and became great sysadmins.
Once you really know how to use the shell, most differences between *nix systems become almost transparent and tedious jobs can be automated easily. So, NO, shells are not "less useful" - shells unlock the true power of your computer.
/. refugees on Usenet: news:comp.misc
I've probably been here longer than quite a lot of people.
It's exactly that kind of attitude that puts me off. Especially when, when something does seem newsworthy for here, seemingly the most contrived, error-ridden, broken-linked summary of the situation that assumes everyone knows what every acronym means and exactly what we're talking about (without explanation) is the one that makes it to the front page IF ANY AT ALL.
Sorry, but Slashdot is a shadow of its former self, and I used to browse it happily in work (IT-based, obviously) and we'd all learn from it. Now I'd be ashamed to show the front page to someone, even with my author/story filters turned on. It's now just a "this place was cool once, look how cool I am to be hanging out in this old place that was cool once" kind of place for most people.
There's still discussion, and still the occasional interesting article, and dammit I've paid for my account on here, so I still pop back often, but to be honest, I've given it up several times when they've done stupid shit (like the business section, video adverts for a hood with pockets, etc.) and it eventually all died down and so I came back. But each time I go, I go for longer. And each time I go, it's harder to force myself to go back.
To be honest, this is a pretty minor infraction compared to some in the past but it all loses readership.
The two I use a lot in a terminal is bc and cal.
.bashrc:
Put this in your
alias bc='bc -i -l' Then just run bc for a interctive calculator:
(18*(567/23))+67
510.73913043478260869548
e.g.
and cal is brilliant.
cp /dev/sr0 whatever.iso
I didn't know that and I have needed that command for 15 years. Thanks, you made this topic worth my time!
All rites reversed 2010
Don't dismiss so easily the plumbing tools as minor, good part of the magic on everything happens there, a lot of things have command line interface (even destop programs like openoffice, or gimp), of course a lot of servers can be accessed by commands (mysql, wget/curl) or even for pure graphical tools, you can script a lot with i.e. D-Bus. But something that combines the pieces, like, don't know, extracting urls from a mysql table, obtaining the images from there, making a collage and putting it as background on your desktop, requires just a few lines (if indented) in bash, where the small tools connecting the dots plays an essential role there.
Setup a virtual machine, or a partition, install a BSD (I'm partial to NetBSD), and go to it. Skip the graphical interface packages on installation.
You want to learn about this, here's how most of us did it (flavor and variant will vary of course). Your motivation determines how much you will learn. Enjoy.
LOAD “$”,8 - Now that was useful!
I don't know really. When I look Slashdot articles published 10 years ago, they are the same stuff. Even the same whining of Slashdot jumping the shark has always been there.
In the spirit of "command-line tools I use all the time":
sed - search and replace within files
git - redistributable file system that tracks changes, often used for version control of text files
ssh - secure command-line connection to another machine
scp - secure copy between machines
diff - compare differences between files
"We receive as friendly that which agrees with, we resist with dislike that which opposes us" - Faraday
Happy New Year. Whose going to get the FTF?
.nl, .de,...) ...
From http://geo.rkkda.com/. All are bash and awk tools run via a terminal. Lots of them build upon gpsbabel (e.g. geo-nearest), or ImageMagick (e.g. reverse-montage) or, you get the drift.
Tools for accessing gc.com...
(SO) : this program works only for gc.com subscribers
geo-found List caches found (by you or someone else)
geo-nearest List the nearest caches to a location
geo-newest List the newest caches in a state
geo-placed List caches placed (by you or someone else)
geo-keyword List caches by keywords.
All of the above can enter the waypoints into the
GpsDrive MySQL database.
geo-html2gpx Convert a gc.com printable web page (such as the
above commands can produce with the -H option) to
a GPX file.
geo-count Count caches found
geo-usernum Determine gc.com user number (used by geo-count)
(SO) geo-gid Retrieve cache info by GCxxxx waypoint name
(SO) geo-gpx Retrieve GPX file by GCxxxx waypoint name
(SO) geo-demand Request an immediate pocket query email
(SO) geo-gpxmail Process PQ email using gpx2html
(SO) geo-gpxprocess Process PQ download(s) using geo-pqdownload and gpx2html
(SO) geo-pqdownload Perform a Pocket Query download(s)
(SO) geo-myfinds Schedule a Pocket Query containing your finds.
(SO) geo-rehides From your found.gpx file, produce a GPX file of rehides
(SO) geo-correct-coords Correct the coords of cache(s)
geo-density Compute cache density of an area
gpx2html Lightly hacked converter from GPX to HTML
Originally by fizzymagic (v1.90). My version
fixes issues with HTML in the cache descriptions, adds
sort by latest log date for easy perusing of recent
cache activity, and fixes bug in GC[1-9]xxxx.
gpx-loghistory Print all logs in reverse cron order.
geo-pqs Figure out what PQs to run to get an entire state.
geo-state Convenience script; geo-state -? gives usage.
geo-sdt Replace Size, Difficulty, Terrain from a PQ file
geo-suffix Replace name with name/TypeSizeDiffTerr/gcid/LatLon
geo-uniq Unique the tabsep database
Tools for accessing opencaching.com...
oc-nearest List the nearest caches to a location
oc-newest List the newest caches in a state
EXPERIMENTAL, subject to drastic changes
Tools for accessing opencaching.us (and
ok-nearest List the nearest caches to a location
ok-newest List the newest caches in a state
EXPERIMENTAL, subject to drastic changes
Tools for accessing navicache.com...
nc-nearest List the nearest caches to a location
nc-newest List the newest caches in a state
I've been seeing the love for CLI's in a couple of articles here lately, and I'm wondering... why are GUI's "walled gardens", and CLI's are not? The CLI's have their definite boundaries as well. You can't run a function using a system utility that doesn't support it.
At best, I'd call GUI's walled gardens, and CLI's (larger) fenced in fields with rocks and weeds along with the trees and flowers. Definitely more versatile, not as friendly for some uses.
To get out of the boundaries of either a GUI or a CLI, you can just write your own code, to create... a GUI or CLI application. You can write a script, or put the equivalent function into a GUI app.
Disclosure; I've been computing since the Olivetti P-6060 was a cutting edge machine. http://www.old-computers.com/museum/computer.asp?st=1&c=407
/rdb - definitely not free, but a fascinating use of the shell and shell extensions as a database management system. Don't know if it's even still available. The NoSQL developer Carlo Strozzi said that he was inspired by it. Used to be at http://www.rsw.com./ An excellent white paper, "The UNIX Shell As a Fourth Generation Language" describes it, and there was a book too - "Unix Relational Database Management". I used it nearly 20 years ago for a retirement home's database when their DOS/dBase system broke down. Slackware Linux version 1 ran fine on their old PC. In fact, that was my first Linux kernel compilation.
great. I've been looking for a good command line spell check. All the graphics on the gui spell checkers are very distracting.
ôó
Great question.
Bitcoin: https://github.com/spesmilo/sx , GoxCLI
Calandar; 'cal'
wget, curl with cut, grep & awk
mplayer... with acsii output, transcode,
irc bots such as malware command and control interfaces - are there benign examples?
There are very few financial command line tools. It's strange but there doesn't seem to be a way to buy or sell securities, forex or futures.
Can anyone tell me why you can't |pipe| GUI programs....? Why can't you pipe audio live from /dev/urandom from a terminal to audacity for example?
A blog I run for the wealth
Now I wouldn't even comment on this story, but I have recently been wondering why we haven't seen new developments in command line shells in the last couple of decades or so. The last big advance was tab completion in bash and then we just... stopped. Now I could see the argument that bash does everything we need it to, but I'm not sure I completely buy that. For one thing I'm constantly working around deficiencies in the shell. For another, we have seen OS advances we could be taking advantage of.
The UNIX shell model for the last three decades is, you run a program and the shell finds it in the path, forks a child process, execs the program and waits on the child process. When the child process exits, the shell resumes and has the return status of the child process available for examination. And that does actually have its place. But it doesn't need to be all there is anymore. With threads, there's no reason not to have the ability to initiate a program in parallel in the same memory space. Obviously there are some drawbacks to that -- if the program crashes, you'd lose your working shell. But it'd have some advantages, too -- the program could modify the shell's environment, share or persist objects in local memory, and customize the shell's behavior much more easily than we do today. We'd move from having files on disk to having resources we can take advantage of. Naturally you should still be able to revert to the old fork/exec model for some applications.
I'll probably write some code to explore this when I get my current couple of projects squared away.
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
Anyone who must admit that they have more experience with VBA than anything else should not claim to be a programmer.
Even companies that make commercial off-the-shelf ERP software in Access+VBA, such as Stone Edge? Besides, "no true programmer" is considered a fallacy.
I'd like to make mandatory to post the age of a submitter alongside any 'news' item. Why? Because if the poster of this item is a 10 year old, then I'd say OK, someone getting into the game is looking around, good job. However, I don't think this is the case here, I even thought first that it was a joke, which it doesn't seem so. I'd suggest redirecting noobies into other forums instead of posting their totally useless submissions on /.
I am putting myself to the fullest possible use, which is all I can think that any conscious entity can ever hope to do.
Do you really let someone with less than 3 months experiance with big boy OSs fucking post. This is something someone with no real computer experiance would think.
>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.
Thats not true, not on any modern operating system. It was only true on windows, before the introduction of PowerShell.
try ecasound with a chain setup you can pipe audio, fully scripted it can do just about everything directly from alsa or if you compile it with jack it will also use jackd. But esd is very versitile, I am surprised that more do not know about how versatile and easy it is to use.
This message was not sent from an iPhone because Peter Sellers really was a deviated prevert without a dime for the call
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! ;-)
man(1)
I hadn't the slightest objection to his spending his time planning massacres for the bourgeoisie... (P.G. Wodehouse)
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.
Stop-Prism.org: Opt Out of Surveillance
$sudo slashdot -mod-parent-up -v moo
There really are no Trolls in this thread.
$
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'
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.
Why is this even a story? Has this guy ever heard of an API? GUIs are not 'walled gardens'..
Moron.
And shame on the one that approved this.
---- Booth was a patriot ----
Hairyfeet, back at ya.
I moved to Linux because from Mac OS X *because* of the command line. It is a first place citizen. You can expect almost all programs on it to support commandline options and such.
Here's my beef. When someone says you should be able to do everything in the GUI, they are also implicitely stating that you should not be able to do everything through the CLI. They are stating that the CLI side should atrophy because noone is using it. This is what happened on Windows. The Mac OS X commandline only works because it is based on someone elses work, who probably maintains it on a machine where they have to use the CLI everyday.
My only real gripe with the Linux command line is I would like to see bash replaced with a rethought interactive shell. (csh *har* *har* *ahahahaha*) Probably something more like the the ruby irb rather than something c-related would be good.
Linux should change, but it should not try to be something it is not. Us Linux people, we like our utilitarian pickup truck. It helps us to get our shit done. If you switch it out with a shiney sports car, you are fundimentally alienating the current core audience. We've seen the awkwardness this can put companies like Nintendo in.
Gnuplot
R
I use those directly from the application's CLI or write 'scripts' that I redirect into the application or `source' from the app's CLI. I'm sure I could think of others but those are the ones that quickly come to mind.
The OP must be coming from Windows World where CLIs are relatively few and far between. Wonder what they'd think about writing Expect scripts to drive CLI applications on UNIX/Linux? That's the sort of thing I would suggest to Windows folks to watch their heads explode.
CUR ALLOC 20195.....5804M
Huh, and I suppose you wrote the Powershell out in the longer way just by coincidence? While that longhand version might be better in a script for documentation purposes, it's way more verbose than is needed for a quick cmd-line run.
PS C:\windows\system32> Get-WmiObject win32_networkadapterconfiguration | ? IpEnabled | select MACAddress
MACAddress
----------
8C:89:A5:02:47:F4
08:00:27:00:68:35
00:50:56:C0:00:08
- Default computer for Get-WmiObject is the current computer so no extra arg needed
- The class is the first positional parameter so no need to qualify it with "-class"
- No need for the quotes around class name since powershell knows the expected parameter type
- You can use the ? alias for the where-object cmdlet and avoid the extra code block. Or you could write it as "where {$_.IpEnabled}" for a little extra clarity.
- Again powershell is strongly-typed so IpEnabled is a boolean and PS knows that so no need to string match in the where
- Curiously, you use the pipe with the where but then go on to use an explicit loop for getting the results - why not just use the implicit loop of a pipe again?
- Why use write-host when you can just keep the results streaming for the next step in the pipeline, if desired?
Now, the need for get-wmiobject is slightly unfortunate. Usually, relying on the WMI object is a band-aid until someone writes a cmdlet to encapsulate similar functionality so there are likely already cmdlets that simplify this further. In fact, (...googling...) it looks like there are network-adapter cmdlets in server 2012 and win 8.1 so it may just be a matter of upgrading PS. Since PS can run native commands, you could run "ipconfig" like normal and parse the output with select-string and it would look similar to your bash version but you'd lose all the strongly-typed niceness so it's a trade-off.
Ok, everyone has to start somewhere, but really? You've just uncovered the cool commandline tools available on an operating system that has it's GUI added-on as an afterthought ?
It's a bit like discovering that Windows can be used with - you won't believe it - a mouse! And some tasks are just so much easier! Wow!
Seriously. Don't Ask Slashdot. Commandline tools are the bread and butter. Almost everything that's not Gnome or KDE (aka cheap-windows-rip-off) has commandline functionality. So asking such a broad question is guaranteed to give mostly useless answers. Ask (or better, yet: Google) for specific use cases and you'll find plenty of answers, usually several different tools that can do the job.
Assorted stuff I do sometimes: Lemuria.org
GUIs are walled gardens in that features available in one piece of software is not available to other pieces of software.
That is actually blatantly false. It appears true because most people who write GUI software don't give a flying fuck about interoperability, while UNIX commandline tools are mostly expected to work as filters, a concept that by itself guarantees interoperability.
But if you look at the OS X world, for example, where universal drag & drop is pretty much a reality, the same is true of the GUI. I can drag almost everything from almost everywhere to almost everywhere else and it'll just work.
Interoperability is not a feature of GUI or no GUI but of developers investing the effort to make it, or not.
Assorted stuff I do sometimes: Lemuria.org
Other Internet newbies like Microsoft and Google have gone out of their way to make their customer's emails illegible.
I get my email from Google over POP3. pop.gmail.com:995. But it requires SSL, which I don't know how to emulate with anything at the command line like telnet. At any rate, Thunderbird saves my emails as plain text files, and that's good enough for now.
(T>t && O(n)--) == sqrt(666)
PowerShell: Get-NetAdapter | select macaddress /sbin/ifconfig | grep -Eo ..\(\:..\){5}
Bash:
Which is shorter?
Which is more readable?
Which is more robust against changes (like new properties/columns)?
Which is more consistent across related commands?
Which is more discoverable?
Which is more extensible?
Note how the PowerShell version does *not* need to engage in string parsing, and how it does *not* need to rely on specific file content formats. The advantages of objects in the pipeline.
Btw, if you want PowerShell to output in the same metadata-stripped format as from bash/ifconfig, you can make the PowerShell command even shorter, without sacrificing readability:
PowerShell: (Get-NetAdapter).macaddress
Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
A bit offtopic, but what I find sad is that there is no GUI following the Unix philosophy and no GUIs which integrate well with the command line. I mean things like GUIs for combining software components which to do useful stuff (cli completion is nice, but why is there no scrollbox to select from? Why no GUI with checkboxes which I can open with right-click when I forgot an obscure option?), good graphical shells which combine a file manager with a CLI shell (there was norton commander), or terminals with graphical features. I remember seeing some interesting projects, but nothing seems to have developed to a state to be really useful. I maybe wrong, I you know such things, let me know.
This is where I would have hoped to see innovation. Instead we get dumbed down GUIs with fancy annimations.
I encounter new libraries and tools without a useful command line interface all the time. It's getting to be irritating.
Right now I'd like a CLI to open-zwave, but I can't find one. Web interface, sure. Huge bloated tools that does everything for me, sure. No single simple CLI...
With a CLI it would have been trivial to hook into everything else unix, like cron.
Don't forget mencoder, part of mplayer. It does everything for video and audio streams that imagemagick does for images.
Worth naming is also sox, that is the same but for (only?) audio. I haven't use that one, so I don't know how good it is.
And maybe netpbm should be mentioned as a precursor to imagemagick.
If you want to view the contents of a text file, you really want to use either "more" or "less". Using "cat" is an ugly hack that is taught far too often in basic shell lessons for the sake of convenience when the files being worked with are a few lines long.
Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
you're one of those gui browser wimps. real men use lynx.. silly Ping, she should never have told Marc to write that thing, think of all the man millenia squandered since the web went pointy-clicky-pickie.
http://rareformnewmedia.com/
You "believe" that you can send mail messages from the command line? JFC, have you ever heard of man pages? And where did you get the impression that grep or egrep are obsolete?
Best scripting language there is with a few libraries and a debugger. I would shell out to other peograms on occasion.
Yea...I wish Slashdot were an ANSI BBS too.
Then instead of some of the more inane comments, we could instead have gripping games of Legend of the Red Dragon, or Usurper.
Oh those were the days. LORD is still playable at places like http://www.3dham.com/telnet/index.html
Why UNIX?
"GUIs are walled gardens in that features available in one piece of software is not available to other pieces of software. "
In journalism this is known as "telling a question". It looks like you're asking something when really you are asserting a premise. The fun part is that you get away without having to show that your premise is correct.
findstr has POSIX basic regular expression support (almost) and has been available since Windows 2000.
i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
Less useful but still useful are command shells.
Really?
You obviously do not get it if you do not understand the Jedi Power of a person who has mastered the shell. Pick a shell. When you think you have mastered the shell, experiment with other shells. Hell, change your shell to perl, I know a couple of perl junkies who run that way.
Sometime when you are bored, and have more that three brain cells on shift, from the command line (that would be a shell prompt) execute "man init" on your favorite Unix, and read the page. Then read the init scripts. {sarcasm}no, the shell is not useful{/sarcasm}
In a Unix Xwindows environment (or in MacOS X for that matter), the GUI is a tool, a nice place for multiple graphical proggies to play together, and an easy way to have multiple terminals open and visible at once. If you are an absolute luddite, get yourself an old VT101 terminal, learn how to plumb in a serial terminal to your machine, and explore the wonders of tmux.
Happy new year
-Red
My (free) SDR [Software Defined Radio] software has, rather than a command line interface (since it isn't invoke to process, but invoke and continue to run to process), a network interface. Open a port, ask it for status and/or data, send it commands, etc.
I've interfaced it with other SDRs, remotely tunable antennas, and full on transceivers via this network interface. Commands are essentially text, other than you send them through the port.
Another thing is that regardless of which platform the SDR software is running on, you can talk to it from any other platform, because it's just a network connection. It's easily driven from any scripting language with network facilities, for instance Python interfacing is a doddle.
I love the idea of command line tools, because those are things I can use to leverage this kind of interface. Talk to a mapping application? Just feed the guy's callsign to a ham radio db, get the coordinates back, feed them to the mapping app, bingo, map. Etc.
I've fallen off your lawn, and I can't get up.
As long as you can hit Alt-F2 or whatever the accessor is, and type in "bash", and "/bin" and/or "/usr/bin" are filled with the goodies, nobody is "hiding" anything from you. So far, I have seen no sign that anybody has any intention of even trying to "hide" the machinery.
Your sarcastic "no one should use things like grep, sed or awk" isn't even that far of the mark in all seriousness. All it needs is the modification to "most users most of the time should not need to use things like grep, sed or awk" - without taking them away, of course.
There. I got through a comment without taking a jab at Systemd. Rest assured, I will take it on when the context justifies it, but that is not the case here.
Bingo.
Huh, and I suppose you wrote the Powershell out in the longer way just by coincidence? While that longhand version might be better in a script for documentation purposes, it's way more verbose than is needed for a quick cmd-line run.
While it is generally true that using the longer versions of cmdlet names and parameter names and using named parameters instead of positional ones increases readability in scripts, this specific "longer version" is just stupid. It has been artificially made longer and more complicated and has actually *lost* readability bc of that process. One can only guess to the intentions behind that "example". It is certainly very, very bad PowerShell.
In fact, (...googling...) it looks like there are network-adapter cmdlets in server 2012 and win 8.1 so it may just be a matter of upgrading PS.
Yes. In fact, the functions from the NetAdapter module has been automatically created as wrappers from WMI objects.
Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
Leaving aside the hideous style, that's bullshit. Without a command shell you wouldn't be able to run anything, let alone chain programs together, automate actions etc.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
There's a host of POSIX tools out there for windows. In 2004, they were still all substandard to those available with any other POSIX compliant system I'd used up to that time, and some were faulty. (not saying findstr is, just that on windows POSIX tools have tended to be less than fully reliable, for various reasons including a sub-standard file system)
The cesspool just got a check and balance.
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...
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.
Absolutely, now try parsing through one of those files on a remote system, and the CLI becomes your one and only friend, at least in the *nix world, AFAIK, windows still fails horribly at this basic task. Imagine if you could have just ssh'd into the file server and run the query remotely, you could have skipped the whole downloading of the dataset in the first place.
The cesspool just got a check and balance.
The Wikipedia article cites four sources. If you're willing to provide some citations for who may "claim to be a programmer", I'll take a look at them.
Please see Enterprise resource planning on Wikipedia.
Command-line interpreters help save time and have became my favorite way to jump into using those languages, but there's more than the shell.
Python is a great one.
Javascript in Chrome has a command-line where you can try out things.
Unsurprisingly, despite both of these languages having issues, they are highly popular.
I hear that there's a chrome with a Dash interpreter built-in. If it includes inline editing, then I'd bet it will do well.
Science & open-source build trust from peer review. Learn systems you can trust.
Every operating system I know of (except maybe BeOS) has at least one command line interface. Many operating systems have more than one.
For example, the Stratus VOS operating system supports this command line interface:
http://stratadoc.stratus.com/vos/17.2.0/r089-06/wwhelp/wwhimpl/js/html/wwhelp.htm?context=r089-06&file=ch1r089-06.html
This command line interface was designed around 1980 and attempts to be more user friendly by using recognizable command names and has both lineal and form oriented methods for specifying command arguments.
The VOS operating system also supports bash...
An engineer who ran for Congress. http://herbrobinson.us