Skip to content

Instantly share code, notes, and snippets.

@MrwanBaghdad
Last active September 6, 2019 15:37
Show Gist options
  • Select an option

  • Save MrwanBaghdad/ade562b1f2928d17cb3f3ef8436b677c to your computer and use it in GitHub Desktop.

Select an option

Save MrwanBaghdad/ade562b1f2928d17cb3f3ef8436b677c to your computer and use it in GitHub Desktop.

How to open all your python ETL jobs using vim, each is in its own tab ordered by their line number counter

  1. Get the modules and their line counts
find /path/to/dir/ --iname "your_jobs_filename_pattern.py" -exec wc -l {} \
  1. Sort them sort -rh

  2. Remove the line number from the stdout. The line numbers count is at start of each line output

sed -e "s/[0-9]+//g"

  1. Use vim -p to open multiple tabs

Finally, the whole command would be

vim -p `find /path/to/dir --iname "your_jobs_filename_pattern.py" -exec wc -l {} ;\ | sort -rh | sed -e "s/[0-9]+//g" `
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment