Computer >> 컴퓨터 >  >> 체계 >> Windows

Linux에서 파일을 영구적으로 삭제하는 방법

Linux 운영 체제에서 삭제된 파일은 휴지통으로 이동합니다. 휴지통을 비우면 파일이 시스템에서 삭제됩니다. 그러나 복구 소프트웨어에 대한 수요가 증가함에 따라 휴지통에서 삭제된 파일도 어느 정도 복구가 가능합니다. 즉, 휴지통에서 제거된 파일은 영구적으로 삭제되지 않고 눈에 보이지 않게 되었습니다. 파일은 여전히 ​​불필요한 공간을 차지하는 하드 드라이브 어딘가에 있으며 새 파일이 생성되어 하드 드라이브의 동일한 섹터에 저장될 때만 완전히 제거됩니다. 귀중한 디스크 공간을 복구하고 파일 손상을 방지하려면 Linux에서 파일을 영구적으로 삭제하는 것이 중요합니다.

여기에 Linux 운영 체제에서 파일을 영구적으로 삭제하는 몇 가지 단계가 있습니다.

Linux 운영 체제의 변형과 Ubuntu, Mint, Fedora 등과 같은 여러 사용 가능한 배포판으로 인해 Linux에서 파일을 삭제하는 단계는 단계가 다를 수 있지만 파일 및 폴더 삭제의 기본 개념은 동일하게 유지됩니다. 하드 디스크를 포맷하지 않고 Linux에서 디렉토리를 영구적으로 삭제할 수 있는 가장 일반적인 단계는 다음과 같습니다.

방법 1. 휴지통 옵션 제거

선택하면 사용자가 파일을 휴지통으로 보내지 않고 Linux에서 직접 삭제할 수 있는 옵션이 있습니다. 이 옵션을 활성화하는 것은 Linux 유형에 따라 다르지만 이 기능 뒤에 사용되는 프로세스는 아래에 언급된 두 가지 중 하나일 수 있습니다.

  • 휴지통 한도를 줄입니다.

Linux 배포판이 Dolphin 파일 관리자를 지원하는 경우 기본 설정에 액세스하고 크기라고 표시된 상자 옆에 확인 표시를 하고 백분율 제한을 가장 낮은 값으로 설정합니다. 이렇게 하면 설정된 크기보다 큰 모든 파일이 휴지통에 저장되지 않고 영구적으로 삭제됩니다.

Linux에서 파일을 영구적으로 삭제하는 방법

  • Linux에서 Nautilus 또는 Nemo 파일 관리자를 사용하는 경우 Delete 키를 누를 때 휴지통 무시를 활성화하는 옵션이 파일 관리자 기본 설정에 표시됩니다. 삭제된 파일은 휴지통으로 이동되지 않습니다.

Linux에서 파일을 영구적으로 삭제하는 방법

방법 2. 언제든지 파일을 파쇄할 수 있습니다

GNU 프로젝트에서 개발한 Shred는 Linux 운영 체제에 내장된 프로그램으로 Linux에서 파일을 영구적으로 삭제하는 데 사용할 수 있습니다. Test using Shred라는 이름으로 문서 파일을 삭제하는 명령줄은 다음과 같습니다.

shred -uvz -n 2 Test.doc

"u" 매개변수는 파일을 덮어쓰기 전에 제거합니다.

"v" 매개변수는 자세한 정보를 표시합니다.

"z" 매개변수는 삭제된 데이터의 복구 가능성을 방지합니다.

"-n 2" 매개변수는 추가 보안을 위해 추가 패스를 지정합니다.

In case, there are multiple files in a folder by the name of Music and you want to delete all of them, then use this command:

shred -uvz -n 2 Music/*.*

The name of the folder is specified as Music and the Asterix with a period and followed by another Asterix specifies to delete a file in Linux irrespective of their name or extension.

Method 3. Use Wipe.

The Linux Software distribution centre will allow you to install Wipe on your Linux Distro. It is like Shred program and is easy to use. The command line for deleting a file through Wipe is:

wipe Music/song1.mp3

Wipe is more secure than Shred and this means it is time-consuming as well. It also requests a confirmation from the user. To quicken the process, use appropriate flags such as:

f:using this flag will remove the confirmation.

c:wipe the file despite permissions.

q:quicken the process by bypassing all the security passes.

r:delete from a folder in Linux.

The simple Wipe command with all the flags would now appear as:

wipe -rfcq Music/song1.mp3

Method 4. Use Secure Delete.

Another tool that ensures removal of data from a hard drive is SRM, which is bundled in the Secure Delete suite. It is a quite efficient and quick tool and can even delete a directory in Linux. The command to delete a file is:

SRM is one of the tools in the Secure Delete suite of tools that specializes in secure removal of data from your HDD. It’s held by many as the best tool for this job.

Srm Music/song1.mp3

Like Wipe, deleting a file by SRM is a time-consuming process and can be made aster using flags. Some important flags are:

z:your file will be deleted and overwritten by zeros replacing the file for extra security.

v:this flag will provide verbose information about the process.

r:this will enable the recursive mode for subfolders.

1:the number one. This will reduce the time taken to complete the process.

The new command would then be:

srm -rlvz Music/Song1.jpg

Method 5. Install Bleachbit (GUI)

Linux에서 파일을 영구적으로 삭제하는 방법

One of the best tools to find and delete unwanted files and even delete folders in Linux operating system is Bleachbit. It is known to free up space by securely erasing data that has not been used for a long time and can be used manually to target a few files that need to be deleted. It can be installed through the software centre by using the following command:

sudo apt install bleachbit

Once installed, run the interface and click on EDIT and choose Preferences. In the General Tab, there would be a list of different options. Place a checkmark in the box beside the option labelled as “Overwrite contents of files to prevent recovery”.

Next, to permanently delete a file on Linux, click File and choose Shred option. A prompt box will appear confirming your action. Click on Delete, and that will the last of the files selected.

The Final Word On Delete A File In Linux.

Although using a Linux operating system is a different experience, it is not difficult. All you must know the functions and features that are embedded in Linux. Being an Open-source, Linux has many options to do the same task, and these are some of the easy ones to delete a file in Linux permanently. Do subscribe to Systweak Blogs and our YouTube Channel for more tech-related updates.