Skip to content

Instantly share code, notes, and snippets.

@n8kowald
Last active October 11, 2015 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n8kowald/3818074 to your computer and use it in GitHub Desktop.
Save n8kowald/3818074 to your computer and use it in GitHub Desktop.
Useful Unix commands
--- Show numerical permissions ---
ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \ *2^(8-i));if(k)printf("%0o ",k);print}'
OR THIS
find . -printf "%m:%f\n"
********* .bashrc *********
# Remove CVS directories
alias purgecvs='find . -name CVS -prune -exec rm -rf {} \;'
-- To find out what version of Linux (distro) you are running, enter the following command at the shell prompt: --
cat /etc/*-release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment