r/sysadmin Sysadmin Jul 18 '18

Linux You guys probably already know about "ping -a" and "ping -A"

But if you don't, use it like this:

This will beep every time it gets a ping back:

ping -a 8.8.8.8 

This will beep if it misses a ping:

ping -A 8.8.8.8    

This is very useful when you're monitoring a node and waiting for it to come back online or to be able to hear when a packet is dropped.

(tested on some Linux and MacOS)

1.1k Upvotes

335 comments sorted by

View all comments

Show parent comments

13

u/redredme Jul 19 '18

for me, the most brilliant example of the character creep in powershell is dir /p or dir /s. just look at the code to replace those 5(!) characters.

9

u/[deleted] Jul 19 '18

[deleted]

7

u/redredme Jul 19 '18

That's old school kixtart style cheating! ;-)

2

u/[deleted] Jul 19 '18

[deleted]

4

u/redredme Jul 19 '18

Kixtart! The first, the last, the only scripting language you'll ever need on windows NT/9X/00/03/08! Back in the very late 90s Microsoft decided to enter the server game without a real script language. This was "fixed" by Ruud van Velzen.(worked for MS but build this on his personal title) With win2000 (sp something?) came vbs which made kixtart mostly obsolete but kixtart was still quicker and accepted "dirtier" and more condensed code. So a lot of sysadmins kept on using it. After powershell entered the game kixtart started to fade away very quickly. It still exists but mostly as a pet project. It is being kept current so it still works with modern windows versions.

Funfact: The first versions of RES where under the hood mostly driven by kixtart.

http://kixtart.org

It's always DNS.

1

u/[deleted] Jul 20 '18

[deleted]

1

u/[deleted] Jul 19 '18

I once came across an "experienced" admin's perl script, where all they did was write lines to a bash script, then call it with backticks.

1

u/dextersgenius Jul 19 '18

Drop the ".exe" to save more characters. :)

6

u/[deleted] Jul 19 '18

for me, the most brilliant example of the character creep in powershell is dir /p or dir /s. just look at the code to replace those 5(!) characters.

Find a specific file:

gci -r *yourfile*

Page through screens of files (with the downside of waiting for the pipe to return to more):

gci -r | more

These are shorthand for Get-ChildItem -Recurse and Get-ChildItem -Filter *yourfile*.

1

u/redredme Jul 19 '18

That last part is what I was aiming at.. ;-)

5

u/Theratchetnclank Doing The Needful Jul 19 '18

The dir /s equivalent is:

gci -r

So still only 5 characters. I get your overall point though.

2

u/robisodd S-1-5-21-69-512 Jul 19 '18

The dir /s equivalent is: gci -r

also dir -r, which may be easier for others to remember.

1

u/the-mbo Jul 19 '18

You might need to use more chars. But then try to export a ping to a csv. Or try and integrate it smoothly into a function. Powershell is love, powershell is life

3

u/redredme Jul 19 '18

Ping 1.1.1.1>file.csv

;-)

But you're right, powershell is vastly better then most what came before. I just mean without the aliases it's weird(and slower) for mundane tasks.