Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.28 KB

README.md

File metadata and controls

31 lines (21 loc) · 1.28 KB

Commands helping with filesystem trees

cptree

On the Unix Sources archive on The Unix Heritage Society website there are several tapes that Henry Spencer rescued. Among them is uk1.tar.gz which was created from several universities in the UK in 1980. There's a ton of my code there.

This tape has several files called cont.a - which are UNIX archive files - but they don't match V6 because they have a different magic number. I wrote a tape lister and extractor in Python 3 to read these - see rdar.

The cptree came from the Glasgow section of the tape - and seems a useful addition to V6.

The compile script compiles cptree.

rmtree

You can delete all the files in a directory tree using:

rm -r DIR

If you need to add the -f flag, then it must be added as a separate argument:

rm -r -f DIR

But there is no -r flag to rmdir. The rmtree shell script will remove a whole tree. This script does:

  • rm -r -f DIR deleting all the files under the directory.
  • generate a list of directories using find, and sort into reverse order
  • edit the file to add rmdir to the start of each line
  • execute the file to delete all the directories
  • clean up the temporary files on /tmp