You are not logged in.

#1 2022-03-25 23:22:14

jlsk1yz
Member
Registered: 2022-02-23
Posts: 6

.bashrc and .xprofile contents suddenly replaced with a bunch of dots

[SOLVED]

Hey guys.

While I was doing some stuff in the terminal (Yakuake), I decided to open up a new tab. The entire page was full of dots. Literally dots across the entire terminal vertically and horizontally.
So, just on a whim, I decided to check my .bashrc and .xprofile and lo and behold, both files were completely full of hundreds of dots, instead of the file contents. The horizontal length of the dots was very close to the original files' contents. I wasn't working on anything related to those two files before this happened.

Does anyone know what's going on here? Is this malware? I'm really scared right now because this just doesn't make any sense!

Last edited by jlsk1yz (2022-03-26 01:12:29)

Offline

#2 2022-03-25 23:40:42

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: .bashrc and .xprofile contents suddenly replaced with a bunch of dots

Is your .bash_history similarly corrupted? If not, it should contain a record of how it happened.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2022-03-25 23:46:18

jlsk1yz
Member
Registered: 2022-02-23
Posts: 6

Re: .bashrc and .xprofile contents suddenly replaced with a bunch of dots

Hmm. Yes, bash history is also full of dots. I've disabled bash history with unset HISTFILE by the way. It seems like everything in my home directory has the dots problem. bash_logout, .nvidia-settings-rc, .directory, they're all full of dots. For some reason, .gtkrc-2.0 is partially fine. It seems that the files were all modified at the exact same time. journalctl shows nothing happening at that time. I also tried grepping the filenames in journalctl but nothing came up.

.gtkrc-2.0:

gtk-enable-animations=1
gtk-primary-button-warps-slider=0
gtk-toolbar-style=3
gtk-menu-images=1
gtk-button-images=1
gtk-cursor-theme-size=24
gtk-cursor-theme-name="breeze_cursors"
gtk-icon-theme-name="breeze"
gtk-font-name="Noto Sans,  10"
..............................................
..............................................
..................................................................
......................................
..................................
......................................
................................................
............................................................................
........................................................
............................................................

Last edited by jlsk1yz (2022-03-25 23:58:57)

Offline

#4 2022-03-26 00:15:40

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,484
Website

Re: .bashrc and .xprofile contents suddenly replaced with a bunch of dots

Confirm the contents by switching to a tty and using 'cat' or 'head' on one of those files.  Do the files actually contain dots, or is your terminal emulator just displaying dots in place of visible characters?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2022-03-26 00:21:17

jlsk1yz
Member
Registered: 2022-02-23
Posts: 6

Re: .bashrc and .xprofile contents suddenly replaced with a bunch of dots

I opened the files in a text editor and also used cat/head. They are definitely full of dots.

Offline

#6 2022-03-26 00:50:46

mpan
Member
Registered: 2012-08-01
Posts: 1,615
Website

Re: .bashrc and .xprofile contents suddenly replaced with a bunch of dots

Just to eliminate the possibility:

hexdump -C -n 32 ~/.bashrc

Also, what do you see if you invoke that command and after that you try reading the files?

sudo sysctl vm.drop_caches=3

The command forces file caches to be dropped from RAM, so the files must be physically re-read from the storage medium. This should rule out or confirm corruption of data in RAM.

Do not invoke sync. Not that you were asked to do that, but just giving a warning in case you came across the command while searching what file cache is.

Last edited by mpan (2022-03-26 01:00:45)

Offline

#7 2022-03-26 01:11:57

jlsk1yz
Member
Registered: 2022-02-23
Posts: 6

Re: .bashrc and .xprofile contents suddenly replaced with a bunch of dots

Oh... I've figured it out. I was playing around with a new command called sd, which is an alternative to sed. I remember distinctly doing something with .* and I think I might have done the command

 sd .* .

...which would have replaced everything with dots in my home directory. Phew. At least now I know it wasn't malware.

Offline

#8 2022-03-26 01:25:15

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: .bashrc and .xprofile contents suddenly replaced with a bunch of dots

jlsk1yz wrote:

At least now I know it wasn't malware.

Well, PEBKAC is a kind of malware...


Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2022-03-26 01:34:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,484
Website

Re: .bashrc and .xprofile contents suddenly replaced with a bunch of dots

Ha!

I'm sure we'll be hearing from you when you start tinkering with an alternative to dd.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB