Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

From the command line, I want to do cat on a txt file on a different partition, how can I do that?

I mount the drive manually and from the command line, I type: (this case, abc.txt in f drive)

cat ~/media/f/abc.txt

But it says no such file or directory exists.

Please help, thanks!

share|improve this question

migrated from stackoverflow.com Nov 26 '11 at 8:34

This question came from our site for professional and enthusiast programmers.

    
Remove the ~ and try again ;) –  Polynomial Nov 2 '11 at 7:13
1  
How exactly do you mount your drive? Could you please post your mounting command? What is an output of 'mount -l' command after you've done your mount operation? –  Mark Bramnik Nov 2 '11 at 7:14
1  
~ points to your local user directory, is it really the case? –  Mark Bramnik Nov 2 '11 at 7:15
    
I did not mount the drive in command line, I did in the graphical UI, sorry –  JJ Liu Nov 2 '11 at 7:54

1 Answer 1

up vote 5 down vote accepted

When you're writing cat ~/media/f/abc.txt, you are referringn to a directory called media inside your home folder. Are you sure you mounted it there, and not in /media ? Try this:

cat /media/f/abc.txt
share|improve this answer
    
thanks for your help, it works. –  JJ Liu Nov 2 '11 at 7:55

Your Answer

 
discard

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