In Linux Mint, I have a directory that has many files and I want to copy files that contain x in their filename and paste them into other destination. How can I do it using a terminal? Answer Go to the directory that contains all of your files, then try this one. this commnad can help you. replace YourDestination wtih
Tag: command-line-interface
How to preceed the output generated by “exec &” with a time/Date in linux bash scripts?
I have the following script file that writes files to s3 from a local file system: And the output is coming out in a specific grok pattern needed for me to parse this output as logs into Elastic Search, however the line 27 output is as follows: that upload and 0 of 0 0%… Line is created by the exec
Renaming Sequentially Named Files with Date Embedded
The Situation: I have hundreds of zip files with an arbitrary date/time mixed into its name (4-6-2021 12-34-09 AM.zip). I need to get all of these files in order such that (0.zip, 1.zip 2.zip etc) with in a Linux cli system. What I’ve tried: I’ve tried ls -tr | while read i; do n=$((n+1)); mv — “$i” “$(printf ‘%03d’ “$n”).zip”;
How could I write an egrep command that will find all entries that have least 5 consecutive vowels (aeiou) in them upper or lower case?
I’m looking for an answer that doesnt include -i option to get both upper and lowercase. Specifically just how to make the regular expression itself output such a string. I also do not want it to return any other strings outside of the consecutive “aeiou”. For example I want to see: aeiou AEIOU AeIou daeiou aeioud etc. I do not
remotely determine using ssh IF a machine needs to be rebooted [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago. Improve this question There are plenty of examples of HOW to reboot a linux machine via SSH. However, in my case I want to check IF a linux
How to extract testNG results in Jenkins console using Linux command
I’m trying to extract the user who is triggered the Jenkins job and testNG execution status from Jenkins console. Need to get below details from Jenkins console using Linux command. Jenkins console log: Started by user achuMohan =============================================== TransferMoneyTest Tests run: 10, Pass: 5 Failures: 3, Skips: 2 =============================================== Output: I tried the below command to get all the console
Reverse sort 3rd numeric column in file
In bash shell scripting, I have users.txt file. sort -t: -k 3n users.txt gives me This is ok. But I need 3rd column which contain only phone number in reverse order i.e. descending order. How to achieve that? I need like Answer You could add an r (short for “reverse”) to the order column specification:
CLI tool to format XML files keeping empty lines and comments
Is there any CLI tool for Linux which formats XML files keeping any empty lines and comments? I have tried xmllint, tidy and xmlstarlet, but all seem to focus completely cleaning XML files rather than just indentation and spacing. Answer Try xmlindent. It has several options like -nbe and -nba and others that configure the handling of spaces before and
Can ethtool provide the current incoming bitrate on a NIC
Is there an option in linux’s ethtool command that retrieves the current incoming bitrate or packets-per-second straight from the NIC? Answer Not per packets-per-second, but overall RX/TX. You could write a script around it: ethtool -S <interface> For example currently on my wifi nice: The same information could be extracted from: /sys/class/net//statistics/rx_packets: number of packets received /sys/class/net//statistics/tx_packets: number of packets
How to use git namespace to hide branches
Background I’m working with a large team using git for version control. The normal flow is: People selecting a ticket from the “backlog queue”. Working on the issue via a local branch (i.e. git checkout -b my_feature_branch). Making several commits as they go (i.e. git commit). Pushing local changes to a remote branch in order to “backup” their work so