Daily Shaarli

All links of one day in a single page.

March 23, 2023

bash - How to make rm not delete symbolic links? - Stack Overflow
thumbnail

rm typically does not delete the targets of symlinks, but to say that it "does not follow symlinks" is not quite accurate, at least on my system (GNU coreutils 8.25). And deleting files is a place where accuracy is pretty important! Let's take a look at how it behaves in a few situations.

If your symlink is to a file, rather than to a directory, there is no plausible way to accidentally delete the target using rm. You would have to do something very explicit like rm "$(readlink file)".

Symlinks to directories, however, get a bit dicey, as you saw when you accidentally deleted one.

These are all safe:

  • rm test2 (deletes the symlink only)
  • rm -r test2 (deletes the symlink only)
  • rm -rf test2 (deletes the symlink only)
  • rm test2/ (rm: cannot remove 'test2/': Is a directory -- no action taken)
  • rm -rf *2 (or any other glob matching the symlink -- deletes the symlink only)

These are not safe:

  • rm -r test2/ (rm: cannot remove 'test2/': Not a directory -- but deletes the contents of the test1 directory)
  • rm -rf test2/ (deletes the contents of the directory, leaves the symlink, no error)
  • rm -rf test2/* (deletes the contents of the directory, leaves the symlink, no error)

The last unsafe case is probably obvious behavior, at least to someone well-acquainted with the shell, but the two before it are quite a bit more subtle and dangerous, especially since tab-completing the name of test2 will drop the trailing slash in for you!

It's interesting to note that test has similar behavior, considering a symlink to a directory with a trailing slash to be not a symlink but a directory, while a symlink without a trailing slash is both:

Dial Liberia-Cell phone card - low rates for calling from United States to Liberia - Cell
thumbnail

Dial Liberia - Cell phone card - low rates for calling from United States to Liberia - Cell

For Five Years, The Pulitzer Prizes Have Rewarded Misinformation
thumbnail

The Pulitzer Prizes are a singularly corrupt institution, administered by Columbia University and the management of the New York Times largely for the benefit of the New York Times and a limited number of favored publications and personalities. Any citizen who thinks that the annual distribution of awards has something to do with quality probably believes that the Oscar for Best Picture goes to the most distinguished film of the year. If you’re a connoisseur of unrestrained self-praise, may I recommend the citations when the Times awards itself the Pulitzer Gold Medal for Public Service.

While the Pulitzer Prizes have always been little more than self-dealing masquerading as journalistic beauty pageant, it was a lot easier to believe in this manufactured prestige back when journalism was at least slightly more competent and concerned with the appearance of objectivity. In fact, a spin through the last five years of Pulitzer recipients reveals some interesting choices that add up to a clear pattern. //

Every one of these major stories was badly handled by the media writ large, served activist political narratives, frequently involved credulously regurgitating actual misinformation, or some combination thereof. While there is always reason to be suspicious of Pulitzers, historically most of the objections to the awards handed out never rose beyond the level of newsroom gossip. //

While plenty of criticisms could be leveled at Trump for his statements about the 2020 election, the reporting on that phone call led to a media feeding frenzy that caused the unfair dismissal of very real and legitimate problems Georgia had with its elections.

More importantly, it bears mentioning the same Post reporter, Amy Gardner, who wrote the Pulitzer-cited story above, would file a follow-up story on Jan. 9 about yet another Trump conversation with the Georgia secretary of state. This time Trump told allegedly Georgia’s Secretary of State Brad Raffensperger to “find the fraud,” which was generally understood to mean that Trump was telling Raffensperger to abuse his power and make up reasons to disenfranchise people.

Not only did the Post have to run a correction on that story three months later — you can read the pretty astounding details here — when the dust settled, Gardner and The Washington Post conceded that they had “anonymously printed fabricated quotes they knew were from a second-hand source in the office of a political enemy, couldn’t confirm the quotes with additional sourcing, still attributed them to the sitting president of the United States, used those quotes as a basis to speculate the president committed a crime, and the Democratic party would later repeatedly cite the bogus article when attempting to impeach Trump for ‘high crimes and misdemeanors.’”

So the Washington Post reported complete misinformation that was cited as criminal evidence in the impeachment trial of Trump that resulted from Jan. 6, and still won a Pulitzer for its coverage of the event. Unsurprisingly, this story was also not included in the bundle of stories the Post sent to the Pulitzer committee. //

It seems that on every big news story, you now have a choice to make: Who are you going to believe, your lying eyes or the Pulitzer committee?

Opinion | Can’t Read? Here’s a ‘Barefoot College’ for You. - The New York Times
thumbnail

Over the decades, Barefoot College has attracted international and local funding to expand. The college now has water programs around India, and the Indian government brings in women from Africa and elsewhere to study solar engineering at Barefoot College for six-month courses, and they then return home to bring electricity to their villages. Here, “empowerment” is not a buzzword but a way of life.

“The illiterates of the 21st century,” Roy said, “are not those who cannot read and write, but those who cannot learn and relearn.”