Linux File Management

watch 3m, 56s
views 2

21:49, 26.11.2026

Article Content
arrow

  • General Files
  • Directory files
  • Device files
  • Most common file management operations
  • Files listing
  • Creation of the files
  • Displaying the file content
  • Copying of the files
  • Moving of the file
  • File deleting

File management in Linux is connected with different operations such as access control, creation, and modification of directories and files. In a Linux system, everything is treated as a file, including system configurations and various devices.

When talking about file management, there are plenty of processes connected with the deletion, copying, creation, renaming, or moving, as well as major processes related to the access control and file ownership.

In a Linux system, files can be divided into the following categories:

  • Directory files.
  • General files.
  • Device files.

General Files

The category of general files is connected with the images, texts, and binaries. They usually represent the most commonly imagined data, such as scripts, docs, and programs.

Here are some general characteristics of general files:

  • They are considered to be the biggest part of files in the system.
  • They can consist of program data, executable binaries, or human-readable text.
  • They are usually created with the touch command.

Directory files

Directory files can be compared with containers that create a specific hierarchy in directories and files.

Here are some of the basic characteristics of the directory files:

  • With the help of mkdir command, new directories are created.
  • There are some similarities with the folders in Windows.
  • Store metadata and lists of file names.

Among the major directories, we can specify the home directory, root directory, and bin directory with important user binaries.

Device files

Device files are those that deal with input/output operations, and they are hardware devices. Some of the major characteristics of these types of files are:

  • They are usually located in dev directory.
  • They interact with actual physical devices such as terminals, printers, or any other possible options.
  • With the help of these files, OS treats hardware as regular files.

Most common file management operations

Files listing

For the listing of the directories and files, ls command is used. The output of the command usually displays the content of directories, including details of ownership, timestamps, subdirectories, and permissions.

With the usage of the ls command, it is possible to:

  • Easily identify the difference between the types of files, directories, and files.
  • List all the directories and files in the current directory.
  • For the better identification of the file type, another color is used for every type of file.
  • The navigation between the directory content becomes more intuitive and faster.  

For getting an access to the detailed listing of the files in the specific directory, the following command should be used:

$ls -l

In the output of this command, you will get the data about:

  • Group and owner of every file.
  • Permissions regarding who can execute, read, or write.
  • Date of the last modification of the file and its size.
  • Display some insights regarding the file management and security.  

Creation of the files

For the creation of the new files in Linux, the most commonly used command is touch. In the situation when a certain file doesn’t exist, this command also creates a blank file. When the file is already created, after the execution of the command file’s content stays unaffected, and the timestamps can be updated.

Here is how the command should be used:

touch filename

Displaying the file content

For displaying the file content, cat command should be used. When using it, the full content of a certain file is created. When the file is very large, then for its viewing you can use less or more for easier content displaying, page by page.

Here is how the command should be used:

cat filename

Copying of the files

For the copying of the specific file in Linux, the cp command should be utilized. It functions by copying the content of the specific file into a new file that is in the specific destination. If you don’t specify another name, then the copied file will be created with the same original name.

Here is an example of the cp command usage:

cp source/file.txt destination/ or cp source/filename destination/newname

Moving of the file

For the moving of the specific file from one location to another – mv command is used. It functions by removing a file from one directory and replacing it with another with the same original name and content. Also, with the help of this command, it is possible to rename a moved file.

Here is an example of how the command is used:

mv source/filename destination/ or mv source/filename destination/newname

File deleting

For deleting the files – rm command should be used. It functions by removing a certain file from the directory. It is recommended to use this command with caution, as the recovery of the deleted file is not as easy as its removal.

Here is an example of how the command should be used:

rm filename

Share

Was this article helpful to you?

VPS popular offers

-10%

CPU
CPU
6 Epyc Cores
RAM
RAM
8 GB
Space
Space
100 GB NVMe
Bandwidth
Bandwidth
Unlimited
Keitaro KVM 8192
OS
CentOS
Software
Software
Keitaro

€ 28.99 /mo

€
/mo

Billed annually

-10%

CPU
CPU
4 Epyc Cores
RAM
RAM
4 GB
Space
Space
50 GB NVMe
Bandwidth
Bandwidth
Unlimited
aiKVM-NVMe 4096 Linux

€ 17.86 /mo

€
/mo

Billed annually

sale

-20%

CPU
CPU
10 Epyc Cores
RAM
RAM
64 GB
Space
Space
300 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 65536 Windows

€ 139.49 /mo

€
/mo

Billed monthly

sale

-20%

CPU
CPU
6 Epyc Cores
RAM
RAM
8 GB
Space
Space
100 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 8192 Windows

€ 28.99 /mo

€
/mo

Billed monthly

-10%

CPU
CPU
8 Epyc Cores
RAM
RAM
32 GB
Space
Space
200 GB NVMe
Bandwidth
Bandwidth
Unlimited
Keitaro KVM 32768
OS
CentOS
Software
Software
Keitaro

€ 77.54 /mo

€
/mo

Billed annually

sale

-20%

CPU
CPU
10 Xeon Cores
RAM
RAM
64 GB
Space
Space
300 GB SSD
Bandwidth
Bandwidth
Unlimited
KVM-SSD 65536 Linux

€ 134.99 /mo

€
/mo

Billed monthly

sale

-20%

CPU
CPU
4 Epyc Cores
RAM
RAM
4 GB
Space
Space
50 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 4096 Linux

€ 16.45 /mo

€
/mo

Billed semiannually

sale

-20%

CPU
CPU
2 Xeon Cores
RAM
RAM
512 MB
Space
Space
10 GB SSD
Bandwidth
Bandwidth
Unlimited
KVM-SSD 512 Linux

€ 5.2 /mo

€
/mo

Billed quarterly

sale

-20%

CPU
CPU
8 Xeon Cores
RAM
RAM
32 GB
Space
Space
200 GB SSD
Bandwidth
Bandwidth
Unlimited
wKVM-SSD 32768 Windows

€ 73.99 /mo

€
/mo

Billed monthly

sale

-20%

CPU
CPU
8 Xeon Cores
RAM
RAM
32 GB
Space
Space
200 GB SSD
Bandwidth
Bandwidth
12 TB
wKVM-SSD 32768 Metered Windows

€ 156 /mo

€
/mo

Billed monthly

Other articles on this topic

cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.