How to Fix Garbled Filename and Text

Posted on
There’re several ways to display your garbled filename correctly. LANG Environment Variable PuTTY Character Set Rename Badly Encoded Filename A. LANG Environment Variable Tried to list a file which name is made by a multi-byte language like this. [root@test ~]# ll total 8 -rw-r–r–  1 root root  217 Oct 17 00:39 ▒?▒▒?▒▒?▒.txt … This is […]
Shell Script

How to Cat a File Content by iNode

Posted on
Symptoms At times, we may see some garbled filenames or even worse, empty or white-spaced names like this: [root@test ~]# ls -lai total 48 402653349 -rw-r–r–   1 root root  174 Oct 17 17:31 402653313 dr-xr-x—.  3 root root 4096 Oct 17 17:36 .       128 dr-xr-xr-x. 18 root root 4096 Oct 17 17:27 […]

How to Remove No-Name or Empty-Name Files

Posted on
After you finish your shell scripting, you’d like to try your scripts to see the result in your test environment. In the debug phase, you will generate a lot of echo message to see where’s problems, and maybe you will get some unrecognized files, like this: $ ls -il total 5     709233 -rw-r–r– […]