In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "the usage of the commonly used command tar under Linux". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Tape drive operation command:
Tar command:
Use the tar command to copy a file or directory tree to a single tape.
/ Note: special files such as empty directories or device files cannot be copied and cannot be used to create multiple tape volumes.
1. Copy files to tape
(1) change to the directory that contains the files to be copied
(2) insert a writeable tape in the tape drive
(3) enter tar cvf / dev/rmt/0 filenme filename.
/ Note: the c option copies the specified file, the v option displays the information about the copied file, and the f option is followed by the tape device name written by the tar file. The specified file name is copied to the tape, overwriting any existing files on the tape.
Special note: copying files to tape using the c option will destroy any files that are already on the tape. If you want to keep these files, use the r option.
two。 List the files on the tape
(1) insert the tape into the tape drive.
(2) enter tar tvf / dev/rmt/0
/ Note: the t option lists the specified file, the v option displays all the information about the file, and the f option is followed by the tape device name written to the tar file.
3. Add files to tape
(1) change to the directory that contains the files to be copied.
(2) insert a writeable tape in the tape drive
(3) enter tar rvf / dev/rmt/0 filename filename...
The specified file is added to the end of the existing file on the tape.
/ Note: if you use the n option as part of the tape device name, you can customize multiple tar file sets to tape. Enter tar cvf / dev/rmt/0n filenae, the tape will not rewind when the file is self-made, and the next time the tape is used, the file will be written at the end of the current file set.
4. Get the end of the file set from the tape to write
1) change to the directory that contains the files you want to copy.
2) insert the tape in the tape drive.
3) enter tar xvf / dev/rmt/0
Specifies that all files on the tape in the drive are copied to the current directory.
Get a single file from the tape and enter tar xvf / dev/rmt/n filename filename.
Expand the specified file name from the tape and put it in the current working directory.
5. Recursively read directories and subdirectories from tape
1) change the directory to the parent directory where you want to customize the file
Tar xvf / dev/rmt/0 filename will restore filename to the current directory.
2) enter tar xvf / dev/rmt/0 directory-name to copy the directory and all its subdirectories recursively from the tape.
This is the end of the content of "the usage of the common command tar under Linux". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.