Recent Questions - Unix & Linux Stack Exchange |
- Why does every directory have "." and ".." dots?
- CPU speeds on linux
- Starting ffplay X-window without a window manager
- Are Linux commands included with or part of the shell?
- upgrade RHEL version 7.6 to RHEL 8.4 ( offline )
- Problem with running a script as a startup program
- Tools for batching N commands over L scripts (for N≫L)?
- Having two separate grub configs
- How to insert code before matched multi-line of code with sed?
- Capture picture after unlocking screen / logging in i3
- Bluetooth not working, cannot turn on
- Is there anyway to see my REAL DNS server
- Port forwarding does not work using different gateway
- automatically connect to vpn on system startup using systemd
- How does VA to PA translation in a 4-level page table just take 4 memory accesses
- How can you determine which EFI System Partition was used to boot a Linux System?
- Environment variable expansion inside $(command substitution)
- Debian kernel - why do I need the firmware file if the driver is compiled in the kernel?
- Edge case - detecting input on STDIN in perl
- If using while read loops for text processing in bash is bad...what should I do, then?
- Can you make a bash script's option arguments be optional?
- key signing: can't see new signatures
- How to start a systemd service based on ExecStartPre execution result
- (Buildroot) "silentoldconfig" error on compile
- Manual Duplex printing
- Missing separate debuginfos
- Can't seem to connect to my Debian Mysqli Server?
- Wipe last 1MB of a Hard drive
- How big is the pipe buffer?
Why does every directory have "." and ".." dots? Posted: 15 Aug 2021 09:55 AM PDT A historical question. I tried searching for the answer to this, but no luck. Every directory contains a "." and "..", even ROOT (/) contains "..", but why? Neither seem necessary from my admittedly limited perspective.
So rather than mandatory, the dot and dotdot seem to be more of a shorthand. As downsides, they prevent the creation of any file named "." or "..". Also, they can make listing/manipulating files that start with a dot more difficult/error prone. To be clear, I'm not asking for a change. I'm just curious how we ended up here? |
Posted: 15 Aug 2021 09:31 AM PDT I am a new Linux user and have just recently installed Mint. In my bios I have my cpu set to a constant speed of 4.1 GHZ. In windows it shows as 4.1 GHZ but in Linux it shows up as just 3600 GHZ. I have a 9700k so basically whenever I boot onto linux my cpu speed is set back to default. is there anyfix to getting my cpu speed to run at 4.1 GHZ in Linux? Thanks |
Starting ffplay X-window without a window manager Posted: 15 Aug 2021 09:17 AM PDT I want what is essentially a kiosk, to display a video stream using ffplay, without a whole Desktop environment. I started with minimal CentOS7, and installed xterm and X11, per this simple guide: https://linuxconfig.org/how-to-run-x-applications-without-a-desktop-or-a-wm I've created a .xinitrc file: and when I execute But, when I replace the .xinitrc file with this one: I just get a blank screen, in spite of knowing that ffplay command is right. Though I can tell from Note the CentOS7 box is a Hyper-V VM, which I am accessing via a Hyper-V console. |
Are Linux commands included with or part of the shell? Posted: 15 Aug 2021 09:53 AM PDT I am trying to figure out the different components of Linux and how they work together, and I have a terminology related question. The terminal runs the shell, which is usually Bash. One can also run Linux commands (e.g. ls, mkdir and cp) in terminal. But then I learned that not all Linux commands are part of bash (or shell). Does that mean that the terminal does not run shell only? |
upgrade RHEL version 7.6 to RHEL 8.4 ( offline ) Posted: 15 Aug 2021 09:17 AM PDT we are trying to upgrade our RHEL server 7.6 to RHEL 8.4 as but finally we get the following errors any idea how to continue from above stage? note: under |
Problem with running a script as a startup program Posted: 15 Aug 2021 08:00 AM PDT I wrote a script and added it to Now this script works absolutely fine when called by its name on the terminal. A sample output would be something like this when called from the terminal. but when I add it as a startup command on my MX Linux computer, it just adds the timestamp to a file named tlmgr-update and opens it. |
Tools for batching N commands over L scripts (for N≫L)? Posted: 15 Aug 2021 08:53 AM PDT Let's say that I have access to a high-performance Linux cluster equipped with a scheduler (e.g. LSF, Slurm, etc.) that will allow me to have up to M jobs either running or pending at any one time, of which at most L < M can be running concurrently. Now, suppose that I want to run N independent commands as quickly as possible. If N ≤ M, I can just submit each command as a separate job to the scheduler, and be done with. But what if N > M? Or N ≫ M even? The N ≫ M scenario occurs extremely often in my line of work, so often in fact that a hope to find tools to facilitate dealing with it would not be unreasonable1. One very general and straightforward way to get around the scheduler-imposed limits is to split the N independent commands into L separate one-time "batching" scripts, and submit the latter to the scheduler, as L separate jobs2. Granted, creating such one-time batching scripts is a dull, somewhat annoying chore, but someone who is handy with their shell, or with a scripting language like Python, Perl, etc., can easily take care of it, and even home-roll their own hacks to automate it. My question is, however, are there publicly (and freely) available tools in the Unix ecosystem that can be used even by those with less programming skill to automate the chore of generating L such batching scripts, given as input a list of N independent commands? 1Actually, the scenario occurs so often that I am surprised that schedulers do not already have built-in support for it. At least the schedulers that I am most familiar with (Slurm and LSF) do not have any such support, as far as I can tell. Please correct me if I missed something. 2 More generally, one could to batch the N commands into k batching scripts, as long as k ≤ M, but, in my experience, choosing k = L is the most straightforward way to achieve a maximal, or near-maximal, throughput under these constraints. The reasons for this are not too difficult to see, but an adequate discussion of the matter would require more time than I want to take up here. |
Having two separate grub configs Posted: 15 Aug 2021 07:28 AM PDT so i have two disks: one ssd which is my main system, and a backup one on a usb stick. i want my stick to be bootable: i've changed the fstab and i installed grub. but the grub config on the usb always points to the ssd, which prevents it from booting without the ssd. i edited the /etc/grub.d/40_custom to point to the linux image on the usb and the usb now boots alone (i hope), but i find that workaround ugly. how should i configure grub to make both installs independent? |
How to insert code before matched multi-line of code with sed? Posted: 15 Aug 2021 07:13 AM PDT I want to add this code into phpMyAdmin's config.inc.php file before the line Expect result: Here is sample of config.inc.php file ( https://github.com/DaoCloud/phpmyadmin/blob/master/src/config.inc.php ) My current but it is not working, it's just prepend to all open comment block. If I use this code then it is not working at all. |
Capture picture after unlocking screen / logging in i3 Posted: 15 Aug 2021 07:05 AM PDT Running Manjaro with i3wm, and my The script Similar to this post I want to have a picture taken via a script every time the screen is unlocked. I've written a script that captures a picture from the local webcam, and this works perfectly fine - how do I alter the above setup to have the script run after unlocking my screen? I hope this can be done at the level of the |
Bluetooth not working, cannot turn on Posted: 15 Aug 2021 08:23 AM PDT I have a bluetooth adapter that worked fine on win 10. But I cannot enable it on fresh installed PopOS. It's just always off. Model https://ks-is.com/adaptery-i-perehodniki/usb-bluetooth-5-0-adapter-ks-is-ks-457 systemctl status bluetooth shows active status lsusb results Bus 003 Device 005: ID 0bda:8771 Realtek Semiconductor Corp. Bluetooth Radio What's written in official docs about linux KS-is KS-457 Bluetooth 5.0 USB Adapter Requirements to install and use this model under Linux It is identified by lsusb as 0bda: 8771 Realtek Semiconductor Corp. Linux support a. The adapter is supported by bt_trl (CONFIG_BT_RTL, starting with Linux 5.8. Firmware is required for the driver. Firmware is available in the linux-formware package starting April 2020. b. You will need to upgrade your kernel to version 5.8+ if you have an older kernel and want to use this adapter. c. The recommended version is Linux 5.8.1 AUR package: https://aur.archlinux.org/packages/rtl8761b-fw/ |
Is there anyway to see my REAL DNS server Posted: 15 Aug 2021 09:54 AM PDT Is there anyway to see my REAL DNS server? and I'm not referring to 127.0.0.53 or the router (192.168.0.1), but the real external server in bash? I'm talking about the ISP DNS, or VPN DNS servers... |
Port forwarding does not work using different gateway Posted: 15 Aug 2021 06:24 AM PDT Let me try to explain my home network setup: If the desktop uses After doing a little bit of research this can be done with IP tables/policy based routing, but I know nothing about that. What's the simplest way to do it? Edit: I'm using Pop-OS which is Ubuntu-based. |
automatically connect to vpn on system startup using systemd Posted: 15 Aug 2021 09:35 AM PDT I want to auto start vpn on system startup and reconnect ever time the network gets reconnected (after getting disconnected for any reason). The command to connect is The command to disconnect is the When i run
I am also not sure the |
How does VA to PA translation in a 4-level page table just take 4 memory accesses Posted: 15 Aug 2021 08:34 AM PDT I am learning page table management, and I learned that But, as Linux uses the So, my question here is that, for example, when So, how does |
How can you determine which EFI System Partition was used to boot a Linux System? Posted: 15 Aug 2021 07:19 AM PDT If you have a system with multiple disks and multiple EFI System Partitions how can you determine which one was used to boot the Linux system once the system is booted if they both end up booting the same kernel and root partition? |
Environment variable expansion inside $(command substitution) Posted: 15 Aug 2021 09:55 AM PDT I'm running Bash 5.1.4 on Debian. I'm writing a post-installation script to copy configuration and other files to locations in my home directory. I add the intended destination to each file at the beginning with a prefix; for example: To get these locations I'm using this command: Enclosing the variable name in braces doesn't work either. Thanks! |
Debian kernel - why do I need the firmware file if the driver is compiled in the kernel? Posted: 15 Aug 2021 06:21 AM PDT I am using this usb wifi device on Debian running on my DE10-Nano board. Looking at the product details, it seems like this uses the RT5370 chipset which is included in the RT2800USB driver. I have enabled this in the kernel as shown in the screenshot below: However, the wifi device doesn't work unless I install the firmware also with the following command: My question is - what does the firmware have to do with the driver? Shouldn't the wifi device already have the necessary firmware? What exactly is going on here? I'm new to kernel drivers and devices so trying to understand the magic going on here. My understanding is that to use a device, I just need to make sure the relevant driver is either compiled into the kernel or available as a module that you can load in later. Here is the dmesg output when I run |
Edge case - detecting input on STDIN in perl Posted: 15 Aug 2021 08:18 AM PDT I don't know quite how to ask this question and I'm not even sure this is the place to ask it. It seems rather complex and I don't have a full understanding of what is going on. Frankly, that's why I'm posting - to get some help wrapping my head around this. My end goal is to learn, not to solve my overall problem. I want to understand when I can expect to encounter the situation I'm about to describe and why it happens. I have a perl module which I've been developing. One of the things it does is it detects whether there is input on standard in (whether that's via a pipe or via a redirect (i.e. To catch redirects, I employ a few different checks for various cases. One of them is looking for
The file with the This file does not show up in the lsof output under other conditions. And if I do I read about this file here and if I cat it, it has: It appears this is a macOS-perl-specific file meant to append to the I'd like to know more about when that file is present/opened and when it's closed. Can I close it? It seems like the file content has already been read in by the interpreter maybe - so why is it hanging around in my script as an open file handle? Why is it on STDIN? What happens in this case when I actually redirect a file in myself? Is the child process somehow inheriting it from the parent under some circumstance I'm unaware of? UPDATE: I figured out a third (possibly final) requirement needed to make that AppendToPath file handle be open on STDIN during script execution of the child script. It turns out I had a line of code at the top of the parent script (probably added to try and solve a similar problem when I knew even less than I know now about detecting input on STDIN) that was closing STDIN. I commented out that close and everything started working without any need to exclude that weird file (i.e. that file: It had a comment above it that read: So I was probably learning about standard input detection at the time I wrote that years ago. My module probably ended up using However, I would still like to understand why that file is on STDIN in a child process when the parent closes STDIN... |
If using while read loops for text processing in bash is bad...what should I do, then? Posted: 15 Aug 2021 09:42 AM PDT I guess this may be a naive question but I can't get my head around so I felt like asking... I was searching for some solution to a problem, when I found this very interesting post about why is using I searched extensively: I googled (or duckduckgo-ed) and this: that are indicated as very bad examples of shell scripting. At this point I am wondering, and this is the actual question: if the posted while loops should be avoided because they are bad practice and whatever...what am I supposed to do, instead? EDIT: I see that I am already having comments/questions addressing the exact issue with the |
Can you make a bash script's option arguments be optional? Posted: 15 Aug 2021 09:11 AM PDT I would like either of these inputs to work. That is, the I can only make the former input type work or the latter, but not both. I'm not entirely sure yet if I would need a boolean for my script, but so far, just in case, I am logging one ( The end goal I had in mind was to set the JPG quality when eventually saving an image. Though, I can imagine this construct being useful elsewhere as well. I'm using |
key signing: can't see new signatures Posted: 15 Aug 2021 08:22 AM PDT I'm getting a few friends to sign my key. Each time they've signed my key, if they send the signed key to a key server, when I try to get the signatures with |
How to start a systemd service based on ExecStartPre execution result Posted: 15 Aug 2021 07:02 AM PDT I have a daemon which is started using systemd service file during boot-up flow. I want to start the daemon based on the execution result of a script. The script is included in service file under ExecStartPre option.
I would like to know whether my scenario is valid. If yes how to achieve this? Thanks in Advance. |
(Buildroot) "silentoldconfig" error on compile Posted: 15 Aug 2021 09:07 AM PDT I just moved an old buildroot folder from an old VM to a newer one to consolidate. I thought that simply moving the folder, along with any dependent folders, and making the appropriate path/name changes would be all that is required to get it up and running in the new VM. Unfortunately, this appears to not be the case as I am greeted with the following error upon attempting to build in this new VM: Are there any ideas as to what I can do to resolve this? I did some poking around on google but could not find anything conclusive. EDIT: Original VM was running Lubuntu 12.04, the new VM is running Ubuntu 17.10. Thanks. |
Posted: 15 Aug 2021 07:53 AM PDT I have a printer (Samsung M2022W) which doesn't support duplex printing. However, I would like to manually print on both sides (that is to say, print even pages, then insert these pages again on the printer and launch the odd pages). The problem is that I don't have a "manual duplex" option on my Debian system. And there is not even a "odd/even pages only" option. How can I simply print manually on both sides on *unix? |
Posted: 15 Aug 2021 07:26 AM PDT I'm trying to debug a code using GDB in a Fedora machine. It produces this message each time I run it. My questions:
|
Can't seem to connect to my Debian Mysqli Server? Posted: 15 Aug 2021 08:02 AM PDT So I have a simple PHP script which I attempted to do something along the lines: to try something out. But it won't make a connection to the database. The script is working fine as I tried it on a homeserver and so on, but it won't work on the vps, so I know it's that the mysql server is screwed up. I'm using Debian 7. I used and a bunch of php-* (* = different modules or whatever) I tried: and then wrote in the password, and it worked. So what could be wrong? |
Posted: 15 Aug 2021 09:26 AM PDT Is there an easy command that I can use to zero out the last 1MB of a hard drive? For the start of the drive I would I have a hardware RAID appliance, that stores some of the RAID configuration at the end of the drive. I need the RAID appliance to see the drives as un-configured, so I want to remove the RAID configuration without having to spend the time to do a full wipe of the drives. I have a dozen 2TB drives, and a full erase of all of those drives would take a long time. |
Posted: 15 Aug 2021 07:25 AM PDT As a comment in I'm confused as to why "| true" in a makefile has the same effect as "|| true" user cjm wrote:
Do we have some way of finding out what the size of the pipe buffer is? |
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