replace a word with string in a file using shell
I have a file in which I have to convert the string “lock allpages” into STRING ” LOCATION ‘hdfs://LOCATION/DIRECTORY/TBL;’ ” . I tried sed but it’s throwing some error. can …
Start Learning to Code
I have a file in which I have to convert the string “lock allpages” into STRING ” LOCATION ‘hdfs://LOCATION/DIRECTORY/TBL;’ ” . I tried sed but it’s throwing some error. can …
I have a sybase ddl file having ddl’s of many tables.. but the issue is along wth ddl there are many other things and unnecessary index creation script and comments. Is there any way to extract only …
I’m getting mv: cannot move, Permission denied error, but before claiming this is a dupe, please see what I’ve tried first: First of all, it has nothing to do with file or directory mode: $ mv -f ….
I want to find out which are the top 5 commands that I ran in the shell. I want to see which commands I use most often. It would be great if I can also see how often I ran these top commands. Is there …
I am trying to locate files by name, ones that start with at least three digits for example. find . -type f -name [0-3]* will find files starting with numbers up to 3, but not with a string of three …
In bash GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu) or any stable one, You can use # or : to comment What’s the difference between these 2 and usefulness? I noticed # comment makes …
I read that syscall(39) returns the current process id (pid) Then why these 2 programs output 2 different numbers? int main() { long r = syscall(39); printf(“returned %ldn”, r); …
Calling something like ag (a grep alternative) results in an output that’s human readable. Results are printed with headers. Useful for humans, horrible for programs. $ ag ‘filter(‘ tests/…
I am creating a symbolic link in mounted volume of a host machine inside a docker. But I am unable to access it in host machine. Is it possible to do it. If yes how can I do that. I used the following …
I have the following bash script: #!/bin/bash set command “sqlplus -s user/password@tns” ssh -t test@192.168.94.139 $command Now, I want to run te following sql script (which is on the …