onceupon 
							
						 
					 
					
						
						
							
						
						5e32496e5d 
					 
					
						
						
							
							Merge branch 'master' of  https://github.com/onceupon/Bash-Oneliner  
						
						 
						
						
						
						
					 
					
						2021-03-16 22:10:53 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								onceupon 
							
						 
					 
					
						
						
							
						
						f1e9f30e78 
					 
					
						
						
							
							+ find 1. Recursively count all the files in a directory  
						
						 
						
						... 
						
						
						
						+ Condition and loop
1.  Using test command, to test if the length of variable is nonzero
+ Others
1. Create a screen and name it 'test'
+ Time
1. Get the seconds since epoch (Jan 1 1970) for a given date (e.g Mar 16 
2021)
2. Convert the number of seconds since epoch back to date
+ fix some markdown syntax issue 
						
						
					 
					
						2021-03-16 22:10:49 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								onceupon 
							
						 
					 
					
						
						
							
						
						248ae4c50e 
					 
					
						
						
							
							Merge branch 'master' of  https://github.com/onceupon/Bash-Oneliner  
						
						 
						
						
						
						
					 
					
						2021-03-16 22:08:23 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								onceupon 
							
						 
					 
					
						
						
							
						
						5740e44d62 
					 
					
						
						
							
							+ find 1. Recursively count all the files in a directory  
						
						 
						
						... 
						
						
						
						+ Condition and loop
1.  Using test command, to test if the length of variable is nonzero
+ Others
1. Create a screen and name it 'test'
+ Time
1. Get the seconds since epoch (Jan 1 1970) for a given date (e.g Mar 16 
2021)
2. Convert the number of seconds since epoch back to date
+ fix some markdown syntax issue 
						
						
					 
					
						2021-03-16 22:08:02 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								onceupon 
							
						 
					 
					
						
						
							
						
						19d402cc84 
					 
					
						
						
							
							+ find  
						
						 
						
						... 
						
						
						
						1. Recursively count all the files in a directory
+ Condition and loop
1.  Using test command, to test if the length of variable is nonzero
+ Others
1. Create a screen and name it 'test'
+ Time
1. Get the seconds since epoch (Jan 1 1970) for a given date (e.g Mar 16 
2021)
2. Convert the number of seconds since epoch back to date
+ fix some markdown syntax issue 
						
						
					 
					
						2021-03-16 22:03:57 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								onceupon 
							
						 
					 
					
						
						
							
						
						244a568bd7 
					 
					
						
						
							
							fix typo mentioned in issue  https://github.com/onceupon/Bash-Oneliner/issues/18  
						
						 
						
						
						
						
					 
					
						2021-03-16 20:13:56 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								onceupon 
							
						 
					 
					
						
						
							
						
						093edef55a 
					 
					
						
						
							
							+ time  
						
						 
						
						... 
						
						
						
						returns the current time with nanoseconds. 
						
						
					 
					
						2021-03-16 19:43:41 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Bonnie I-Man Ng 
							
						 
					 
					
						
						
							
						
						8b505a4dc5 
					 
					
						
						
							
							Merge pull request  #16  from fazlearefin/master  
						
						 
						
						... 
						
						
						
						Use curl for http status code and reveal a shortened url 
						
						
					 
					
						2020-09-08 13:28:35 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Fazle Arefin 
							
						 
					 
					
						
						
							
						
						1e10f6f269 
					 
					
						
						
							
							Use curl to unshorten a shortened URL  
						
						 
						
						
						
						
					 
					
						2020-08-29 21:22:59 +10:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Fazle Arefin 
							
						 
					 
					
						
						
							
						
						4b2167dca3 
					 
					
						
						
							
							Use curl to find out the http status code of a URL  
						
						 
						
						
						
						
					 
					
						2020-08-29 21:21:09 +10:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						b396c45634 
					 
					
						
						
							
							fix markdown  
						
						 
						
						
						
						
					 
					
						2020-07-19 23:42:01 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						f7850ce5c4 
					 
					
						
						
							
							fix styling  
						
						 
						
						
						
						
					 
					
						2020-07-19 23:39:57 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						5e8aa86062 
					 
					
						
						
							
							fix styling  
						
						 
						
						
						
						
					 
					
						2020-07-19 23:39:00 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						8cdf69d5c5 
					 
					
						
						
							
							fix header  
						
						 
						
						
						
						
					 
					
						2020-07-19 23:36:11 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						e1a3a2a25d 
					 
					
						
						
							
							update  
						
						 
						
						... 
						
						
						
						- Get UUID of a disk (e.g. sdb) 
						
						
					 
					
						2020-07-19 23:28:25 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						708ed78958 
					 
					
						
						
							
							Networking  
						
						 
						
						... 
						
						
						
						- To block port 80 (HTTP server) using iptables. 
						
						
					 
					
						2020-07-19 23:18:25 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						c434421b77 
					 
					
						
						
							
							System  
						
						 
						
						... 
						
						
						
						-  Check status of a process using PID 
						
						
					 
					
						2020-07-19 23:13:06 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						d6a31731d7 
					 
					
						
						
							
							System  
						
						 
						
						... 
						
						
						
						- Set the default user and key for a host when using SSH 
						
						
					 
					
						2020-07-19 23:06:03 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						27da2e897b 
					 
					
						
						
							
							update  
						
						 
						
						... 
						
						
						
						- Edit PS1 variable for bash 
						
						
					 
					
						2020-07-19 22:58:30 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						ad6e6112f1 
					 
					
						
						
							
							Find  
						
						 
						
						... 
						
						
						
						- Find large files in the system (e.g. >4G) 
						
						
					 
					
						2020-07-19 22:55:29 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						ddd2d3aa1f 
					 
					
						
						
							
							Others  
						
						 
						
						... 
						
						
						
						- List one file per line. 
						
						
					 
					
						2020-07-19 22:52:32 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						f6be60886d 
					 
					
						
						
							
							Condition and loop  
						
						 
						
						... 
						
						
						
						- Make directories listed in a file 
						
						
					 
					
						2020-07-19 22:45:24 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						cbe90cb99f 
					 
					
						
						
							
							System  
						
						 
						
						... 
						
						
						
						- Check for package update 
						
						
					 
					
						2020-07-19 22:40:49 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						7aba786152 
					 
					
						
						
							
							Networking  
						
						 
						
						... 
						
						
						
						- Scan for open ports and OS and version detection 
						
						
					 
					
						2020-07-19 22:38:34 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						7e9a091b3f 
					 
					
						
						
							
							Networking  
						
						 
						
						... 
						
						
						
						- Nc as a chat tool! 
						
						
					 
					
						2020-07-19 22:32:08 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						39fbcae0b7 
					 
					
						
						
							
							Others  
						
						 
						
						... 
						
						
						
						- Zip the content of a directory without including the directory itself 
						
						
					 
					
						2020-07-19 22:28:38 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						fe139c35d1 
					 
					
						
						
							
							System  
						
						 
						
						... 
						
						
						
						- Run yum update excluding a package 
						
						
					 
					
						2020-07-19 22:18:48 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						e17743e9b9 
					 
					
						
						
							
							edit  
						
						 
						
						... 
						
						
						
						- Which ports are listening for TCP connections from the network 
						
						
					 
					
						2020-07-19 22:16:45 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						3d6f8bcda1 
					 
					
						
						
							
							Time  
						
						 
						
						... 
						
						
						
						- Print date with formatting 
						
						
					 
					
						2020-07-19 22:14:19 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						8e6a0f8eb9 
					 
					
						
						
							
							Networking  
						
						 
						
						... 
						
						
						
						- Perform network throughput tests 
						
						
					 
					
						2020-07-19 22:12:40 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						8ed1acc61b 
					 
					
						
						
							
							System  
						
						 
						
						... 
						
						
						
						- Work with yum history 
						
						
					 
					
						2020-07-19 21:40:03 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						3571593f1b 
					 
					
						
						
							
							update  
						
						 
						
						... 
						
						
						
						- Get DNS TXT record a of domain 
						
						
					 
					
						2020-07-19 21:28:12 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						ea0d9bbd5b 
					 
					
						
						
							
							Networking  
						
						 
						
						... 
						
						
						
						- Get DNS TXT record a of domain 
						
						
					 
					
						2020-07-19 21:25:51 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						46bda81c1a 
					 
					
						
						
							
							Networking  
						
						 
						
						... 
						
						
						
						- resolve a domain to IP address 
						
						
					 
					
						2020-07-19 21:22:40 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						d7a768c446 
					 
					
						
						
							
							rearrange orders  
						
						 
						
						
						
						
					 
					
						2020-07-19 21:15:06 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						6c083c518e 
					 
					
						
						
							
							Data wrangling  
						
						 
						
						... 
						
						
						
						- Delete all non-printing characters 
						
						
					 
					
						2020-07-19 21:13:37 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						0df09b76c3 
					 
					
						
						
							
							Networking  
						
						 
						
						... 
						
						
						
						- Look up website information (e.g. name server), searches for an object
in a RFC 3912 database. 
						
						
					 
					
						2020-07-19 20:47:49 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						640fb02686 
					 
					
						
						
							
							edit  
						
						 
						
						... 
						
						
						
						- List only directory 
						
						
					 
					
						2020-07-19 20:43:22 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						5f04d6349c 
					 
					
						
						
							
							Time  
						
						 
						
						... 
						
						
						
						- Print date in %Y-%m-%d 
						
						
					 
					
						2020-07-19 20:36:59 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						de26eeae47 
					 
					
						
						
							
							update intro  
						
						 
						
						
						
						
					 
					
						2020-07-19 00:08:43 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						65e0abdff5 
					 
					
						
						
							
							lint  
						
						 
						
						
						
						
					 
					
						2020-07-19 00:02:03 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						4b6247a712 
					 
					
						
						
							
							Xargs  
						
						 
						
						... 
						
						
						
						- Prompt commands before running commands 
						
						
					 
					
						2020-07-18 23:48:32 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						328bd53614 
					 
					
						
						
							
							Networking  
						
						 
						
						... 
						
						
						
						- Check connection to host 
						
						
					 
					
						2020-07-18 23:42:09 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						8b0d9aa44a 
					 
					
						
						
							
							Networking  
						
						 
						
						... 
						
						
						
						- Print the route packets trace to network host 
						
						
					 
					
						2020-07-18 23:38:19 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						5b12320bc9 
					 
					
						
						
							
							Networking  
						
						 
						
						... 
						
						
						
						- Send a ping with a limited TTL to 10 
						
						
					 
					
						2020-07-18 23:17:25 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						61d2422c53 
					 
					
						
						
							
							Networking  
						
						 
						
						... 
						
						
						
						- Check if a host is up and scan for open ports, also skip host
discovery. 
						
						
					 
					
						2020-07-18 23:02:20 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						0aef9e7537 
					 
					
						
						
							
							System  
						
						 
						
						... 
						
						
						
						-  Reading from journal file 
						
						
					 
					
						2020-07-18 22:53:12 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						fdae9e9013 
					 
					
						
						
							
							System section  
						
						 
						
						... 
						
						
						
						- Performance monitoring tool - sar 
						
						
					 
					
						2020-07-18 22:50:56 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								bonnie 
							
						 
					 
					
						
						
							
						
						7857f80844 
					 
					
						
						
							
							update "Find empty (0 byte) files"  
						
						 
						
						
						
						
					 
					
						2020-07-18 22:37:25 +08:00  
					
					
						 
						
						
							
							
							
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Bonnie I-Man Ng 
							
						 
					 
					
						
						
							
						
						ba73fb49d2 
					 
					
						
						
							
							Merge pull request  #15  from fazlearefin/master  
						
						 
						
						... 
						
						
						
						Use find to find and delete empty files 
						
						
					 
					
						2020-07-18 22:35:31 +08:00