Viewing and editing system files composed of unreadable text and symbols

Solution 1:

All files that live on filesystem or memory are technically editable just gotta use the right methods. You encountered a binary data file, particularly pertaining to dconf database of settings judging by the name in the nano's filename line, and the keyword GVariant in the file itself. Accordingly, you should use dconf-editor GUI tool or dconf command-line tool.

How do I figure out what type of file it really is, if it's a running file and what I need to find out both its code and what the file imports/exports/is dependent on.

Typically you can make use of file command to figure out the particular file type.

$ file /etc/passwd
/etc/passwd: ASCII text

Whether the file is executable, you can use ls -l filename or stat to determine whether the executable bit is set for owner, group, and other users. See a related post that explains permissions on files quite well. There's also Access Control Lists, which are used to create more fancy permissions than the basic Unix permissions allow.

As to what software to use, it depends on each file, and there's many types of software for same filetype. Binary files in general often can be viewed via hexdump or od commands in hex format, and to edit - there's hex editors, which are often used in reverse engineering and security applications.


I was under the impression that basically all files in a Unix system are editable, at the very least viewable.

Well, there's a bit of truth that has to be shed on the words "Everything is a file in Unix/Linux". There's files that can live in filesystem, and that's what most people know as files. In reality, a file ( i.e. a particular chunk of data organized together somewhere) can live in memory or filesystem, i.e. there can be anonymous files. Sockets and unnamed pipes are files, they just don't have a name, only a handle which kernel keeps track of. Can all of them be edited ? Yes, again, with the right methods. Pipes have one process writing to it, while another reads, so writer can edit the pipe. Files mapped in memory can be edited if your program can access that particular memory chunk. So everything is a file, you just need to understand in which context the file is applied.