Categories
Linux Mastering Development

System booting all right despite wrong root entry in /etc/fstab

I have following disk structure: sda1 : Windows sda2 : an old Linux distribution sda3 : a new Linux distribution sda4 : data partition I have grub installed and I choose the system at boot time. I have now been using new Linux distribution only on sda3 and it is working all right. I had […]

Categories
Linux Mastering Development

How do I write a shell script to delete the lines containing a word if it appears between specific position (character)?

I want to delete lines, with specific condition using bash script.. tried : sed ‘/(string)/d’ (Filename) but it is not enough, I need to search if a string is in specific range (first n character) then it will be deleted. if statement is needed to apply sed command. Let’s pretend that we have a file […]

Categories
Linux Mastering Development

How can I search into first n characters of every single line of a file Centos7? [closed]

Thanks to you all for your helpful information I really need help.. Q1: Write a shell script to delete the lines – in a given file – containing a word “le” if it appears between the 3th and 10th position (character). To enhance your script, you should read the word and the positions as an […]

Categories
Linux Mastering Development

Syntax error in grub.cfg on update-grub

I run Ubuntu 20.04 and have this error when I do an update-grub command: root@ubuntu:/# update-grub Sourcing file `/etc/default/grub’ Sourcing file `/etc/default/grub.d/init-select.cfg’ Création du fichier de configuration GRUB… Image Linux trouvée : /boot/vmlinuz-5.8.0-25-generic Image mémoire initiale trouvée : /boot/initrd.img-5.8.0-25-generic Image Linux trouvée : /boot/vmlinuz-5.4.0-53-generic CentOS Linux 8 (Core) trouvé sur /dev/sdb9 Image Linux trouvée : /boot/vmlinuz-5.8.0-25-generic Image mémoire initiale […]

Categories
Linux Mastering Development

Fish: The file is not executable by this user

I made fish function in ~/.config/fish/functions/confgit.fish: function confgit /home/john/Projects/confgit $argv end But when I run this function it just says: fish: The file “/home/john/Projects/./confgit” is not executable by this user /home/john/Projects/./confgit $argv ^ in function ‘confgit’ The config file is normal python script. If I run it by ./confgit it runs fine. How can I […]

Categories
Linux Mastering Development

Append a string to every line in a text file using sed

I have a txt file that contains a couple thousand dates. I would like to add a string to every line using osx bash. It works just fine in subline using regex but I can’t get it to do what I want in bash – even using the same regex. I figured SED is the […]

Categories
Linux Mastering Development

how can I send destroy rather than shutdown to a specific QEMU VM/guest

I have a number of guest machines (VMs) running on the same host. I have a set of them that respond normally to the shutdown command issued by the host when it resets, but I have some specific guest VMs that do not. This causes them to delay a reboot/shutdown of the host machine (which […]

Categories
Linux Mastering Development

xrandr scaling 2x1920x1200 + 3860×2400

I’m pretty new to linux and I’m trying to setup my 2xFHD (DP1-1 and DP1-2) + 1xUHD (eDP1) (all 16:10) rig. (Two FHD in the top row and 4k screen in the bottom row) I’ve tried following command: xrandr –output DP1-1 –pos 0x0 –mode 1920×1200 –scale 2×2 –output eDP1 –primary –mode 3840×2400 –pos 0x600 –scale […]

Categories
Linux Mastering Development

Unable to Boot After Low Memory Warning and Upgrade

I recently upgraded to Linux Mint 20 and I started getting warnings about low memory on a partition or something. After a reboot my computer didn’t start and it gave me this error: https://i.imgur.com/BrgU5TV.jpg. What is the issue I’m having and how can I fix this? Looking at my disk partitions with GParted I have: […]

Categories
Linux Mastering Development

System has not been booted with systemd as init system (PID 1). Can’t operate. Failed to connect to bus: Host is down

I’m using Kali Linux the command I typed was sudo systemctl restart systemd-resolved.gz and all i get is System has not been booted with systemd as init system (PID 1). Can’t operate. Failed to connect to bus: Host is down I’m a noob but I am familiar with Kali Linux tho little bit