command-line

How to get package version in one command line in bash

How to get package version in one command line in bash I’m trying to get the installed version of systemd in the following command, but it returns all lines contain the keyword "systemd". # dpkg -l | grep " systemd " ii gnome-logs 42.0-1 amd64 viewer for the systemd journal ii libsystemd0:amd64 249.11-0ubuntu3.12 amd64 systemd …

Total answers: 1

Installed thonny using sudo but can't run from desktop

Installed thonny using sudo but can't run from desktop Ubuntu 22.04.4 LTS kubuntu 22.04 I downloaded the thonny bash script from thonny git. from terminal i typed sudo bash thonny-4.1.4.bash it installed fine. If I run in terminal sudo /root/apps/thonny/bin/thonny it runs and opens fine. If I try and run it from Kubuntu desktop I …

Total answers: 1

Monolingual french offline commandline dictionary?

Monolingual french offline commandline dictionary? As the title says, I’m looking for a monolingual french dictionary that I can query on the commandline, ideally offline. For example to have a low latency way to check the gender of nouns. I looked at the freedict language packs that are available for dictd via apt-get (on Ubuntu), …

Total answers: 1

Addressing Another Terminal Input Lag with Ubuntu 22.04

Addressing Another Terminal Input Lag with Ubuntu 22.04 Ubuntu 22.04.4 LTS Kernel : Linux 6.5.0-28-generic Gnome version: 42.9 Windowing system: X11 I am experiencing another terminal lag with Ubuntu 22.04. Typing is always 1 character late and I am suffering from so many typo in my code due to this issue. System is not lagging, …

Total answers: 1

How to use grep string that has double quotes in it

How to use grep string that has double quotes in it So I’m running a simple alias called vpn which runs a command and has an output, which I put into a .txt file. If interested to what exactly then here is the alias alias vpn="docker exec -it qbittorrent curl -sS https://ipinfo.io/json > $HOME/vpnstatus.txt" and …

Total answers: 1

lscpu vulnerabilities and mitigation

lscpu vulnerabilities and mitigation I recently learned about lscpu command and was excited to know the architecture information. However, there is a section at the end where it shows lots of vulnerabilities. Did some google search and after going through forums and articles, came to know it is an architectural issue from Intel for their …

Total answers: 1

`command echo –help` invokes bash internal echo function

`command echo –help` invokes bash internal echo function According to help command, the help of bash, command can be used to trigger the external program x, if x exists as a builtin function too: command: command [-pVv] command [arg …] Execute a simple command or display information about commands. Runs COMMAND with ARGS suppressing shell …

Total answers: 1

Retrieve large number of files from remote server with wildcards

Retrieve large number of files from remote server with wildcards I’m trying to download a large number of files from a remote server. Part of the path is known, but there’s a folder name that’s randomly generated, so I think I have to use wildcards. The path is something like this: /home/myuser/files/<random folder name>/*.ext So …

Total answers: 1

Given MAC address, how to tell if interface is wifi

Given MAC address, how to tell if interface is wifi Is there a way, on the command line, given a MAC address of a local network interface on the current machine (e.g. 01:23:45:67:89:ab), to determine if that interface is WiFi vs wired? I’m trying to do this in a shell script. Asked By: Jason C …

Total answers: 4

Recursively search for txt files that has all the search strings

Recursively search for txt files that has all the search strings I want to find all the files that has the words “Who”, “What”, “Why”, “How”, “When”. All of the words, in any order. Case Insensitive I tried: grep -rl –include=’*.adoc’ "Who" . | xargs grep -l "What" | xargs grep -l "Why" | xargs …

Total answers: 2

List openvswitch virtual switch with ip command

List openvswitch virtual switch with ip command I’ve configured openvswitch virtual switch and can list it with ip command as follows: # Show all interfaces ip link Output: 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 <snip> 5: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop …

Total answers: 1

Create FAT-formatted disk image that can fit 1G file

Create FAT-formatted disk image that can fit 1G file I’m struggling to create a FAT-formatted a disk image that can store a file of known size. In this case, a 1 GiB file. For example: # Create a file that’s 1 GiB in size. dd if=/dev/zero iflag=count_bytes of=./large-file bs=1M count=1G # Measure file size in …

Total answers: 2

Concatenate string after grabbing environment variable

Concatenate string after grabbing environment variable I’m trying to concatenate a string with a variable which is in .env file. My .env is this: API_URL=http://localhost:3030 NODE_ENV=development And here is my code: [ ! -f .env ] || export $(grep -v ‘^#’ .env | xargs) URL="${API_URL}/health" echo $URL I expect this to print http://localhost:3030/health. But it …

Total answers: 2

Mounting a Disk Image

Mounting a Disk Image I’m trying to create a disk image and mount the partition for further work, but I’m encountering a frustrating error message: "wrong fs type, bad option, bad superblock." Here’s the steps I took and the output I received: $ dd if=/dev/zero of=test.img status=progress bs=200M count=1 1+0 records in 1+0 records out …

Total answers: 3

Is it possible to sort the letters in a word in a line of text?

Is it possible to sort the letters in a word in a line of text? So I have a file full of test commands that I like to run against some of my functions to make sure they are handling all possible situations correctly. No point in having duplicate commands tho. Here’s some examples: rap …

Total answers: 5

What are the file size options for "find . -size" command?

What are the file size options for "find . -size" command? I found out that to look for file size in bytes, I use ‘c’. So I can look for file size with 1000 bytes by using: find . -size 1000c But what about different kind of size such as Mb, Gb or even bits? …

Total answers: 3

How to get display to show a pdf properly

How to get display to show a pdf properly When I do: display file.pdf it shows this: I can’t resize the little window that it adds but I can remove it by clicking on the x. I can also remove the checkerboard effect that comes from assuming transparency, I think, with: display -alpha opaque file.pdf …

Total answers: 1

Fixing title of xterm even during editing a file inside it

Fixing title of xterm even during editing a file inside it To write a document I need to put a picture that I can capture from the screen. The picture is supposed to have an xterm which displayout uart output during rtl simulation. But I didn’t capture it when I did the simulation and it …

Total answers: 1

How to place my own code snippets on command line à la history?

How to place my own code snippets on command line à la history? I have hundreds of tested and tried commands and snipets saved in various text files. When I need to re-use one, I find and copy/paste to the command line. Though reliable this is a clumsy method. Compare this to the elegant way …

Total answers: 3