Recent Questions - Unix & Linux Stack Exchange |
- How to make the libvirt VM installed under the regular user boot during the system bootup?
- What's the most appropriate directory where to place development software shared between users?
- How to get socket statistics without ss
- Openbox problems after removing Monero GUI Client
- How to get only stdout_lines with Ansible using mail module
- How can I use awk, grep, and other tools to replace a single character in a file?
- After reboot modem is not detected anymore. "unable to enumerate USB device"
- How to say from a Linux block device if it is trimmable or not?
- How to get a list of the deepest unique directory paths excluding any base / parent paths
- pid for child of child processes
- Missing console output after grub
- Delete lines matching pattern in file1 and save these deleted lines to file2
- How to solve the issue that a remote Terminal screen is messed up when using `expect`? (usually after a resizing)
- sum values in a file if keys match another file and based on conditional
- For each line in a file, print fields from specific column to NF if those values are less than value in another field
- Write AWK command's result into new CSV file
- No output: busybox find . -exec sh -c ' readlink -f "$1" | tail -n +2 ' sh {} \;
- Use Docker on a systemd disabled VM
- Spawn a terminal and redirect its stdout to original process
- What do the Block Device Capability flags mean?
- Allow UFW rules in specific IP range
- Splitting long commands in shell scripts
- reset failed login count / unlock aix/UNIX account
- Shared folder does not appear in guest CentOS (Windows host), using VMWare
- Unable to install VirtualBox. `complaining that the kernel module is not loaded`
- Linux local directory permissions as question-marks for non-root
- Join two files each with two columns, including non-matching lines
- How to sync bookmarks (favourites) between Google Chrome and Chromium
- Using sed to add a URL to the start of every line
- How to apply updates on OpenBSD, NetBSD, and FreeBSD?
How to make the libvirt VM installed under the regular user boot during the system bootup? Posted: 09 Sep 2021 09:30 AM PDT I installed a virtual machine under a regular user(in other words, not under The |
What's the most appropriate directory where to place development software shared between users? Posted: 09 Sep 2021 09:25 AM PDT About share data (files and directories) among users within the same machine, has sense use the I am assuming it is still valid or recommendable - correct me if that changed But - What should be the directory to be shared for user/groups but for software oriented for development? i.e: Java, Maven, Gradle (all available from a |
How to get socket statistics without ss Posted: 09 Sep 2021 09:24 AM PDT The question may sound silly but I'm trying to make a tool that uses So, I think I might just get the data without using Basically I need to list TCP and UDP connections. Columns I'm using are protocol, state, local and peer address/port and users. After some research I'm not sure where can I get this informations. Any idea ? |
Openbox problems after removing Monero GUI Client Posted: 09 Sep 2021 09:12 AM PDT I have a problem with openbox menu, after i removed monero gui client and monero, the entry in openbox menu didn't remove and it shows me that file is missing. I use obmenu-generator and i'm on artix gnu/linux. |
How to get only stdout_lines with Ansible using mail module Posted: 09 Sep 2021 08:26 AM PDT I'm using ansible to scan hosts with clam antivirus and I'm receiving reports via email. Reports contain everything and I want only to receive stdout lines. Is there any way to accomplish this? I wrote email template according to https://gist.github.com/halberom/0aea275632d2b47af0536e5def01d4d2 although only thing that is not the same is that I've piped to nice json: The error I get is:
If I remove Is there a way to accomplish getting only stdout_lines in my report? I tried with grep in the shell command but failed |
How can I use awk, grep, and other tools to replace a single character in a file? Posted: 09 Sep 2021 07:54 AM PDT I am trying to replace a single a single IP in a string, the current shell script i am using to find this data is DATA Script This will give us How in the world would i do that effetely? The things i have tried, the problem with this code is that after |
After reboot modem is not detected anymore. "unable to enumerate USB device" Posted: 09 Sep 2021 07:37 AM PDT I have a 5G modem attached to a m.2 port. When powering up the device it detects the modem just fine attached the the USB bus. After reboot, the modem is not detected anymore by the kernel or lspci. Removing the USB hub from the PCI bus and triggering a rescan produces these kernel messages: https://hastebin.com/uvebubegey Same thing happens when I try to power cycle the USB port by sending 0 and 1 to And the same thing happens with kernel 4.19 and 5.10. How could I force this modem to get detected without removing the power from this device? |
How to say from a Linux block device if it is trimmable or not? Posted: 09 Sep 2021 07:58 AM PDT Everything is in the title.
Can I somehow say from a block device if trimming/discarding is supported on it, without actually trying to trim/discard something on it? |
How to get a list of the deepest unique directory paths excluding any base / parent paths Posted: 09 Sep 2021 08:11 AM PDT I would like a solution that works on Linux and is portable across shells i.e. not just bash and filesystems i.e drvfs or btrfs NB: directory names can contain spaces With find I can produce a list of all paths rooted within a folder like this: I would however like to exclude "base" or "parent" paths that are already included in the the deepest unique path. Please also help with the correct terms to use to describe this as I feel I am not using the optimal description. I can do it with a basic script but assume there is a more elegant way using one of the following:
Here is my script: and its output - which is the desired output |
pid for child of child processes Posted: 09 Sep 2021 07:49 AM PDT i'm running a script that calls a child script that in turn calls other child scripts and processes. some of the child processes use a lot of disk io and cpu, and overheats the cpu, causing a crash or errors. i guess i can thank intel for that. this isn't a request for information to fix my cpu. i want to pause the script for 2mins every 5mins, to allow the cpu to cool down. this is in my parent script: and this is my pauser.sh script: this pauser script doesn't pause the child of child processes, i think because the child of child scripts/processes have different pid's. i've read that child of child processes can be grouped, if so, how do i pause and resume the entire group of child processes from the parent script? |
Missing console output after grub Posted: 09 Sep 2021 06:34 AM PDT I'm trying to boot CentOs already installed on an appliance. This appliance has only two input connectors:
It also has 2 Gigabit Ethernet ports, one of which is used for remote administration with Intel BMC and Intel SOL (Serial-Over-LAN) I'm connected to the server via the Intel SOL. Now the problem: when I boot the server, I successfully reach the Grub loader and I can select the entries, but after that, the output shows the I tried to boot from a live Centos image (using a USB Pendrive connected to the USB hub) but also, in this case, I can see the Grub loader, I can select the desired entry, but then it stuck with I also tried to:
I'm honestly out of options now, any suggestion would be greatly appreciated. |
Delete lines matching pattern in file1 and save these deleted lines to file2 Posted: 09 Sep 2021 08:39 AM PDT I have Is there a way to combine these commands into one ? Or is there a more elegant way to do it? |
Posted: 09 Sep 2021 08:50 AM PDT Using |
sum values in a file if keys match another file and based on conditional Posted: 09 Sep 2021 09:38 AM PDT I have two files. file1 file2 If column 1 in file 1 matches column 1 in file 2 AND the value in column 2 of file 2 is less than the value of column 4 in file 1, I would like to sum column 3 of file 2 over the matching keys. Then I would like to print each line from file1 with its corresponding sum from file2. Expected output I'm not experienced enough with awk or python to get this right but have tinkered around for a couple of days now. I would appreciate any help with this. |
Posted: 09 Sep 2021 07:11 AM PDT I have a file with the following format where the number of fields per row is variable: For each line, I would like to print the first four fields. For the remaining fields ($5 to NF), I want to print the field if the values in those fields is less than the value in $4. Example output: I've tried to wrap my head around a number of different awk options and have failed miserably. New to awk and would appreciate any help with this. |
Write AWK command's result into new CSV file Posted: 09 Sep 2021 09:13 AM PDT I have full list of files which contains this below texts. My goal is to get the important rows and save it into new CSV file and i'm using this below AWK command to sort the values from text but I don't know to write it into CSV file. My expected CVS result should be look like this. |
No output: busybox find . -exec sh -c ' readlink -f "$1" | tail -n +2 ' sh {} \; Posted: 09 Sep 2021 07:01 AM PDT I got access to only Busybox 1.31.1 I originally wanted to remove the current working directory of my output (the single dot). Example: When I: That's easily done with either: Now, what I tried before is: Which prints nothing. If verbose output is activated: Completely different output if the line address is one: What's going on? |
Use Docker on a systemd disabled VM Posted: 09 Sep 2021 07:10 AM PDT I am provided by a VM running Ubuntu 18.04.5 LTS which has systemd disabled. I have root access on it. I am trying to run docker on it which is installed but I get error Cannot connect to the Docker daemon at I cannot run I ran the command The OS is using Is there a way I can user docker here? PS: I asked the same question on ask ubuntu and a guy in comments told me to ask here. Edit: As suggested in comments I tried to start docker daemon manually by using
I am root, my terminal prompt is |
Spawn a terminal and redirect its stdout to original process Posted: 09 Sep 2021 06:51 AM PDT I'm trying to spawn a new terminal, execute a few commands and pipe their output to stdin of the original process. A mwe of what I'm trying to do is the following bash one-liner: where I spawn a new xterm window, print The code above prints both EDIT: the real case implementation of this is a file picker that uses fzf: |
What do the Block Device Capability flags mean? Posted: 09 Sep 2021 07:08 AM PDT Linux block devices in sysfs have a Looking in Listed here for convenience:
More specifically, Removable? Like removable USB drives? Relation to /sys/block/*/removable? Redundant? Whats extended devt? suppress partitions? no part scan? Different from suppressing partitions? UP? CD? Like "this is a CD drive"? Why? Means something else? Native capacity? |
Allow UFW rules in specific IP range Posted: 09 Sep 2021 08:04 AM PDT I need to setup some firewall rules but I do not want to open them to public since I am running an nginx server, how can I allow the follow rules only locally from IP address 192.168.178.0 to .64? sudo ufw allow 80/tcp sudo ufw allow 53/tcp sudo ufw allow 53/udp sudo ufw allow 67/tcp sudo ufw allow 67/udp |
Splitting long commands in shell scripts Posted: 09 Sep 2021 09:38 AM PDT I have been writing Unix shell scripts, but I'm inexperienced in proper formatting. There were many instances where I had to write long lines to be executed as a single command. Question is: Is there a way that I can split a single long line of a shell command into multiple lines, yet make it execute as a single command? |
reset failed login count / unlock aix/UNIX account Posted: 09 Sep 2021 07:38 AM PDT As system administrator it is necessary to lock / unlock users or to reset failed login count. let's look how we can perform lock / unlock users or to reset on UNIX/AIX |
Shared folder does not appear in guest CentOS (Windows host), using VMWare Posted: 09 Sep 2021 09:18 AM PDT I've been trying to share a folder between my guest, Cent OS, and host, Windows 10, using VMWare Workstation 14 Player. The easiest way, drag&dropping files from host to guest, does not work properly, as one or more files always ends up being of a smaller file size and thus corrupted, even though there is enough storage space in the virtual machine. Then I have done the steps below to enable folder sharing from the host to the guest OS: HOST WINDOWS 10
GUEST CENT OS
..but the I have gone through the VMware manual, and I am sure that I have followed their requirements. I am still not sure the VMware tools are installed completely, since typing Any suggestions? |
Unable to install VirtualBox. `complaining that the kernel module is not loaded` Posted: 09 Sep 2021 09:01 AM PDT VirtualBox was working on my computer until a few of days ago when I modified GRUB while attempting to customize it's Theme. Something I did started causing GRUB to load to a blank dark purple screen. Unless I choose Advanced Options from the GRUB menu and selected Optionally I have 4.10.0-16-generic as an option as well. But selecting that boots to a blank screen. I thought everything was fine, but discovered that I could no longer execute Upon executing Upon executing So then I execute So I searched Google for that package and basically nothing comes back. So re-reading the error above I thought that I should update. So I executed `` and I get this error, which believe to be the root of the previous error: Then I executed https://gist.github.com/s3w47m88/0e02e95cdfc2adab89951682d9c6a897 I have two issues
|
Linux local directory permissions as question-marks for non-root Posted: 09 Sep 2021 07:35 AM PDT I've seen cases like that with faulty storage devices, with faults in remote storage (SAN, NAS), I think I've even seen something similar caused by mount permissions. But it's the first time I see this happening on the same filesystem as my home directory. What kind of permissions are kicking in here? Definitely not mounts (I'm on the same ext4 filesystem), not SELinux, not ACLs. Then what? I do not recall how this directory was created. It's likely it got created by some kind of software. For me the weirdest part is that the directory is not even allowed to see its or its parent's info (last command). I'm using Linux Mint Sarah. Attributes: |
Join two files each with two columns, including non-matching lines Posted: 09 Sep 2021 07:44 AM PDT I'm trying to match and merge two sets of sorted data, one set per file. Each file contains two columns: the key field and the associated value. The resulting output should contain three columns: the key field, the value (if any) from the first file, and the value (if any) from the second file. I need to include lines of data that are not matched. First file "john" Second file "jane" Desired result I thought initially that this was a trivial job for But the result of the I need to be able to see from which source file the unmatched value originates, ideally by having those values in the appropriate second or third column of the result file, but I cannot work out a simple way of achieving this without descending into Any suggestions, please? |
How to sync bookmarks (favourites) between Google Chrome and Chromium Posted: 09 Sep 2021 07:01 AM PDT I'm new to the world of Raspberry 2 and Linux and I have install Chromium on the Raspberry. I did this because I thought it would be a good way to access my Google Chrome Bookmarks (Favourites). However, I'm having problems. When I log into Chromium in order to sync, I get the message:
I've tried a few hours later, next day, etc. I suspect the sync server being busy is not the problem. Can anyone tell me how to fix this problem and help me sync my bookmarks? The version of Chromium is:22.0.1229.94. I vaguely understand it's possible to get a later version. I'm new to Linux and would have to be told the explicit steps to do so. The Linux I'm running came with the Raspberry 2 and is some flavor of Debian (I'd report the version number if I knew where to look!). Finally, I'm not wedded to Chromium. I just want a browser where I can see my Chrome bookmarks and (ideally) have them synced every time I add a bookmark to Chrome or the browser on Raspberry. |
Using sed to add a URL to the start of every line Posted: 09 Sep 2021 08:42 AM PDT I have the URL (see below) of a certain web page that lists many different versions of a software package. The following one-liner gets me the latest version tar ball and its signature file out of the HTML. Probably not the shortest most efficient one liner, but hey, I'm learning and I'm open for feedback. The result of the above is this: Now, the next logical step (to me at least), is to pipe the output above into And then I want to pipe that right back into The question is this: How do I append the value of the bash variable But that only gives me the error: I also know that the basic concept is good, because when I use the following, I get good results... So, my guess is that I need to somehow escape all of the |
How to apply updates on OpenBSD, NetBSD, and FreeBSD? Posted: 09 Sep 2021 07:49 AM PDT I'm using OpenBSD for quite a while now. All I do, however is go from one release to the next, always just doing an update. I configured the system so it works as my router and firewall, and it works quite well like that. But I never update packages. All I do is just move on to the next release. Coming from the Linux world, I'm used to applying updates a few times a week; but how do I do that on *BSD? - Or is this not part of the *BSD philosophy? |
You are subscribed to email updates from Recent Questions - Unix & Linux Stack Exchange. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment