Thursday, March 26, 2015

Nix Stuff I Always Forget



Bash .profile additions


Count all files in the current directory
  • alias count='ls -l | wc -l'
Count all the xml files
  • alias countxml='ls -l *.xml | wc -l'
Remove all files of type "xml" from the current directory
  • alias remallxml="find . -maxdepth 1 -name '*.xml' -delete"


"cat" files and "grep" contents while listing the name of the file (in this case "huxley")
  • cat * | grep "hux" *
More friendly size listing with ls -l
Remove all files More user friendly way to see file sizes with ls -l

  • ls -l --block-size=MB
  • du -h /folder




No comments:

Post a Comment