I created a directory /share and gave chmod 2770 permission and chown root:stock /share. 1) When I create touch a file inside /share, I see the file has rw-rw-r– and I don’t see rwxrws— 2) When I create a directory in /share/data I see the permission as drwxrwsr-x where are the parent directory is drwxrws— How can I get parent
Tag: shell
Scripting to see if specific process is running as root [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 6 years ago. Improve this question I am currently trying to right a shell script which will
Find a line in a list of .gz files
i around 50 .gz files in a particular directory in linux. i need to find a particular line in each file. currently i am doing by zcat each file. Eg: Output: Sep 9 17:12:47 145.247.1.62 cap-s12-custfw-1: NetScreen device_id=cap-s12-custfw-1 [Root]system-information-00542: BGP peer 10.24.224.187 changed to Idle state (2016-09-09 17:13:15) please let me if there is any easier way to do this.
Shell script file with multiple commands
I want to make shell script file in windows and linux with multiple commands inside it. E.g run.sh and run.bat with the below commands run.bat or run.sh When I run my run.bat file it only executes first command mvn clean but it do not execute other commands. How to make shell-script file with multiple commands so that when I execute
possible to script to open multiple terminals in local machine and ssh to different servers?
This is what I’d like to do: On my local linux system (Ubuntu), I’d like to write a script which would open multiple terminals, and do an ssh to different servers (the list of servers would be in a text file which the script will read), and execute a program on each of those servers. Is this possible to do?
How to remove files without certain extension?
How to remove all files without the .txt and .exe extensions recursively in the current working directory? I need a one-liner. I tried: Answer Try this. The above command will remove all the files other than the .exe and .txt extension files in the current directory and sub directory recursively.
Bash – delete rows from one file while iterating through rows from another file
I have two files. file.txt and delete.txt file.txt contains the following for ex.: delete.txt contains: I need to delete the rows from file.txt that are contained within delete.txt cat file.txt should result with: So far I’ve tried this with no luck: I don’t receive any error, it just doesn’t edit my file.txt file. I’ve tested the while loop with an
Sort a find command to respect a custom order in Unix
I have a script that outputs file paths (via find), which I want to sort based on very specific custom logic: 1st sort key: I want the 2nd and, if present, the 3rd –separated field to be sorted using custom ordering based on a list of keys I supply – but excluding a numerical suffix. With the sample input below,
Linux grep command to find the value of key from json
I have a JSON output that contains a list of objects stored in a variable.(I may not be phrasing that right) Output of a curl command: will post in comment as I am unable to post here I want to grep the value at this position “ad6743fae9c54748b8644564c691ba58” shown in the output, which changes everytime i run the curl command. I
shell script mv is throwing unhelpful error “No such file or directory” even though i see it
I need to use a shell script to move all files in a directory into another directory. I manually did this without a problem and now scripting it is giving me an error on the mv command. Inside the directory I want to move files out of are 2 directories, php and php.tmp. The error I get is cd: /path/to/working/directory/php: