drwxrwxr-x 2 ubuntu ubuntu 4096 Mar 19 07:30 xxxxx
-rw-rw-r-- 1 ubuntu ubuntu 580 Mar 20 07:24
-rw-rw-r-- 1 ubuntu ubuntu 27137 Mar 20 09:10 xxx.js
Here there is a file on the second line but its blank, any idea how to see the contents?
drwxrwxr-x 2 ubuntu ubuntu 4096 Mar 19 07:30 xxxxx
-rw-rw-r-- 1 ubuntu ubuntu 580 Mar 20 07:24
-rw-rw-r-- 1 ubuntu ubuntu 27137 Mar 20 09:10 xxx.js
Here there is a file on the second line but its blank, any idea how to see the contents?
Inodes to the rescue: first, do ls -li to list all files with their inodes. The inode is the number on the left. Note the inode number of your invisible file. Then:find . -inum xxx -exec nano {} \; replacing xxx with the inode number, and possibly nano with the editor of your choice.
Explanation:
The find command finds the file with inode number xxx, then executes a command, in this case: passes it to nano. The {} is a placeholder for the filename; the \; at the end indicates the end of the command.
You can do a
gedit *
to open all files (brute force approach) Or better
gedit " "*
if you are sure that the file begins with a space character.
(you can replace gedit with your favorite editor)