Thank God for Command Line

Today, I learned why graphical user interfaces can suck for uploading files to the web. And that, although I feel comfortable with FileZilla most of the time, I really gotta develop alternatives to it sometime. I nearly lost most of my web portfolio thanks to operator error. Hah.

But I also learned that SSH and command lines are awesome and can transplant files even when the aforementioned GUIs don’t let me pull out the folder from a directory that I just accidentally dropped it in :smack:

Most of all, I learned that I am so thankful for people who are kind enough to take 10 seconds of their time and move files around via command line for me, when I only know the smallest basics of it. Also, I desperately want to learn more, because it just seems so *damn cool * :slight_smile:

Command lines are awesome and epically powerful. Have fun learning! Be aware that it cuts both ways, though. My favorite cautionary tale: one of the senior guys at my work once formatted a thumb drive via the command line - no big deal, right? The catch is that linux sees a thumb drive, a hard drive, connections to file shares, etc. as all fundamentally the same thing. He typo’d the command and specified the wrong drive. The command line being what it is, it said ‘okay’ and happily did exactly as he requested. Two minutes later, frantic reports started coming in that the everything had been erased from the office file server… That was a fun day. :slight_smile:

I’m not an expert at the command line, but I’m not uncomfortable with it, either. I had an issue with my Mac desktop two weeks ago where I couldn’t opt-command-esc (Force Quit) something. And it hung up the whole computer. Completely. With work I couldn’t afford to lose by reseting.

Luckily, I had SSH access enabled (which I wasn’t sure if I had enabled or not), so I could go to my laptop, SSH in to my desktop, and kill the process that was being an asshole, saving all my work.

I spent 6 years as a unix kernel and driver guy, and currently work on QNX systems. I’m a big fan of command line stuff.

-D/a

A major attraction of command line processors is that they are also script interpreters. The same commands that you can type by hand on a command line (and, in some command processors, much much more) can also be written into a script file that you can run at will. This enables you to automate processes in ways that would be hard to do with a point-and-click GUI interface.

For example, over in the GQ forum, people sometimes ask questions about how to accomplish a particular non-trivial task, and get lots of answers that involve writing command processor scripts (commonly called shell scripts).

Unix and linux command processors are sophisticated enough that they are substantially a full programming language. (Mac uses the Unix shell too.) Microsoft has DOS batch files that are much less powerful, but they have a newer command processor called PowerShell that is much more elaborate.

Whatever operating system you use, if you do anything more sophisticated that mindless web-surfing, it is well worth your while to learn at least the basics (and probably much more) about your command line processor and its scripting capabilities.

ETA: Here’s an example: http://boards.straightdope.com/sdmb/showthread.php?p=14922157

FlyByNight512–Haha, definitely sounds like a very fun time at the office :stuck_out_tongue: Poor guy. I bet that hurt his confidence for a while.

pulykamell–ooh, cool. You just helped me realize the world of possibilities I could experiment with. I’d think just SSH-ing with a computer we have lying around that no one likes could keep me amused for a while. Thanks! :slight_smile:

D/a–I bet you have some cool stories. Any you wanna share?

Senegoid–thanks for the link! I’m sure I’ll look into scripting eventually. Right now I feel like it would be a little daunting to try it out, haha. Last night I was having a crazy amount of fun just stepping through directories and ls-ing them at the highest level on my MacBook.

One thing I love about working with technology–there’s always another thing to learn a ton about, if you just wanna pursue it. The tricky part is finding the time. I can see why some people don’t even get their full-fledged degrees but are incredible at what they do :slight_smile:

Command lines can do anything. Video game interfaces … not so much.

Yeah, as **FlyByNight’s **associate discovered, Unix will often be all to eager to do exactly what you told it without asking if you’re sure. We warn our sysadmins when they get root access: With awesome power comes awesome responsibility.

The classic example is rm -rf /, which can rapidly dissolve a system down to unbootable bare drive platters, without so much as a polite Ruin Your Day? y/n warning.

Fortunately, most shells alias rm into rm -i which will provide a confirmation oppotunity.

Yes. Long before this was a common default, I was a Unix sysadmin, back in 1980’s. I always aliased that for all new user accounts that I created. Also:


alias cp='cp -v -i'
alias mv='mv -v -i'
alias rm='rm -v -i'
alias rmdir='rmdir -v'
alias ll='ls -l'


Also, just for fun: alias dog=‘cat’

I also gave everybody a default command prompt that showed the current directory, long before that was a common default.

Did you know that most of those DSL modems and routers you have next to your machines are also Linux or Unix mochines behind the scenes? You might be aware that you can get into their setup or configuration apps through your browser, usually via http://192.168.0.1 or similar. But did you know you can also rlogin or telnet into them (well, some of them anyway) and get a bare-bones command prompt? Not that you can do much – it’s not a full Unix/Linux install, and most usual commands or programs you expect aren’t there. But you can at least explore the file system with ls and cd commands.

Playing with routers sounds fun. I didn’t realize they were based in Linux/Unix. I’m gonna be fiddling with so much over this break from classes, hah. I’ve never heard of rlogin, but I have heard of telnet.

I had an awesome moment at work today where I got to load Ubuntu on an old Dell Laptop. I think my supervisor was a little shocked at how excited I was when he said I could use it as a guinea pig specifically for that purpose.

This Ars Technica article looks like a very fun learning/experimental project I may undertake…

More stuff runs on some flavor of *nix than you’d ever expect. It may be terribly pared down, in the case of routers or televisions, but there’s enough to count. I’m sure Bell Labs never expected their creations to endure for four decades with no signs of slowing down.

Pure text commands have advantages over interactive key-and-mouse commanding, especially if the commands can be executed from an editable script. AFAIK, some word processors, e.g. Word, cannot be driven by command file which makes them worthless, IMO, compared with, say LaTeX.

Sometimes I feel like downloading 100 webpages, all with very similar URLs. Such would be tedious, I think, without text scripting.

Even nicer is setting one’s own aliases, so one knows what they are! Thirty-plus years ago, when I first encountered Unix, I stumbled across a diff -e command which interacts with ed in usefully. But it didn’t work.
It turned out our Berkeley-oriented guru had supplied all us newbies with pre-set aliases, including alias ed ex. :smack:

Command lines are great when you need to do batch operations on a bunch of files too.

OTOH, a GUI is great if you only want to select certain files out of the directory (Control-click.)

Bell Labs wasn’t even interested in developing Unix.
It took the scheming of Thompson and Ritchie (who said they were writing a word processor) to fool management into letting them develop it.

He’s a pretty cool guy, it didn’t rattle him much. He got the task of restoring the whole thing from backup, which worked, and it was good as new in about two hours. He still hasn’t lived it down, though.

Frequently tested backups are your friend. :smiley:

I was a Unix sysadmin for several years in the mid-1980’s, and we had the pleasure of a full back-up and restore that, uh, … wasn’t exactly fully tested.

We were upgrading our VAX 11-750 from Berkeley 4.2 BSD to 4.3 BSD, which contained among other new stuff, a completely re-designed file system, from the bare bones inodes on up. So this upgrade couldn’t be done simply by plunking down a new kernel. It required a full backup, full fdisk and re-partition of the disk, and full restore.

Once we got the new system installed and started the restore, we found . . . wait for it! . . .

The 4.3 version of the restore program couldn’t restore backups made by the 4.2 backup program!

Oops.

Depends on what you consider cool..my days with the SCSI analyzer? Finding weird bugs in Solaris fdisk? I’ll see if I can come up with anything interesting..
-D/a

I love the command line. I would never get a Mac because it had no command line (now that it is based on Linux, I imagine it does). I use an enhanced command processor for Windows called TakeCommand. It is a descendant of 4DOS and 4NT.

Those nostalgic for Jurassic Era computer systems where card punches were more common than mouses may be amused to access Google via a 1960’s-like interface.

I’m in heaven.