Skip to content

Latest commit

 

History

History
155 lines (81 loc) · 3.19 KB

nc_statistics.md

File metadata and controls

155 lines (81 loc) · 3.19 KB
layout title tags
manual
nc - Statistics of command combinations using double pipe
statistic

Before

The commands before nc: If the given command failed, execute nc.

Command percentage

After

The commands after nc: If nc failed, execute the given command.

Command Percentage
echo 11%
w 11%
cd 11%
sed 7%
pwd 7%
service 3%
vi 3%
ssh 3%
ss 3%
sleep 3%
name 3%
ln 3%
exit 3%
rm 3%
export 3%
grep 3%
alias 3%
tail 3%
history 3%

Related Scenarios

Below are the scenarios for all command combinations above.

The description in the table is referenced from and can be used to search the one-line-command or the scripts in the website of CommandLineFu.

If nc failed, execute echo

  • Get internal and external IP addresses
  • Check a server is up. If it isn't mail me.
  • Add an "alert" alias for long running commands

If nc failed, execute w

  • Check a server is up. If it isn't mail me.
  • bash/ksh function: given a file, cd to the directory it lives
  • bash/ksh function: given a file, cd to the directory it lives

If nc failed, execute cd

  • bash/ksh function: given a file, cd to the directory it lives
  • bash/ksh function: given a file, cd to the directory it lives
  • Quickly create an alias for changing into the current directory

If nc failed, execute sed

  • Print every Nth line
  • Add an "alert" alias for long running commands

If nc failed, execute pwd

  • bash/ksh function: given a file, cd to the directory it lives
  • bash/ksh function: given a file, cd to the directory it lives

If nc failed, execute service

  • Check a server is up. If it isn't mail me.

If nc failed, execute vi

  • Check a server is up. If it isn't mail me.

If nc failed, execute ssh

  • Keep SSH tunnel open (PostgreSQL example)

If nc failed, execute ss

  • Keep SSH tunnel open (PostgreSQL example)

If nc failed, execute sleep

  • Keep SSH tunnel open (PostgreSQL example)

If nc failed, execute name

  • postgresql : drop all sequences from the public schema

If nc failed, execute ln

  • postgresql : drop all sequences from the public schema

If nc failed, execute exit

  • WSL: Change the current directory converting a Windows path to a Linux Path

If nc failed, execute rm

  • Google's Text-To-Speech in command line

If nc failed, execute export

  • Turn shell tracing and verbosity (set -xv) on/off with 1 command!

If nc failed, execute grep

  • Quickly create an alias for changing into the current directory

If nc failed, execute alias

  • Quickly create an alias for changing into the current directory

If nc failed, execute tail

  • Add an "alert" alias for long running commands

If nc failed, execute history

  • Add an "alert" alias for long running commands