banner
破影岚歌

破影岚歌的博客

bilibili
twitter
github

4. File Operations in Linux

File Operations About Linux#

Create file touch
Delete file rm -f
View file cat
Extended commands for file operations

  1. Create files consecutively touch a b c
  2. Delete files consecutively rm -f a b c

Copy cp source destination
Move mv source destination
To copy directories: cp -a

Tip 1: Make good use of wildcards (*: any number of characters) like

[root@localhost ~]# ls
a.txt b.txt c.txt abc
[root@localhost ~]# mv *.txt ./abc
[root@localhost ~]# ls
abc

This command moves any files in the current directory that end with txt to the abc folder in the current directory.

Tip 2: Rename files: mv original file name including extension new file name including extension

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.