Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.
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?

share|improve this question
3  
it's not blank ;) it probably has a unprintable char. Please post results of ls -b :) –  Rinzwind Mar 20 at 9:38
    
ur rite its a \ - i tot if there is an unprintable char it is higlighted on marking it. –  wizgot Mar 20 at 9:42

2 Answers 2

up vote 17 down vote accepted

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.

share|improve this answer
    
Thanks that worked! –  wizgot Mar 20 at 10:51
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 at 12:03
    
@Jos Could you edit that into your answer, rather than just a comment? –  Pureferret Mar 20 at 13:46

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)

share|improve this answer
    
nope, didn't work, I used emacs * all the files except this turned up in the buffer. –  wizgot Mar 20 at 9:50
    
What happens if you use xdg-open * ? It should open all the files using their default application. –  Lorenzo Baracchi Mar 20 at 9:53
    
Its a terminal that I am sshing into. –  wizgot Mar 20 at 9:56
1  
* will cause shell expansion. If the file consists of a space character, then * will just add whitespace to the commandline. Therefore, the file will be skipped. –  gerrit Mar 20 at 14:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.