Skip to content

Instantly share code, notes, and snippets.

@jfhc
Last active November 2, 2017 14:56
Show Gist options
  • Save jfhc/9c465a9bb6b634b7289280b726e8a60c to your computer and use it in GitHub Desktop.
Save jfhc/9c465a9bb6b634b7289280b726e8a60c to your computer and use it in GitHub Desktop.
# Convenience function for cd & ls in one go
function cs () {
cd "$@" && ls
}
# Like cs above but using z.sh: https://github.com/rupa/z
# Adds in a pwd so you can check z has put you where you expected it to!
. /etc/z/z.sh
function zs () {
z "$@" && pwd && ls
}
# See the permissions for the given file (which can be specified by a relative path) and all the directories in its absolute path.
# Looks like:
# $ cd ~/scrap
# $ permtree blah.py
# f: /home/jfhc/scrap/blah.py
# dr-xr-xr-x /
# drwxr-xr-x home
# drwxr-xr-x jfhc
# drwxr-xr-x scrap
# -rwxr-xr-x blah.py
function permtree() {
namei -m $(readlink -f "$@")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment