Linux Pros' Top Command Line Secrets
May 12, 2014 11:26 AM PT
Well it was a relatively quiet week here in the Linux blogosphere, giving residents a long-overdue opportunity to catch their collective breath, enjoy a few Tequila Tux cocktails and take stock of all the FOSS-related happenings that have taken place over the past few weeks.
Among the highlights, for those who missed them, were the awarding of the IEEE Computer Society's 2014 Computer Pioneer Award to none other than Linus Torvalds; the arrival of Tails OS 1.0; and, perhaps most exciting of all, the release of Seattle-based band netcat's debut album as a Linux kernel module.
"Are you ever listening to an album, and thinking 'man, this sounds good, but I wish it crossed from user-space to kernel-space more often!'" netcat wrote on its Facebook page. "We got you covered. Our album is now fully playable as a loadable Linux kernel module."
Linux Girl thought she had seen it all here in the Linux world, but now she realizes she was wrong. Thank you, netcat, for keeping life interesting!
'Command Line Secrets'
Speaking of interesting, there's nothing like a little shop talk around the bar to pass the time during a quiet week, and last week afforded a dose of that as well. Life is good here in the Linux blogosphere!
Linux Girl couldn't resist.
'It Manages to Render Most Web Pages'
"There are loads of really good reasons to use the command line," wrote the masterminds at Linux Voice. "It's the most powerful and concise method of interacting with your computer.
"However, we decided to take a moment to look at some of its more obscure (and some would say pointless) uses," they added.
Top of the magazine's list is the elinks Web browser: "It might not be as colorful as its more famous rivals, but it manages to render most Web pages," they explained. "As well has having geek-chic, it can come in handy when you just need to quickly check if a Web page is accessible from a computer you only have SSH access to."
The list goes on from there to include looking up definitions on Wikipedia, among other tips.
Down at the Broken Windows Lounge, patrons had plenty of suggestions of their own.
'Great for Maintenance'
"Very nice tips on CL commands, very nice," enthused Google+ blogger Alessandro Ebersol, for example. "But they forgot cowsay, which is great for having some laughs in the darkness of a terminal."
The command line "is great for maintenance," he added. "One can automate with bash scripts and make complex tasks with few (or just one) keystrokes."
* % cat "food in cans"
cat: can't open food in cans
* % nice man woman
No manual entry for woman.
* % [Where is Jimmy Hoffa?
* % make love
Make: Don't know how to make love. Stop.
* % man: why did you get a divorce?
man:: Too many arguments.
'The Most Precious Gem'
"Command-line secrets? There aren't any such things," blogger Robert Pogson told Linux Girl. "Desperate newbie? Type 'help.' Still need a hint? Type 'man whatever.' Want more diversity? Type 'ls /bin /sbin /usr/bin /usr/sbin | less,' pick out a few gems and type 'man whatever' all night long. I've been at it more than a decade. Still having fun."
Pogson doesn't remember how long ago he discovered 'ssh,' but "it's the most precious gem of the FLOSS world," he said.
"The awesome power of ssh is that the joy you have with typing commands on one computer can allow you a hundred times the joy on 100 computers," he added. "Of course, it's not fun to type passwords 100 times, so learn to use secure passwordless logins with ssh to make logging in remotely transparent."
'Use It With Respect'
Of course, "just as with any pleasurable activity, one can be addicted to the point of destruction," Pogson warned. "As root, you can type commands to delete everything or otherwise mess things up.
"This is the nuclear option, and just as world leaders should sit on their hands and think carefully before pushing the button, value this power and use it with respect and higher motivations," he added.
"I once deleted a file system because my thumb dragged the space bar into a command," Pogson concluded. "I only did that once. Honest."
Google+ blogger Gonzalo Velasco C. was no less enthusiastic.
"Even though the GUI tools are easier, in the *nix universe, the command line remains very powerful," he told Linux Girl. "Even some power MacOS users use them."
As for Gonzalo Velasco C. himself, "the only commands I would like to master are the process control and killing, to use with ctrl+alt+backspace, so I can handle the one process that is giving me trouble, and the tar.gz files management -- that to this very day remains a pain for me," he said.
'Ur Doing It Wrong'
Last but not least, SoylentNews blogger hairyfeet had a different perspective altogether.
"The only thing I would add to a story about CLI is this: If you aren't working in IT and performing repetitive tasks where having an extremely simplistic, primitive way to script something is useful, and yet you are still using CLI, then 'ur doing it wrong,'" hairyfeet told Linux Girl. "A CLI isn't magic -- it's a GUI from the 1970s!"
Today there are "useful GUIs thanks to actually having more CPU and RAM than a dollar-store watch -- we even have IDEs and scripting languages that can run rings around that 70s throwback, work across the WAN or LAN and interact with the deepest levels of the OS, all while being easier to use thanks to technologies like intellisense and autocomplete," he explained. "So why in God's name, if you aren't one of the 3 percent who are administering systems where every single byte counts, would you be dragging that old pile of junk out of mothballs?"
Hairyfeet's best CLI advice? "Don't -- join the rest of the planet in the 21st century and learn how to use real languages and tools," he concluded. "Let CLI join bubble memory and floppies on the dustbin of history."