Skip to content

Unix and Mac Tips

EOS

Unix commands

  • modify last line of a file : sed '$s/python/#python` test.txt > test1.txt
  • update the date of all file in a directory tree : find . -exec touch {}\;
  • gtar files excluding files and remove absolute path: gtar -zcvf test.tar.gz —exclude=‘*.svn*’ -C ~/rep-eng/ps/cps. NEW
  • suppress terminal colors : \ls -ltr or \ls