Using SSH I’ve granted access to my SFTP clients user “ec2-user” with the following command: sudo chown -R ec2-user /var/www/html However I also need to grant access to Apache which I can do with the following command: sudo chown -R apache:apache /var/www/html I assumed this would grant acce…
Tag: linux
Why does posh fail to perform pathname expansion when a part of the path is specified within double-quotes?
Consider the following simple shell script: I get the expected output with bash, ksh, zsh and dash, but I don’t get it with posh: I am trying to understand if the behaviour of posh is correct as per the POSIX standard or if it is a bug. The relevant section in the POSIX documents seem to be “2.6 W…
device in lspci can’t find in dmidecode
lspci 02:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT 610] (rev a1) the pci bus is 02 the deivce id is 00 and why can’t find this info in dmidecode thisi is dmidecode dmidecode 2.12-dmifs SMBIOS 2.7 present. 104 structures occupying 5095 bytes. Table at 0x000EB110. Answer The SMB…
Why does shell command “{ command1; command2: } &” open a subshell?
As we all know, placing a list of commands between curly braces causes the list to be executed in the current shell context. No subshell is created. But when using “&” after “{}”, why two subshells are created? pid 1002 and 1003. when using “./a.out &”, only a subsh…
Puppet-Apt fails to install package because of verification
Environment: Running CentOs 7.2 Server in a virtual machine, which has a local proxy set up with CNTLM. I have installed vagrant version 1.8.1. In addition i installed the vagrant-proxyconf plugin. Goal: Set up a virtual machine on the CentOs 7.2 Server with vagrant. Yes: A virtual machine in a virtual machin…
Extracting lines by pattern matching from multiple files and writing them to another file in linux
I have 20 files. I want to extract lines by matching pattern ‘<script src=”{%.*%}>’ from those 20 files and write those lines to new file. I also want to delete those lines from the original files. Is there a better way to do it other than what I have tried which is terrible? This is m…
How does Anacron works in linux?
How does the Anacron runs even after the system shutdowns in linux? How does it look for the commands to run after the system shutdown? Answer If you have a backup script scheduled everyday at 11 PM as a regular cron job, and if your laptop is not up at 11 PM, your backup job will not be executed. However,
Connect local git repos on windows and raspberry pi
I have a windows machine and a raspberry pi, each with a git repo. I was able to set it up so I can pull from the pi to windows with the following command: This should be stable since the pi is set to a static local IP. I’d like help with an equivalent command to run on the pi
Find network interface by IP address – Linux/Bash
I’m wondering how I can query by IP address using sed, and it will show which interface name that is using it. For example.. I would expect it to come back with ETH0 Answer You should use this comand : Hope this help !
Incorrect format of sending mail from Linux shell
My file format is as below: But if I mail it to my mailbox, the format will be as below: How can I keep my original format when I send file content to my mailbox!? Answer The SMTP specification says that end-of-line in SMTP messages is where in Unix/Linux the end of line is Run the text though a tr