Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To remove a file, we will use the rm command. Unless you happen to be a forensic computer scientist

Footnotes Display
, there is no way to get files deleted by rm back, so use the command sparingly and only when you're confident!

Code Block
languagebash
themeDJango
rm bar.txt

...

Code Block
languagebash
themeDJango
rm -r test
Info

Using rm (carefully), clean up all the files and directories created by the tutorial inside c2s2 so far, as well as copy of the test directory that you moved under your NetID directory previously

Addendum: Downloading Files from the Web

Footnote

Strictly speaking, what rm does under the hood is eliminates the pointer to the files from the directory structure (basically, lose the reference our operating system has to its contents) and frees up the memory for the operating system to store other content there. If you were able to externally access the hard drive before the operating system re-wrote that location (hint: turn off the machine immediately, hopefully before the operating system uses that memory), and discern the location in memory where the content was previously stored, one could theoretically get the contents back. There are specialists who have the tools to do this, but for 99.9% of users, it is impossible. If you're curious, to really get rid of data, you can use the shred command to overwrite the memory such that it can't be recovered even by experts - such an operation may be useful if you're disposing of sensitive data.


Code Block
languagebash
themeDJango
rm bar.txt

Like cp, if we want to delete an entire directory, we must use the r flag:

Code Block
languagebash
themeDJango
rm -r test


Info

Using rm (carefully), clean up all the files and directories created by the tutorial inside c2s2 so far, as well as copy of the test directory that you moved under your NetID directory previously

Addendum: Downloading Files from the Web


Footnotes Display