Open Source Musings

cli

(Note: This article was originally published at Opensource.com and appears here via a Creative Commons Attribution-Share Alike 4.0 International License.)

There are great tools on the Linux desktop for taking screen captures, such as KSnapshot and Shutter. Even the simple utility that comes with the GNOME desktop does a pretty good job of capturing screens. But what if you rarely need to take screen captures? Or you use a Linux distribution without a built-in capture tool, or an older computer with limited resources?

Turn to the command line and a little utility called Scrot. It does a fine job of taking simple screen captures, and it includes a few features that might surprise you.

Let's take a peek at it.

Read more...

For years, I've been saying or writing that you don't need to know how to use the command line to use Linux effectively. I've helped more than a few people over the years migrate to Linux, and none of them have cracked open a terminal window. Guess what? They're getting what they need to get done using graphical applications. And nothing else.

But here we are in 2022 and I'm still trying to break that myth. Over the years, and quite a few times in recent months, have tried to call me out over that. They've pointed to articles and blog posts written about the command line as proof to contrary. As proof that the command line is essential if you want to use Linux.

I don't deny that I use the command line — mainly to make some complicated tasks simple. That said, I'm definitely not a command line master. Far from it. I know just enough to be dangerous, to carry out a few tasks. At most, I spend 5% of my computing time in a terminal window.

That time isn't spent doing anything complex. So, what do I use the command line for? Here's most of what I do in a terminal window:

  • Read RSS feeds with newsboat.
  • Convert files using pandoc.
  • Publish a couple of websites using GitLab Pages.
  • Use three or four simple scripts (which I cobbled together through trial and a lot of error or which were written by people I know) to automate tasks — scripts like this one.

And not much more than that. Hardly the behaviour of a seasoned, hardened, deeply technical command line guru, is it?

Scott Nesbitt

#linux #cli #opinion

(Note: This post was first published, in a different form, at Opensource.com and appears here via a CC-BY-SA 4.0 license.)

How do you usually copy all or part of a text file when working on the Linux desktop? Chances are you open the file in a text editor, select all or just the text you want to copy, and paste it somewhere else.

That works. But you can do the job a bit more efficiently at the command line using the xclip utility. xclip provides a conduit between commands you run in a terminal window and the clipboard in a Linux graphical desktop environment.

Read more...

(Note: This post was first published, in a slightly different form, at Opensource.com and appears here via a CC-BY-SA 4.0 license.)

Let's take a trip back in time to the early, simpler days of the web. A time when most of us went online using low-powered PCs or dumb terminals, often over slow dial-up connections. Some of use visited web pages using command-line, text-only browsers like the venerable Lynx.

Jump forward to these days of web browsers like Firefox, Chrome, Safari, and a few others. You'd think that browsing the web at the command line would have gone the way of the tag. You'd be wrong. Web browsers that run in a terminal window are alive and kicking. They're niche, but still get the job done.

Let's take a look at three browsers for the command line.

Read more...

Here's the latest in an irregular series of short posts that introduce a few Linux terminal tricks.

Besides sticking your head out the window, what do you do when you want to find out what the day's weather is going to be like? Chances are you jump over to a weather service website or fire up an app on your phone.

Why not crack open a terminal window instead? All you need is a command line utility called cURL. cURL is standard kit with most Linux distributions. If it isn't installed on your computer, you can get cURL using your package manager.

How do you use cURL to check a weather forecast? At the command line, type this:

curl wttr.in

Then, press Enter. Something like this displays after a few moments:

Using cURL to grab a weather forecast

The wttr.in in the command, in case you're wondering, is a console-oriented weather forecast service. cURL goes to the internet and grabs weather information from wttr.in. In turn, wttr.in determines the forecast for your location using your IP address.

If you're masking your IP address, you can get the forecast for where you are by adding the name of your city to the command. Let's say you're in Osaka, Japan. Get your weather forecast by typing:

curl wttr.in/Osaka

Do that to get the forecast of another city as well. You can also use three-letter airport codes or the name of an attraction (like the CN Tower) view the forecast for a locale. You can learn more by reading the documentation.

Scott Nesbitt

#linux #cli

I don't know how many Linux utilities exist for viewing graphics. Most distributions come with one, and usually that app is more than enough for you to flip through the images on your computer.

One image viewer I've been partial to for a while is feh. It a small, light image viewing tool that's simple to use. While you can run feh from a window manager, you can also run it from the command line.

To do the latter, open a open a terminal window and navigate to the folder containing the image or images that you want to view. Then, type:

feh [name-of-image]

A new window opens, displaying the image.

Viewing an image with feh

feh opens the image at or near its full size. You can scale the image by pressing the down arrow key on your keyboard.

To view multiple files, include a wildcard with the command — for example:

feh *.jpg

feh displays all the files with that extension. Click the window or press the left and right arrow keys on your keyboard to move between the images. feh also displays the number of images in the folder in its title bar.

feh displaying the number of images in a folder

While feh can't edit or save files to different formats, it's a great tool for quickly viewing graphics or photos and for creating impromptu slide shows.

Scott Nesbitt

#linux #cli #utility