Home  >  Article  >  System Tutorial  >  Linux operating file commands

Linux operating file commands

WBOY
WBOYforward
2024-03-06 11:34:19389browse
1.ls

ls command is mainly used to display and print out the files or directories in the directory. Commonly used parameters are as follows:

-a: Output all files together with hidden files. -l: Completely display file information, including permissions and attributes. -d: Only display the directory itself, not the files in the directory.

Display user home directory information:

Linux operating file commands

Display the directory itself:

Linux operating file commands

2.cd

The cd command is mainly used to change directories

Linux operating file commands

3.pwd

The pwd command is used to display the path and directory where the user is currently located

Linux operating file commands

Because we used the cd command to enter the /home directory above, we use the pwd command to display our current directory

4.mkdir

This command is used to create a new directory, as follows

Linux operating file commands

We created a new directory named 123 in the /home directory

5.rmdir

This command is used to delete an empty directory. When there is data in the directory, this command cannot be deleted. The data in the directory must be deleted before the directory can be deleted.

Linux operating file commands

6.rm

This command is used to delete directories and files. This command is very powerful. We usually use this command to delete files

Linux operating file commands

Adding the -rf parameter to this command can delete files, but be careful when using this command, because it will be very troublesome if you accidentally delete important files

7.cp

This command is used to copy files to other directories

Linux operating file commands

Copy the /etc/passwd file to the current directory and view it

8.mv

This command is used to move files to other directories, which is equivalent to cutting

Move passwd to the shell directory under the current directory

Linux operating file commands

The above is the detailed content of Linux operating file commands. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:linuxprobe.com. If there is any infringement, please contact admin@php.cn delete