Recent Questions - Unix & Linux Stack Exchange |
- filter the data from an inputstring
- mv + is it safe to move huge data from folder to folder
- How to grep the difference between two files into a file
- Filling dynamic array [duplicate]
- How to grep selected strings separated by -
- Easy way to output a file and change the implicit newlines ($) in the file into literal (\n)
- How to enable sudo privileges for user group to apt-get install anything
- Problem with .bashrc when I use anima command
- How to handle CHMOD permissions like an expert?
- Compressing AMD graphics include directory "asic_reg" saves up to 230MB Linux Kernel storage size. Could make automate to (un)compress?
- Find Directories Older Than X Days Named in YYYY-MM-DD & Delete If Exists
- How to show debug info on Kwin task switcher error?
- Does "no-auto-down" and "no-scripts" support pattern matching interfaces in /etc/network/interfaces?
- For every string in file1.txt check if it exists in file2.txt then do something
- Parse pylint result to extract score?
- Trim column X leaving a specific number of chatacters if column Y and column Z are not equal to NULL
- preserve environmental variables with find -exec
- What are the benefits of this command line (/usr/bin/awk '{$1=$1};1') instead of pure cat
- Installing chromium-browser:armhf and libwidevinecdm0 on Ubuntu
- how to clear the lastlog file without interruption
- Errors from nouveau display driver on Debian - firmware: failed to load nouveau/nvc1_fuc084 (-2)
- i2cdetect addresses 7-bit or 8-bit?
- How to blur webcam background in Microsoft Teams
- Problem getting user input through script called by pam_exec
- Getting "no IPv4 addresses" With isc-dhcp-server And Subinterfaces
- SSHFS fails, Error - read: Connection reset by peer
- Openvpn client and server cannot ping each other(Connection established)
- Apache redirect full URL with RewriteRule
- Automatically run rfkill unblock on startup
filter the data from an inputstring Posted: 15 Feb 2022 04:52 AM PST If user inputs the employees details as string and we want the output to display the employees with the top three years of experience in the same order of employee details as they apper in the input string. For example input string:
Output string: For example input string: could anyone please tell me how to achive this in shellscript |
mv + is it safe to move huge data from folder to folder Posted: 15 Feb 2022 04:52 AM PST the used size of folders under in our script we use as following example: since we are dealing on size around |
How to grep the difference between two files into a file Posted: 15 Feb 2022 04:25 AM PST Saying that I have two files: a.txt and b.txt. The content of a.txt: mosfet23 cap098 inductors 98 metal96 The content of b.txt: test 23 cap098 drc45 metal 96 lvs cap 098 Of course I can use vimdiff to check their difference My question is how to record devices which exists in a.txt but doesn't exist in b.txt into a file? also we cant use comm as b.txt is not sorted? How to achieve using tcl,grep or sed? |
Filling dynamic array [duplicate] Posted: 15 Feb 2022 04:23 AM PST I am new to shell scripting. I am trying to create an array ,where the string When I run the above script, I do not get any output. Where as I want output as
Can someone tell me where am I going wrong? |
How to grep selected strings separated by - Posted: 15 Feb 2022 04:45 AM PST I am new in grep and I have a list of packages where I only need to display certain results. Here's a list of packages: I've been trying to use regex but I'm sure that there's something wrong: Here's my expected output: What is wrong/missing in my command? |
Easy way to output a file and change the implicit newlines ($) in the file into literal (\n) Posted: 15 Feb 2022 04:56 AM PST I have a file with a number of invincible Newlines. In Vim it's shown as Example: To see the newlines in vim enter :set list. With this command, I could format the output as wanted: however, I think there should be an easier way with |
How to enable sudo privileges for user group to apt-get install anything Posted: 15 Feb 2022 03:32 AM PST I want to give a group permission to install software without needing to input a root/sudo password. I'm on Linux Mint 20.3 Cinnamon. I have created a group called "basicsudo". I first typed Then then I added the following line
to I assigned the group to a user by using the from my account. When logged in as Alice, this is confirmed But when trying to execute the following line as Alice, I do not succeed: So clearly a) I'm prompted for a password and b) I can't execute it despite entering a password. What is the proper way to do this? |
Problem with .bashrc when I use anima command Posted: 15 Feb 2022 03:00 AM PST I cannot use animaConvertImage in on an internal file in a folder other than the one where the anima commands are located. I tried using the .bashrc file, but to no avail, specifically: -I added the following lines to my
And added: and finally closed the terminal to make the changes active. Then when I go to use the command: With dwi folder external to the Software folder I always get as output: -bash: animaConvertImage: command not found How can I solve the problem (I'm not sure if the two are connected to each other since I'm a beginner)? |
How to handle CHMOD permissions like an expert? Posted: 15 Feb 2022 03:21 AM PST From years, I am trying to fake I know how unix permissions works, but In fact, I don't understand anything. www-data is the apache2 user My own user is my_user, it's having sudo access I am using root by using www-data is having all permissions on I can not connect as www-data and I want to PhpStorm to deploy on this server, using my_user. So, by default, all folders are r-x, so I allow www-data's group to have full access (As root)
Then I add my user to this group (As root)
Now, logged my_user and phpstorm deployment are still returning "Permission denied". I disconnect my user, reconnect it and now this is working... What's going on dude ? So, I restart PhpStorm and this is working now. I pushed my new folder on the server and I am now listing files
Wow buddy, I really need www-data to be able to read it, and edit it, and run it... I would like the new folders and files are owned by So, what is the best and definitive solution about these permissions issues ? |
Posted: 15 Feb 2022 02:57 AM PST Cloning a current kernel (e.g. 5.17-rc1 ) to a source directory requires around 1.4GB and a total of 2GB (debug kernels up to 4GB) free storage for compiling a default kernel configuration. While AMD's gpu include files are a huge part of that source download (mostly asic_reg directory) these are only required with utilizing an AMD gpu. Compiling from sources was flawless, having only that bzip2 file available and no AMD gpu devices configured. So far that had no interest, because there are no hints or questions about that idea/improvement within Unix & Linux database. |
Find Directories Older Than X Days Named in YYYY-MM-DD & Delete If Exists Posted: 15 Feb 2022 02:52 AM PST I tried to create this one liner bash script which finds and then deletes directories older than X days based on their file names and code works flawlessly. The only issue is that if directory exist and is removed successfully, it still errors out "find: '/var/www/html/resources/cache/2022-02-08': No such file or directory" Although I have put the condition which checks if the directory exists in result of find command and then delete it. Let's say I have following directories located at /var/www/html/resources/cache [ "$(date -d "6 days ago" +%Y-%m-%d)" ">" "$(basename $d)" ] checks if file name is older than 6 days [ -d $d ] checks if its a directory |
How to show debug info on Kwin task switcher error? Posted: 15 Feb 2022 01:23 AM PST Recently I've installed Present Windows Clone tasks switcher on KDE store, but it won't work. Whenever I try to switch windows, it prints to notifications: I've checked the source code and know that it's because it is too old and doesn't work on new plasmas(uses 1.1 APIs instead of 2.0). I tried to switch to new versions of KDE APIs in qml, but none worked. So it's pointless, trying to change the code without debug info. So how could I see detailed log of this notification error in KDE? P.S. Arch Linux x86_64, 5.16.8-arch1-1, Plasma 5.24.0, KWin, Wayland. |
Does "no-auto-down" and "no-scripts" support pattern matching interfaces in /etc/network/interfaces? Posted: 15 Feb 2022 01:17 AM PST I tried reading the manual from https://man.cx/interfaces(5) and searching for some open-source code. The case I found was: But I want to know, for example, the following example is correct or not: |
For every string in file1.txt check if it exists in file2.txt then do something Posted: 15 Feb 2022 04:04 AM PST I got two txt files, file1.txt file2.txt I'd like to compare those files, so that for every device(diode,bjt,etc) in In this example, file3.txt how to do this with i have tried grep -vf file1 file2. But is printing the differences between both these files....i want ouput only if the devices mentioned in file1 is absent in file2 not vice- versa. |
Parse pylint result to extract score? Posted: 15 Feb 2022 01:33 AM PST I am building a github CI using action and I was able to run pylint and write a message to PR with the result. However, I want to parse the exact score so I can fail the action if it's bellow a certain threshold, here is my relevant code: What is the command to parse the pylint results which is currently saved as $OUTPUT, and parse the exact score to save it in $SCORE? This is the output example, I need to parse the "0.18" part: |
Trim column X leaving a specific number of chatacters if column Y and column Z are not equal to NULL Posted: 15 Feb 2022 03:01 AM PST I am trying to find a way to use awk/sed to filter a csv to truncate the value in a specific column such as column 1 to retain the last 8 characters and replace the beginning with a wildcard, only if two other specific columns are not equal to NULL- such as col 3 and col 5 Example data: Would become: I have scripted this using a series of pipping |
preserve environmental variables with find -exec Posted: 15 Feb 2022 03:50 AM PST Is it possible to preserve environmental variables with find -exec? I don't see any options using the FreeBSD version of find. I can switch to a for loop if absolutely required, but was hoping to use the brevity of exec as well as it is faster. The other option I can think of isn't pretty and that is dumping the environment and then reading it back in in the command I'm executing. EDIT: In this example, I want go to use the http proxy. I already have code that tells git to configure a global http proxy (above this). So, from the example below, I need to preface this with sh? Why? |
What are the benefits of this command line (/usr/bin/awk '{$1=$1};1') instead of pure cat Posted: 15 Feb 2022 03:54 AM PST I am reading the AWS What is the of benefit awk? Isn't |
Installing chromium-browser:armhf and libwidevinecdm0 on Ubuntu Posted: 15 Feb 2022 03:18 AM PST I'm trying to install chromium-browser:armhf and libwidevinecdm0 on my Raspberry Pi (Ubuntu 21.10 64 bit) by doing the following command: According to this instruction. But I'm getting the following output:
|
how to clear the lastlog file without interruption Posted: 15 Feb 2022 02:19 AM PST on our rhel machine ( production server ) we noticed that lastlog is huge we not want to interrupt the OS logs that always wrote to log but we want to clear the lastlog is it ok to clear the lastlog as second how is it possible to disable writing to lastlog as permanent? |
Errors from nouveau display driver on Debian - firmware: failed to load nouveau/nvc1_fuc084 (-2) Posted: 15 Feb 2022 01:42 AM PST I've installed Debian 11 with dual boot on a laptop of mine lately. I installed the official image, so no non-free drivers got installed. I had some driver issues reported when using At some point I've decided to add the I was getting errors from the nouveau driver before that too (despite the fact that my screen was using the full resolution), so I was just trying to make the errors go away. I've tried the I've also tried the instructions here: https://wiki.debian.org/NvidiaGraphicsDrivers#Debian_11_.22Bullseye.22 Again, my resolution dropped. I think that, in both cases I've installed a legacy driver (most likely My graphics card seem to be a Eventually, I have uninstalled what I had installed (hopefully - not sure if anything stayed behind...) and my resolution is now restored, but I still get the same errors in These seem to be the only remaining errors. If we exclude the bluetooth one at the top (which I have no idea why it happens), you see the failing nouveau driver afterwards. And I am a bit confused by it really, because (from my understanding) the nouveau driver is supposed to be shipped with the kernel. So, why would it fail? How could there be a missing dependency to it or anything like that? I think I also tried installing it (nouveau) with apt, but nothing got installed. Not sure what would happen if one of its dependencies was the wrong version (if it would be replaced or not). I guess it would be replaced if the existing binary is an older version, but I am not sure about that. So, if anyone has any idea what I could do, feel free to drop his ideas. This is my first time dealing with Linux drivers, so I am a bit clueless. For sure, I could just ignore the problem, since my screen seems to work fine. Just, I can't unsterstand what is going on here... If the driver doesn't load, why is my screen working OK? |
i2cdetect addresses 7-bit or 8-bit? Posted: 15 Feb 2022 03:09 AM PST Are the addresses reported by I'm starting to run some experiments, but it would be nice if the manpages were a bit more explicit about the reported format. |
How to blur webcam background in Microsoft Teams Posted: 15 Feb 2022 01:58 AM PST I am currently using Teams for a master and I would like to blur my backgrounds, do you know any way to do it? |
Problem getting user input through script called by pam_exec Posted: 15 Feb 2022 02:07 AM PST I was trying to use pam_exec.so on Ubuntu to call a script, prompt for user input and allow the user to log in through SSH if the script exits with an exit code of 0. I was unable to get this to work. So I wrote a simple script as follows to test pam_exec.so and see if the problem was with my original script. However I am getting the same issues even with this simple script. /usr/local/bin/test.sh I called it by including the following line after But when I SSH into this system as seen below, I do not get a prompt to enter any input. As soon as I enter the password, I get logged in. However, the output of the script is visible. Then I changed the above script as follows to exit with an exit code of 1 if no input is given. Then I am unable to SSH into the system (screenshot below) even when I enter the correct password and I do not see any output of the script. So what I want to know is how can I correct this problem and use pam_exec.so to run a script, get user input, and allow ssh authorization only if that script exits with an exit code of 0? |
Getting "no IPv4 addresses" With isc-dhcp-server And Subinterfaces Posted: 15 Feb 2022 01:04 AM PST I have tried both subinterfaces and secondary ip address route and neither are working for isc-dhcp-server. It is refusing to pull the proper IP's. I am using Debian 8 Jessie and ISC-DHCP-SERVER 4.3.1. My /etc/network/interfaces ifconfig ip add /var/log/syslog when starting isc-dhcp-server |
SSHFS fails, Error - read: Connection reset by peer Posted: 15 Feb 2022 01:21 AM PST SCP is working, but the sshfs is displaying the above error. |
Openvpn client and server cannot ping each other(Connection established) Posted: 15 Feb 2022 04:01 AM PST I have setup OpenVPN client and server between two VPS. I have a client and server setup, server using server conf: client conf: As per the logs connection is setup successfully, And tunnels are established at both ends: Server Client The client also able to ping and ssh to server via the gateway IP But not able to ping the opnevpn ip's from server and client. |
Apache redirect full URL with RewriteRule Posted: 15 Feb 2022 03:06 AM PST I have a redirect problem with 'RewriteRule', i have this in mt .htaccess: If i go to foo.domain.com redirect to www.domain.com/foo/ and it's ok, instead i go to foo.domain.com/bar i have an error, must go to www.domain.com/foo/bar. Where is error? |
Automatically run rfkill unblock on startup Posted: 15 Feb 2022 04:22 AM PST I'm running Elementary OS on an old(er) HP Pavilion dm1. Unfortunately, on startup my wireless is hard disabled, and I need to run Is there any way to either: 1) Automatically run this line with startup 2) Not need to do this anymore? When I use rfkill to view any blocks, there's a hard block on the wireless, and the wireless button's light is orange. Pressing the button does nothing. After running the line, I can switch wireless on and off at will. |
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