Recent Questions - Unix & Linux Stack Exchange |
- The qemu service libvirtd/virtqemud crashes with an "End of file while reading data: Input/output error"
- Creating and arranging files into folders based on date and time in file name
- umask ACLs and socket permissions
- UNIX shell script to check the status from oracle table and move the file to appropriate direcoty
- Purge old folders without find
- RHEL7 not Booting Suspected issue in /DEV
- Shell scripts: How to copy past outputs of terminal emulator?
- where in the FHS does command less store its buffers?
- Adding custom field to the subject line in a opensssl X509 certificate via command line
- How do you expand a variable in a heredoc as one argument when its value has spaces?
- echoing value in same indexes of 2 arrays simulataneously
- tail -f executed of ssh repeat output multiple times
- How do I boot into pop!_os on an older bios
- Use self-built Mesa binaries with startx?
- How can I remove lines from my file according to a threshold in Unix?
- Errors were encountered while processing libc6:amd64
- Why does awk behave differently for $1 if the value is 0 (number zero)?
- Checking for freetype2 configure error when installing PHP 5.6.37 from AUR
- GTK+3 change text color in a label (raspberry pi)
- How can I detect whether an "NMI watchdog: BUG: soft lockup" is a hardware or a software issue?
- expect: get error status when spawn command fails
- Cron tab to run a java file
- Bash: Assign output of pipe to a variable
- How do I get Mint to recognize my laptop's microphone as a mono input instead of stereo input?
- Share wlan connection to ethernet using command line
- How to create folder shortcuts in file manager?
- How to Extract Album Cover Image from MP3 file?
Posted: 10 Apr 2022 11:36 PM PDT |
Creating and arranging files into folders based on date and time in file name Posted: 11 Apr 2022 12:45 AM PDT I have many files in a folder The first 10 characters shows the date, followed by the digits which is the time in 24 hour format. The rest is the file details which we can ignore. I want to create folders within the For eg: The file Can you please help with the bash script to achieve the grouping of files in folders like mentioned above? |
umask ACLs and socket permissions Posted: 10 Apr 2022 10:16 PM PDT I looked at the answer here How to set default file permissions for all folders/files in a directory? And set the acls using setfacl Now when I create a file using I get the write permissions
But when I create a socket using I do not get write permissions on the socket
However setting umask to 0 gives me the write permissions What is the difference here? Why is umask needed for a socket and not needed for creating a file? |
UNIX shell script to check the status from oracle table and move the file to appropriate direcoty Posted: 10 Apr 2022 10:12 PM PDT I have a requirement to loop through sales files in UNIX and then check the status of file in oracle table (status column in svc_posupld_status table) . If the status is C then move the file to "done" directory. If the status of file is not C , then move the file to "reject" directory I have written following code How do I check the status and move files accordingly? |
Purge old folders without find Posted: 10 Apr 2022 10:16 PM PDT Here I am trying to delete old folders which are older then xdays. Path of these disk are mentioned in file_path.txt What I need here is to search each path available in the mentioned file & delete those files which are available. Below is what i have tried so far, but not working. |
RHEL7 not Booting Suspected issue in /DEV Posted: 10 Apr 2022 09:07 PM PDT My machine is a blades server on which Base OS is "RHEL 7" which runs on locally attached SSD. On this base machine I have three VMs on which one SAN LUN is mounted (its not mounted on base machine) While creating new VM through KVM , I accidentally selected /DEV partition which was through "devtmpfs" after which KVM crashed and machine is not coming up
after selecting rescue mode and going into single user mode I am able to see everything, even /DEV and no change is visible there Rescue booting through USB ISO is also working and I am able to enable network and transfer . Please suggest what to do |
Shell scripts: How to copy past outputs of terminal emulator? Posted: 11 Apr 2022 12:16 AM PDT I want to make a shell script which copies the past outputs of the GUI terminal emulator (for example, last 20 lines). The motivation is as following: When I execute a procedure which requires long time (for example, downloading a very large file, or converting a very large movie file), I sometimes remember another job, and I have to leave the room. In such a case, I press ctrl+z to stop the procedure. And I type then I leave the room. This way works and is not bad. But it has a disadvantage that I cannot read the outputs of the procedure. I can know only the status ($?). So I want to copy last 20 or 40 lines and save them in log file. |
where in the FHS does command less store its buffers? Posted: 10 Apr 2022 07:42 PM PDT Using Kubuntu 20.04, which is running from an USB stick. Therefore there is a The cause of my current state is, that I have forgotten to disable the internet connection. Before, I have used aptitude to search, but I have not intentionally downloaded something. Overnight from the 16 GB in "cow" about 2 GB have gone used. Now I am investigating, who has done what. For this I have running (for many hours) a self-written program For this I have continuously running the
But neither in So the question came up, where in the list of I have read the documentation to
A new question came up. I have changed my calling sequence and do no longer use "less" here. Nevertheless my question is of general importance for me. And perhaps for the place where the buffers of less are, I have not written the appropriate term "storage". I have ment "in memory or on disk". less buffers should have an effect on either "free" or "df". And this should be noted in some documentatin. Now my command chain is: /.../wels_fullpath -d / 2>/dev/null | grep -v -e "^fd1" | sort -s -r -k7,8 >/tmp/WEx01 As I see in "top" ("htop" is not installed by default) the execution is yet on the very beginning: top -p <PID> shows: PID USER PR NI VIRT RES 2159985 root 20 0 242132 235816 SHR S %CPU %MEM TIME+ 3160 R 99.3 0.7 1634:33 COMMAND wels_fullpath In my program I use an array. And while reading the files in the source "/", they are written into the array. Thus VIRT and RES are continuously growing, ok. But my perpetually running "watch" of "df" and "free" does not show these changes. The values in "free" varies by a very small amount up and down. Thus my additional question is, please: why the growing memory usage of my program is not reflected in "free"? is there an utility in Linux, Kubuntu to analize and display a l l aspects of memory (like "df", "du")? Regards antondhidh |
Adding custom field to the subject line in a opensssl X509 certificate via command line Posted: 10 Apr 2022 11:17 PM PDT I am attempting to generate a CSR for a certificate and wish to include a unique id as part of the certificate subject line. this information shall be used by the TLS client for some purpose after the certificate is validated (via normal TLS validation method) and the connection is established. I am using a script to generate the CSR automatically and I don't have the option to modify the openssl config file present in the system. I understand that there is a option to generate a temporary ssl config for this purpose where I can specify additional attributes and values into it. But for simplicity I am attempting to avoid it untill I absolutely have to use it. I am trying the following command but geting a warning mesaage as follows: Is there a way to pass the UUID via command line? If not, is the only other alternative is to use a temp config file? |
How do you expand a variable in a heredoc as one argument when its value has spaces? Posted: 11 Apr 2022 01:03 AM PDT I've created a script to upload via lftp: If the current directory does not contain spaces, this works correctly. The problem occurs when the current directory does have spaces. Here is what the debug information shows: As a result of this issue, the script uploads to directory named I'm not sure how to fix this problem, especially because I don't know which line is where I went wrong: Regardless, I was expecting that debug output to look like this: This question is similar to a lot of others I researched to get this far. What makes this different/hard to Google is that the expansion is happening inside of a "here string". For all I know that's irrelevant, but for all I know it could be critically unique, too. Comments suggested I store everything into an array. Here's my attempt to do so: (* I can't figure out how to have multilines in a subshell. That's why I put actual newlines in there, but I'm not sure if that's the correct thing to do. Every result I google has to do with command substitution, not subshells.) When I run this, it gives me this error: Calling running As you can see, at this point, I'm just trying random stuff and hoping it'll provide insight. Not a good strategy. |
echoing value in same indexes of 2 arrays simulataneously Posted: 10 Apr 2022 11:05 PM PDT I have 2 arrays to prcoess in bash script simultaneously. First array contains sort of lables. Second array contains values, as under What's required is: a loop that will echo the indexed-item from LABELS array & and in front of that corresponding value for that item from VALUES array, as under I guess nested loop will not work, I tried below, but it won't work by syntax |
tail -f executed of ssh repeat output multiple times Posted: 10 Apr 2022 09:08 PM PDT I am trying to monitor a file remotely. Since I cannot install additional useful applications on the source I plan to use Since I'm only interested in the last line I also use Testing the command without any piping or redirection (that'll come later): Running this I get the expected output. However, any subsequent tail updates will produce multiple output lines. e.g. test file: On client side run Output: On server side On client side output: As a test I redirected the output to a file locally. In that case, I get one line in the file and one less line in the local console output. I tested this from and to different client-server combinations and so far I can only replicate this from MobaXterm to SLES 12 SP1. The question is, before I call this a bug, are there any settings on either side that may cause such behaviour? |
How do I boot into pop!_os on an older bios Posted: 10 Apr 2022 09:59 PM PDT I recently downloaded pop!_os onto my older dell laptop and it worked somewhat for a little bit. Until oneday I opened up my laptop and it wouldn't boot properly. It loads me into a busybox v1.30.1. But it is not specific on the problem I've tried everything I've been told to do. When I run the exit command it tells me Please help me fix my computer. |
Use self-built Mesa binaries with startx? Posted: 10 Apr 2022 07:17 PM PDT How can I use self-built Mesa binaries with
Running ...sadly doesn't work: The Mesa binaries work fine if I have System information:
|
How can I remove lines from my file according to a threshold in Unix? Posted: 10 Apr 2022 10:13 PM PDT I have an input file with different columns, like the following: Now, I'd like to remove the rows at which the P-value is less than 2.23E-308, in order to have the following output file: I ran the following command in the Unix shell: However, I still have the first input file, with all the rows... Is the command wrong? May be there a problem in recognizing the set threshold? I am using Linux. |
Errors were encountered while processing libc6:amd64 Posted: 10 Apr 2022 09:03 PM PDT I installed WSL Kali Linux, then I typed I tried Here is the screenshot. I really need help to solve this issue |
Why does awk behave differently for $1 if the value is 0 (number zero)? Posted: 11 Apr 2022 01:10 AM PDT When awk receives "0" as input, it behaves differently in some cases. Code below: The output with "0" (number zero): The output with "1" (number one): Why is there a difference when I use Versions:
|
Checking for freetype2 configure error when installing PHP 5.6.37 from AUR Posted: 10 Apr 2022 11:01 PM PDT I'm trying to install PHP version 5.6.37 from AUR using
I already have 7.2 installed, but I need the 5.6 for an older project, and as in Ubuntu, I intend to have both installed. Installing |
GTK+3 change text color in a label (raspberry pi) Posted: 10 Apr 2022 10:08 PM PDT I am trying to change the color of text in a label on the fly at runtime. I've tried applying a css style, I've tried two depreciated methods, and none of it works. Can it even be done, and if not, why is something this simple not available? Applying a css style on the fly partially works: when I specify at runtime I can see the background turn pink. But the text stays white. |
How can I detect whether an "NMI watchdog: BUG: soft lockup" is a hardware or a software issue? Posted: 10 Apr 2022 10:06 PM PDT Soft Lockup
Related questions are
I have also read/commented at - https://github.com/zfsonlinux/zfs/issues/4536 QuestionHow can I detect whether it's a hardware issue or, as I think, confirm it's an issue related to the kernel/software? DetailsLinux DistributionFuntoo-Linux, a rolling distribution KernelsI have (at least) observed the "BUG" while using the following kernel(s) versions:
ConfigurationI use a custom configuration to compile the kernel. It's mostly the same configuration I use(d) for long time, when there was no "soft lockup" problem or whatsoever related to a "watchdog". I can copy-paste or link the configuration file. However, two important settings I have found else to be "required" ZFSI observed the "BUG" while using ZoL versions
|
expect: get error status when spawn command fails Posted: 11 Apr 2022 12:04 AM PDT The below is the sample of a script which we execute daily for getting info from the server. For the last couple of days, some server data is missing from the output which is captured on the local file Is it possible to get error status when the script is executed, but its unable to connect the server? So that we have a black line or and error status instead of output? |
Posted: 11 Apr 2022 01:00 AM PDT I'm having issues getting a cron tab to run a java file every 5 minutes. I have tried to create an executable script to see if that is what's needed: My script and java file are both stored in This is what I have in my script Sorry update - my JAVA_HOME file is not stored in usr/java but in usr/share/doc/openjdk-6-jre-headless. However when I enter that path in the executable script file I don't have permission to do so. Brand new to creating VM's so apologies for my utter confusion here! |
Bash: Assign output of pipe to a variable Posted: 10 Apr 2022 10:33 PM PDT I am trying to get the output of a pipe into a variable. I tried the following things: But I don't want to do: Because I don't want to spawn a subshell. Any ideas? Edit: I don't want to spawn a subshell because the command before the pipe needs to edit global variables, which it can't do in a subshell. Can it? The And I don't get, why that doesn't work. This works for example: |
How do I get Mint to recognize my laptop's microphone as a mono input instead of stereo input? Posted: 10 Apr 2022 08:07 PM PDT I'm having an issue with Mint XFCE 17.2 detecting my laptop's internal microphone as a stereo microphone at a hardware level. The problem is that, since it's a mono device, the microphone's "right channel" is complete static: As I've come to find out, the non-existent right channel is "floating", and when its signal hits the amplifier it gets amplified into static. I've discovered that it's possible to silence the right channel via PulseAudio, but this leads to weird things like my voice only coming in on the left side during Skype calls. How do I get PulseAudio (or maybe alsa at a lower level) to see that the microphone is a mono input? Is it possible to somehow tweak the audio drivers? And I have tried creating a virtual source that maps the mic to a mono source: This successfully created a second mono input that seems to work fine in Skype/etc...: But I'm not happy with this virtual input since I still have to keep the right channel on Silence on the hardware device itself. In addition, when I try to adjust the hardware device's left channel levels via PulseAudio, for some stupid reason (a bug perhaps?) Pulse automatically locks both channels, which causes the right channel to snap to the left channel's levels. This is despite my turning off channel locking beforehand. I then have to manually disable the channel lock and set the right channel back to Silence. In the end I'd prefer to fix the underlying issue and get the microphone properly recognized as a mono input. Any advice? |
Share wlan connection to ethernet using command line Posted: 10 Apr 2022 10:07 PM PDT I have a wlan1 connection that I want to share to other computers on my LAN (via Ethernet - eth0). As this is somehow a temporary solution, I want this to be done by a script, so that I do not touch the network configuration files of my host (i.e I'll run this script after each reboot if I want to). The problem is that I am unable to bridge wlan1 and eth0. I saw that one needs to enable 4addr: Indeed, I can then add wlan1 to the bridge, but ... I lose the wifi connection! I saw this is also a common issue :( In 2, the solution says to do this where $ADDR is "WDS device address configured in the router". I don't understand what that is? The MAC address of my network card for wlan1? And how should I then create my bridge? The following is not working: Or here, they suggest to install So, can somebody please help me create that bridge correctly? So far, my wifi script is: I am running a Linux Mint 17.1 host. I have installed |
How to create folder shortcuts in file manager? Posted: 10 Apr 2022 11:37 PM PDT I'm using Thunar. What i want is remove |
How to Extract Album Cover Image from MP3 file? Posted: 10 Apr 2022 10:08 PM PDT I have a bunch of MP3 files that have their album art included within the file itself. I am now looking for a way to extract them to store them separably, at best from command line. Is there a way to achieve this? |
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