13
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?

Rinzwind
  • 299,756
wizgot
  • 405
  • 1
  • 3
  • 8

2 Answers2

17

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.

guntbert
  • 13,134
Jos
  • 29,224
  • 2
    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. – Jos Mar 20 '14 at 12:03
  • @Jos Could you edit that into your answer, rather than just a comment? – AncientSwordRage Mar 20 '14 at 13:46
1

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)