Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Cryptic unkown file?

  1. #11
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,732

    Default Re: Cryptic unkown file?

    Quote Originally Posted by d3vnull View Post
    To see hidden characters in the file name you should be able to use: ls -b

    To see the content of the file as an octal dump of characters, because of where you show it is located you can try:

    Code:
    find . -maxdepth 1 -type f ! -name '.*' -exec od -c {} \;
    You can probably also use the same find command to remove the file.
    We have already a (much shorter) way to dump the file name in hex above. Also we are not trying to find it, thus why using find?
    Henk van Velden

  2. #12

    Default Re: Cryptic unkown file?

    Quote Originally Posted by hcvv View Post
    We have already a (much shorter) way to dump the file name in hex above. Also we are not trying to find it, thus why using find?
    The find command allows him to dump the contents of the file without having to know the name of the file. All my find does is only lists files and removes all files starting with a . from the find listing since the file was located in his home directory. It then dumps the contents of the file safely without having to ever know the name of the file and how to escape it.

    I was not trying to display the name with that command, but the contents.

    ls -b displays the name.
    I don’t have anything to hide, but I don’t have anything I want to show you either.

  3. #13
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,732

    Default Re: Cryptic unkown file?

    I see, but we are not now so far that we would like to dump a file's contents of 30kB in hex over the terminal.
    Henk van Velden

  4. #14

    Default Re: Cryptic unkown file?

    I have some more information:

    Code:
    david@PC:~> ls *Ŷ*
    ?Ŷ?Ƶ????
    david@PC:~> ls *Ŷ* | od -x
    0000000 c5ba bab6 b5c6 c4b9 10d1 000a
    0000013

  5. #15

    Default Re: Cryptic unkown file?

    On 07/10/2018 05:06 AM, SF6 wrote:
    >
    > True that is, here is the information:
    >
    > ls -l:
    >
    >
    > Code:
    > --------------------
    > -rw-r--r-- 1 david users 31170 Jul 9 12:21 ?Ŷ?Ƶ????
    >
    >
    > --------------------
    >
    >
    > file * gives:
    >
    >
    > Code:
    > --------------------
    > �Ŷ�Ƶ���: data
    >
    >
    > --------------------
    >
    >


    You can also try:

    code:
    ****************
    strings *
    ****************

    and to remove the file:

    code:
    ***************
    rm -i *
    ***************

    which requires a response before performing any action.

    --
    Ken
    linux since 1984
    S.u.S.E./openSUSE since 1998


  6. #16
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,732

    Default Re: Cryptic unkown file?

    I think the most save way to remove it is
    Code:
    rm *Ŷ*
    because we are now sure that the expression fits the file name and only fits the file name.

    I was away today. I will try to interpret
    Code:
    c5ba bab6 b5c6 c4b9 10d1 000a
    tomorrow (if it is interpretable at all).
    Henk van Velden

  7. #17

    Default Re: Cryptic unkown file?

    Quote Originally Posted by SF6 View Post
    Hi,

    for some reason a file has appeared in my /home directory:
    ?Ŷ?Ƶ????

    Code:
    david@PC:~> ls
    bin  Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos  ?Ŷ?Ƶ????
    Supposedly it's 30kB but it cannot be deleted as it shows the file to be "non-existant":
    Where does it come from? What's doing there and how can I get rid of it?

    Thanks
    Your original post with the ls command provides the information needed to manage this file. It displays only the default directories and one file. However, if you did an ls -a you would see lots of hidden files and directories beginning with a . (e.g. .profile, .bash_history, etc.).

    If you run the command below from within your home directory it will only display the single file you are concerned about. If it doesn't then stop, and ignore the rest of my post.

    Code:
    find . -maxdepth 1 -type f ! -name '.*'
    This command simply lists all files (-type f) in the directory without recursing into over directorys (-maxdepth 1) and excludes listing anything beginning with a . (! -name ".*").

    We now have a way to isolate that file without caring about what the name of the file is.

    Next it would be nice to know what the contents of the file is before just deleting it.

    Let's just move the file to a name you can manipulate. We will use the same find command and add -exec to run a command against that file. The {} contains the strange file name. I will move the file to strange.txt in my example:

    Code:
    find . -maxdepth 1 -type f ! -name '.*' -exec mv {} strange.txt \;
    To look at the content of your "strange.txt" file you can use od -c which converts all non-printable characters to printable or backslash characters. You can also use the strings command to pull printable character strings from the file. You probably do not want to just cat, more, or less the file unless you are willing to reset your terminal window.

    I will leave you to read the manpages on od and strings if you have never used them. They are worth knowing, but examples are od -c strange.txt | less or strings strange.txt | less.

    Once you are sure you don't need the file feel free to delete it.

    FYI your ls -l shows the file only has one link to it. So, once you delete it the file will really be gone.
    I don’t have anything to hide, but I don’t have anything I want to show you either.

  8. #18
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,732

    Default Re: Cryptic unkown file?

    Why are you repeating things you already posted in this thread?

    Also, as you can read above, the OP is in the meantime perfectly able to handle the file with e.g.
    Code:
    ls -l *Ŷ*
    and thus he can do everything he wants with it by using many commands straight forward like the suggested above:
    Code:
    ls -lb *Ŷ*
    and the also suggested
    Code:
    strings *Ŷ*
    which may give a lot of output, but not so much as your
    Code:
    od -c *Ŷ*
    and when he wants to use another name for manipulating also
    Code:
    mv *Ŷ* unknown
    and he can even remove it as also already suggested by
    Code:
    rm *Ŷ*
    and there are many, many more commands that work on files possible.

    I really do not see why we have to use find in this case where it is perfectly clear how we can handle the file name.


    That part of the original question "...how can I get rid of it?" is really solved already many posts ago.

    Better try to help with the, maybe even more important, question "Where does it come from? What's doing there ...?"
    Henk van Velden

  9. #19
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,732

    Default Re: Cryptic unkown file?

    Quote Originally Posted by hcvv View Post
    I was away today. I will try to interpret
    Code:
    c5ba bab6 b5c6 c4b9 10d1 000a
    tomorrow (if it is interpretable at all).
    Because our systems are little endian the bytes should swapped:
    Code:
    ba c5 b6 ba c6 b5 b9 c4 d1 10 0a 00
    When interpreted as UTF-8 (as will be done by the CLI tools and also by GUI tools like Dolphin):
    • the first byte is not valid UTF-8 in combination with what follows;
    • the second and third byte are the valid combination for LATIN CAPITAL LETTER Y WITH CIRCUMFLEX;
    • the fourth byte is not valid UTF-8 in combination with what follows;
    • the fifth and sixth byte are the valid combination for LATIN CAPITAL LETTER Z WITH STROKE
    • bytes seven, eight, nine and ten are each themselves not valid UTF-8 in combination with what follows;
    • byte eleven is a LINE FEED (LF);
    • byte twelve is NULL.


    My conclusion, this was never produced to be UTF-8 and the two UTF-8 characters it contains are by pure incident.
    The tools wil show the uninterpretable bytes as REPLACEMENT CHARACTER � or as a simple ?

    I tried to see if those bytes when interpreting them as different ISO 8859 encodings, but could not find a reasonable solution.

    My conclusion: the program that created this file is creating havoc. I am afraid only you (the OP) can know what programs he uses and thus who might be doing this.

    Of course deleting it and watching if new creations happen may help in finding a cause-resolve eureka.
    Henk van Velden

  10. #20

    Default Re: Cryptic unkown file?

    Thanks for all your help.

    I've now just renamed and deleted it. Will watch out if a new one gets created.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •