The basic commands for copying, moving, and removing files and directories in RHEL 9 are similar to those in other Linux distributions. Here is a brief summary of the most common ones:
cp : Copy files or directories from one location to another. Syntax: cp [OPTION]... SOURCE... DESTINATION
Example: To copy file1.txt and file2.txt to dir1, use cp file1.txt file2.txt dir1
mv : Move or rename files or directories. Syntax: mv [OPTION]... SOURCE... DESTINATION
Example: To rename file1.txt to file2.txt, use mv file1.txt file2.txt
To move file1.txt and file2.txt to dir1, use mv file1.txt file2.txt dir1
mkdir : Create a new directory. Syntax: mkdir [OPTION]... DIRECTORY...
Example: To create a directory named dir1, use mkdir dir1
To create multiple directories at once, use mkdir dir1 dir2 dir3
rmdir : Remove an empty directory. Syntax: rmdir [OPTION]... DIRECTORY...
Example: To remove a directory named dir1, use rmdir dir1
To remove multiple directories at once, use rmdir dir1 dir2 dir3
rm : Remove files or directories. Syntax: rm [OPTION]... FILE...
Example: To remove file1.txt and file2.txt, use rm file1.txt file2.txt
Social Links:
Facebook Account# [email protected]
Gmail Account# [email protected]
Instagram# [email protected]