I have directories named as: 2012-12-12 2012-10-12 2012-08-08 How would I delete the directories that are older than 10 days with a bash shell script? 5 Answers 5
wc -l file.txt outputs number of lines and file name. I need just the number itself (not the file name). I can do this wc -l file.txt | awk...
This question already has answers here: Rename multiple files based on pattern in Unix (23 answers) Closed 4 years ago. Write a simple script that will automatically rename a...
I want to get the CPU and memory usage of a single process on Linux – I know the PID. Hopefully, I can get it every second and write...
I just recently switched from bash to zsh, however I miss my Alt+LeftArrowKey and Alt+RightArrowKey to go back and forth a word at a time. Right now, if I...
curl http://testhost.test.com:8080/application/app/version | jq '.version' | jq '....
Borderline ServerFault question, but I’m programming some shell scripts, so I’m trying here first 🙂 Most *nixes have a command that will let you pipe/redirect output to the local...
I need to find all image files from directory (gif, png, jpg, jpeg). find /path/to/ -name "*.jpg" > log How to modify this string to find not only .jpg...
This question already has answers here: How can I check if a program exists from a Bash script? (39 answers) Closed 3 years ago. The community reviewed whether to...
My command’s output is something like: 1540 "A B" 6 "C" 119 "D" The first column is always a number, followed by a space, then a double-quoted string. My...