About Linux File Delete file when prompted no such file or directory

Source: Internet
Author: User

Dear fellow boss:

I have a small white Linux, a little bit of trouble to ask the Boss
Practice the TAR command today to add a current month and date to the filename when you compress the file

[Email protected] log]# tar zcvf log.tar-' date +%f '. Gz.

As a result, the inverted quotation marks are written in single
Use the LS command to view the compressed file name as

Log.tardate +%f.gz

After realizing your mistake, you want to delete this file.
Results appear

[Email protected] log]# rm./log.tar-date +%f.gz

Rm:cannot Remove ./log.tar-date‘: No such file or directory<br/>rm: cannot remove +%f.gz ': No such file or directory

You want to move to another place, you get the same hint.

Find. -name "*.gz" |xargs mv-t/tmp

Mv:cannot stat ./log.tar-date‘: No such file or directory<br/>mv: cannot stat +%f.gz ': No such file or directory

After several setbacks ..... 10,000 characters omitted here
Then I thought I could delete it with the inode number.
So first look at the inode number of this file

[Email protected] log]# Ls-lhi.
267015-rw-r--r--1 root root 373K Sep 9 16:33 log.tardate +%f.gz

And then try

[[email protected] log]# find. -inum 267015-delete

LS view, and the results of this file are really gone.

May I ask why this is happening?

                                                此致,敬礼                                                                            来自一位Linux小白的渴求

About Linux File Delete file when prompted no such file or directory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.