make file unreadable in linux

How to Make File Unreadable in Linux

Sometimes you may need to make a file unreadable in Linux to protect it from accidental access. You can easily do this by modifying its file permissions. These changes are permanent and persist even after your session ends. In this article, we will learn how to make file unreadable in Linux.


How to Make File Unreadable in Linux

Let us say you want to make a file data.txt unreadable in Linux. Here is a simple command to do it.

$ chmod 600 data.txt

In the above command, we assign permission 600 to our target file to make it readable & writable only by owner of the file.

Similarly, you can also use the following command to remove read(r), write(w), execute(x) permission from group and others.

$ chmod go-rwx data.txt

You can use these commands to make even folders unreadable. In this article, we have learnt how to make file unreadable in Linux.

Also read:

How to Measure Elapsed Time in Python
How to Create ISO Image from CD in Linux
How to Export Pandas Dataframe to Multiple Excel Sheets
How to Export Pandas Dataframe to Excel
How to Export Pandas Dataframe to PDF

Leave a Reply

Your email address will not be published. Required fields are marked *