Recent Questions - Unix & Linux Stack Exchange |
- How to get PID of autostarting process?
- rename attachments using mailx command without uuencode
- Serial device (/dev/serial/) not showing up on Android
- bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs
- Capture PID of a background process while its output is redirected to a file [duplicate]
- Reading /dev/ttyS4 from a BeagleBone running Debian 10 not what is written
- Is it possible to copy a files name into another file which is located at a different directory in 2 arguments?
- Estrange \n at the end of the file name when checking my md5 files
- How can I shrink a BtrFS filesystem being a LV in OpenSUSE 15.3?
- `atq` lists a job even if it was executed yesterday
- What is "=" sign in bash?
- Combine multiple lsof options
- pom.xml, **/pom.xml, **/**/pom.xml, then **/**/**/pom.xml... What shortcut to target a file we know its name, whatever its depth in directories?
- Bitbake Congatec Yocto - hangs in step: parsing recipes. git ls-remote http://<user>:<key>@host/project hangs
- Alpine Linux becomes unreachable after a certain period of inactivity
- virt-manager Windows guest access Linux host folder
- How to replicate bios_grub partition?
- Find "latest" path, filename, date, and time at every level of a folder subtree with Bash
- Where should a shell script for a custom systemd service be installed?
- Ctrl + . shortcut in Fedora 35 (how to find app-defined shortcuts)
- I have copied a whole partitioned disk into a partition of another disk. How can I access the data?
- Ubuntu 20.04 will not boot on Dell Inspiron 3891
- Repair broken symlinks to new location
- mpc: access denied when adding mp3 file in a folder under music_directory
- Add something to crontab programmatically (over ssh)
- How to build an ISO of customized linux OS in a way that I can use the ISO to install on other systems?
- How to keep a history of backups?
- Is troff/groff relevant anymore?
- btrfs on openSUSE not releasing disk space
How to get PID of autostarting process? Posted: 22 Feb 2022 04:34 AM PST I wrote a small python script that logs data from USB stream. I used crontab ( How can I acquire PID of this autostarting script? |
rename attachments using mailx command without uuencode Posted: 22 Feb 2022 03:57 AM PST earlier I was using |
Serial device (/dev/serial/) not showing up on Android Posted: 22 Feb 2022 03:47 AM PST Trying to connect a serial device (3d printer) through the USB port in order to communicate with it (klipper firmware) on an Android device (LOS 18.1/Android 11, 3.18 kernel). But I can't find it in /dev/serial/, it only shows up as /dev/ttyUSB0 and /dev/bus/usb/001/00[^1] and I can't communicate with it through those. I've compiled the kernel with the ch341.c driver. 'lsusb -v' from a chrooted Debian through Linux deploy gives the following output, the device in question is called 'QinHeng Electronics CH340...': How can I communicate with the serial device? Are there any other kernel modules I should compile? Does newer Android handle serial devices in a different way than Linux does? I've seen other people run this firmware on Android in chrooted Linux like here, here, here. So it is possible, I just must be missing something. I'm happy to post other debugging information/logs. |
bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs Posted: 22 Feb 2022 03:55 AM PST I need help for a bash script that counts files and folders in a specified directory on a Linux system (Debian), but I want to exclude a specified folder. I have a main directory named Now I start some commands to get information about file/directory count and file/directory size, but I want to exclude the directoy My bash commands that work:
When I use commands 5 & 6 and the remote directory is mounted under the The commands eventually work and show the correct output, but it looks like the commands are still looking inside the excluded directory even though they shouldn't be, so it takes a long time to display the result. Where is my error or did I forget something in my commands 5 & 6? Or can I use other commands for my results? I need to count files and directories using 2 separate commands and exclude a specified folder that is mounted over fuse/sshfs to get a fast result. |
Capture PID of a background process while its output is redirected to a file [duplicate] Posted: 22 Feb 2022 03:21 AM PST Let's say I have the following command: How can I capture the PID of |
Reading /dev/ttyS4 from a BeagleBone running Debian 10 not what is written Posted: 22 Feb 2022 03:20 AM PST I am pulling my hears trying to make ttyS4 up and running on a Beaglebone black. I have set up UART4 in my /boot/uEnv.txt (see it at the bottom of my question). On the Beaglebone I have the comms cape and the RS-485 A/B are wired to the battery BMS device. The comms are 9600 bauds 8N1. To sniff the content I do:
And what I notice in the logs is that it is no the expected stream of bytes: I should have something starting with A5 01 90 08 XXXX for 13 bytes. What might have made the bytes different? What should I do to troubleshoot this? My uEnv.txt: |
Posted: 22 Feb 2022 04:44 AM PST In advance: If there is a similar question somewhere, I'm sorry for repeating it and please can you share a link of it. So I know with ls I can print a files name in a different file but how do we do the same thing if the destination file is in a different directory and only using 2 arguments? I have directories at ~/ with names A and B. And my 2 filenames at A are named 1,2 format is irrelevant but for sake of simplicity lets say they are .txt and B has 1 file with the name Total.txt. Edit: Can I copy the name of the files from A directory to a file(meaning when I open the file in B it will shot the names of the copied filenames from A) in B directory with as fewer arguments as possible in one line? |
Estrange \n at the end of the file name when checking my md5 files Posted: 22 Feb 2022 04:10 AM PST For a reason a do not understand when checking my md5 files, it fails because the name of the file have a \n at the end but the file name doesn't have this character. These are old files I have on my computer. If I do the same operation with md5 generated more recently, I don't get that error. Example: Can you see the I have check if there is a new line character at the end of this file with I have also tried I have also change the file name twice, first R1_001.fastq.gz to R1_001.fastq.ggz and then R1_001.fastq.ggz to R1_001.fastq.gz. And the same error with the same error I got |
How can I shrink a BtrFS filesystem being a LV in OpenSUSE 15.3? Posted: 22 Feb 2022 03:03 AM PST I have a Unfortunately the The mount related look like this: Now when I use Can I use Yast to resize the LVs and filesystems as intended? |
`atq` lists a job even if it was executed yesterday Posted: 22 Feb 2022 03:36 AM PST I created an My understanding is that Update: I just reviewed my script and it contains |
Posted: 22 Feb 2022 02:53 AM PST |
Posted: 22 Feb 2022 02:45 AM PST Is there any way to combine the |
Posted: 22 Feb 2022 02:44 AM PST To apply some changes to all my But I can't find the replacement that would target all the How can do what I did in a single command? |
Posted: 22 Feb 2022 04:37 AM PST Everything worked before. But at one point everything got stuck at the step of parsing recipes. How can i fix it? Update: I find that this command are hangs, and i have no idea why... |
Alpine Linux becomes unreachable after a certain period of inactivity Posted: 22 Feb 2022 04:38 AM PST I have installed Alpine Linux as OS for a mini server. I have correctly configured the server to be reached via ssh (openSSL) and my programs run on docker containers. I use a wired connection. The problem is that after a certain period of inactivity (no requests to the server), it seems as if the server disconnects from the internet. I can no longer connect it via ssh, and it also disappears from the list of connected devices. I have been looking for methods to disable sleep/hibernation of the OS and network card but found nothing. When I move the touchpad it becomes reachable again. I hope you can help me and thank you in advance. PS I use Alpine Linux because the hardware is old and I need to use as little ram as possible. UPDATE - SYSLOG: |
virt-manager Windows guest access Linux host folder Posted: 22 Feb 2022 02:46 AM PST I have the following configuration:
I've created a shared folder in Linux labeled Windows has built in Samba, and according to this post, I just need to find out which IP address the Linux host has (by using From the Windows guest, I could ping the IP of the host, but when I tried to map the drive, it won't see the host. What I'm missing? Questions:
PS: I'm not that knowledgeable about Linux. |
How to replicate bios_grub partition? Posted: 22 Feb 2022 02:50 AM PST I have a 60GB AWS volume which I want to shrink to 30GB. The plan is to manually recreate the same partition table (with the only difference being the main partition size), and then use At first glance, the source disk looks pretty simple: However,
|
Find "latest" path, filename, date, and time at every level of a folder subtree with Bash Posted: 22 Feb 2022 03:45 AM PST Using Bash, I want to find for any specified directory and its subtree the filename, creation_date and creation_time for the file last created in that directory. For example, the output would be: |
Where should a shell script for a custom systemd service be installed? Posted: 22 Feb 2022 03:54 AM PST I have recently created my first custom systemd service to run a script early in my machine's boot sequence. The custom It's a I'm not sure what the best location for the shell script is, so I've put a placeholder |
Ctrl + . shortcut in Fedora 35 (how to find app-defined shortcuts) Posted: 22 Feb 2022 04:37 AM PST I am running Fedora 35. When I press |
I have copied a whole partitioned disk into a partition of another disk. How can I access the data? Posted: 22 Feb 2022 04:35 AM PST A hard drive with multiple partitions gets Edit: For clarification - I guess a better term for the problem would be "nested partition(s)": Which also led me to this answer: Is there a way to allow nested partition tables? - my use case would be similar to the last paragraph, and probably a solution would be to use device mapper. But it seems there is no "easier" way to access the data. |
Ubuntu 20.04 will not boot on Dell Inspiron 3891 Posted: 22 Feb 2022 04:38 AM PST I have failed at installing Ubuntu. I don't know where I went wrong. I'm not very experienced in Linux and I'm sure I've made a simple mistake. Here's the situation. When I power up the computer, I see the Dell logo and then nothing. The screen is clearly backlit, but it is black. Nothing further happens. When I power up the computer and hold down Shift, I get the same result. When I power up the computer and tap F12, I can get to the BIOS (version 1.0.14). I can choose my boot order. I can point towards the drive with Ubuntu on it. I even have a selection called Ubuntu. It doesn't matter which of these I choose, the result is the same. There are no other operating systems installed on this computer. The OS I did attempt to install was Ubuntu 20.04 LTS. It was working a few days ago, but then I tried to update the firmware to 1.0.14. It said it was successful, but then I ran into this problem. If I put in the boot flash drive and choose it as a boot option, I will get apparent success. The installation GUI shows up. It says it works. I get the message that Installation is complete and that I should reboot. When it tells me to take the boot drive out, I do so. The machine is a Dell Inspiron 3891 Intel Core i5-11400. Brand new, straight out of the box. I have made no changes to the insides of this machine. I tried installing Ubuntu to the 256 GB SSD. I tried installing to the 1TB HDD. Same result. About two days into this troubleshooting process, I lost my temper and starting reformatting everything. In retrospect, maybe this was not the best move. I tried booting off the boot flash drive and running boot-repair. If I power the machine while tapping Esc, I do get GNU GRUB version 2.04. However, nothing seems to work from here. I found instructions that said I should type C at this point, but I got error: can't find command 'C'. I've run the Dell SupportAssist On-Board Diagnostics. It says all tests passed successfully. Yesterday I found an Ubuntu website that displays all the "Ubuntu certified hardware". It lists the Dell Inspiron Core i7 and the Core i9, but it does not list the Core i5-11400. I would give up at this point, but I did see it work at least once. My initial attempt worked great. I only ran into trouble when I tried to update the firmware. I KNOW this system can run this OS. I tried downgrading the BIOS to 1.0.13. This did not help. I tried downgrading to BIOS 1.0.12 and I got an error that this downgrade was not supported. I verified in the BIOS setup that BIOS downgrade is allowed, but it won't allow this. I don't know what BIOS was active when I first bought the machine, I didn't think to look. I originally burned the flash drive with ubuntu-20.04.2.0-desktop-amd64.iso with balenaEtcher using the default settings. I then tried the same ISO but using Rufus 3.13.1730, and burning the image as a dd. Its interesting that I get a little farther witih this. I can install the OS and then it will boot to the text screen that lets me choose Ubuntu, but then it dies immediately afterwards. It dies in the same fashion - backlight is on and slightly flickering, otherwise featureless black screen. Last night I noticed that Ubuntu now has 20.04.3. I tried downloading that ISO and burning it to my flash drive as a dd using my Rufus software. This flash drive won't even allow me to install. I can get into the BIOS and choose the flash drive as the boot medium, but when it tries to boot from the flash drive I get the same freeze. Dell logo nice and clear, then freeze on a backlit black screen. I did verify the checksum for this iso. There's no urgency to this question. I am taking a Linux class, but this problem has nothing to do with that class. I'm doing this for the learning experience. Well, that's not exactly true. I started this project for the learning experience. Now I'm refusing to give up out of sheer stubbornness. I'm lost. I don't know where to go from here. Can anyone offer advice please? Updated to add: I tried removing the CMOS battery to set the nvram back to factory defaults. I don't think it worked. When I powered the machine back on. I did get an error that the time was not set. However, the BIOS still had SATA set to AHCI and SecureBoot was still off. I am positive that when I first got this machine, SATA was set to RAID and SecureBoot was on. |
Repair broken symlinks to new location Posted: 22 Feb 2022 04:47 AM PST I moved from an old webserver to a new one. Now some symlinks not working, because we changed the folder structur. I want to know if there is a easy way to repair these links? I found the links with this command: The links looks like this: Now the links must look like this: So easy to say, all |
mpc: access denied when adding mp3 file in a folder under music_directory Posted: 22 Feb 2022 04:01 AM PST
mpd.conf, mpd service running under user. I can
|
Add something to crontab programmatically (over ssh) Posted: 22 Feb 2022 04:22 AM PST I have a deployment script, it must add something to a user (I can run so I have to do this: I don't see how to add/check/remove something to the PS : this is a user specific cronjob, "webadmin" is going to do it and he should not use sudo to do it. |
Posted: 22 Feb 2022 03:00 AM PST I have installed minimal version of centos6.7 on usb stick, copied/installed some applications/packages and customized accordingly. Now I want to build an ISO of my customized OS and want to install on other systems using ISO. Is that possible? Thanks in Advance. |
How to keep a history of backups? Posted: 22 Feb 2022 03:17 AM PST My intention is to create a "snapshot" of a certain hard drive on a server every day. How can I automatically make sure that the snapshot of today, three days ago, five days ago, 10 days ago (and so on) are being kept and cyclically replaced? I found a tool: duplicity, but I didn't find any way to achieve this using it. Should I go for a bash shell script? Is there any example I can take inspiration from? The system is running Debian. |
Is troff/groff relevant anymore? Posted: 22 Feb 2022 03:48 AM PST I've heard that troff/groff have largely been replaced by TeX. Is this true? The only thing that I know actually used troff nowadays is manpages. Is this also true? If not, what are some other uses? |
btrfs on openSUSE not releasing disk space Posted: 22 Feb 2022 04:35 AM PST I have an openSUSE 12.1 install on my main desktop running with btrfs filesystem for root (/boot is ext4). I started having issues today with KDE informing me that disk space is almost all gone and eventually it decided it was gone and crashed my desktop. I used Alt+F1 to switch to a terminal screen and although I was sure I was no where near the 1TB limit of my hard disk I moved some 150/200GB of music and video files onto an external drive and rebooted. Didn't help, same problem, same crash. Once more I switched to a terminal screen and used du to confirm that I had indeed only used about half of my total diskspace but df (including the btrfs-progs version) insists I have used 100% of available diskspace and so my desktop crashes each and every time I log in. Using the btrfs defrag utility doesn't help either. As such I am at a bit of a loss as to where to go next. |
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