Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I have file test.txt contains some variables assigned to some value, i need to read all defined variables for example
Tag: command-line
grep to read exact data from text file
I have file test1.txt file, i am trying to read variable which is enclosed in double quotes and starting with hyphen for eg: “-color”. i trying to use this grep command cat test1.txt | grep getParm | sed ‘s/getParm(/ /;s/&/ /;s/,/ /;s/”/ /g’ | awk ‘{print $3}’ , where i am not able to read exact data for all variables
How to displays the owner privileges of the files in the current directory in linux os?
I want to displays the owner privileges of the files in the current directory For example the output like this : I’m trying to write this command , but the output is not correct : Answer You just do this command :
using grep commands to find a duplicate id within a json file
I am looking for a way to use grep on a linux server to find duplicate json records, is it possible to have a grep to search for duplicate id’s in the example below ? so the grep would return: 01 Answer OK, discarding any whitespace from the JSON strings I can offer this if awk is acceptable – hutch
How to parse lines from a file on a FTP server without downloading it [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
How to follow latest log file with tail -f?
I have a dir that saves a fresh log file for each run, so I use the following command to follow the latest log file: So my question would be if there is any way to jump from one file to the next, if there is a newer log file available without having to stop the latest tail -f and
moving and renaming a folder in linux [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
Printing full path of directories
I am trying to get full paths of folder and print them into a into a file. I have been using this command to get paths. But they are not proper. Ex. When trying to print path of Documents/Folder/Folder2 comes as Documents/folder2 instead of proper path. I have tried going over directory using for loop and printing out solution like
How to pipe a list of files returned from find to cat and sort them
I’m trying to find all the files from a folder and then print them but sorted. I have this so far and it print’s all files but I need to sort them too but when I do I get the next error and if I switch sort and cat like this I get the same error the it print’s the
Execute mirror and mget lftp commands in bash script
Current code Objective Download all csv files and mirror my local directory folder with the remote server, so when the code is run again it won’t download a second file. Error received open: *.csv: Name or service not known Comments From what I understood of the lftp man page I should be able to get all wildcard files by using