Linked Questions

41 votes
13 answers
45k views

Convert CRLF's to line feeds on Linux

What's the best way to convert CRLF's to line feeds in files on Linux? I've seen sed commands, but is there anything simpler?
JoelFan's user avatar
  • 3,872
5 votes
3 answers
1k views

Is it wasteful to call cat?

I’m sorry if this question is really stupid, but this is basically what I have been thinking about constantly. Suppose I run: : cat ./somefile.txt A few hundred times a second. How much faster is my ...
Blub's user avatar
  • 468
14 votes
4 answers
17k views

Running mysql dump in a cron job without exposing passwords

I want to run mysqldump -u aUser -p P4SSw0rd --all-databases > backup.sql in a cron job. How can I do so securely? I know I could put the command right there, but anyone with access to the ...
user avatar
15 votes
1 answer
5k views

Is backwards redirection the same as a pipe?

In Linux if you type sort < txtfile is that the same thing as cat txtfile | sort
tony_sid's user avatar
  • 14.3k
1 vote
2 answers
3k views

bash script:echo output garbled and in wrong order

I am having an issue with a bash script that is echoing output in an unexpected order. The script is as follows. The problem is with the output of lines 30-32. 1 IFS=$'\n' 2 i=1 3 bluered="" 4 ...
Brian's user avatar
  • 1,007
3 votes
1 answer
1k views

sed Error sed: -e expression #1, char 7: unterminated `s' command

I keep switching between my command prompt and my git bash shell on windows 10. Suppose I copied my current directory to the clipboard in my command prompt(cmd.exe) and want to switch to that ...
anjanbacchu's user avatar
  • 1,397
-1 votes
1 answer
1k views

How to use HTML markup tags inside Bash script

I have crontab and a simple bash script that sends me emails every often containing PHP, NGINX, MYSQL errors from their log files. This is a simplified example. #/home/user/status.sh EMAIL=me@domain....
robue-a7119895's user avatar
1 vote
1 answer
654 views

xargs run bash script with threads (2 arguments)

I have a file in the following format: "192.168.2.1" "80" "172.16.1.1" "443" "10.1.1.1" "8080" which contains multiple local IPs and i'm trying to run a script with threads using xargs to execute ...
Gerald's user avatar
  • 21
4 votes
1 answer
229 views

Using grep on URLs not working

I've got a couple of text files (a.txt and b.txt) containing a bunch of URLs, each on a separate line. Think of these files as blacklists. I want to sanitize my c.txt file, scrubbing it of any of the ...
gibson's user avatar
  • 177
0 votes
2 answers
76 views

Search file for specific string and remove it

I have following file: ./foldername/company_users_policies_changes.txt "terraform_automated_python","AdministratorAccess" ./foldername/company_groups_policies.txt "terraform_automated_python","...
Milister's user avatar
  • 101