LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to open files in MC as root without typing in their names? (https://www.linuxquestions.org/questions/linux-software-2/how-to-open-files-in-mc-as-root-without-typing-in-their-names-890222/)

Mr. Alex 07-06-2011 08:17 AM

How to open files in MC as root without typing in their names?
 
Hello people!

So let's say I entered some dir in MC as a regular user and there is a file with very long name which is not convenient to spell and I want to edit it with nano as root. In this directory I type in a command "sudo nano [name]" and autocompletion doesn't work because the TAB key is for another purpose in MC. Can I insert a name of selected file without typing it in MC?

Diantre 07-07-2011 01:36 AM

Select the file and press Alt-Enter.

rahulkya 07-07-2011 01:58 AM

I am not sure but this may help you lets suppose you have 3 long file name in the directory
1. trryskshsjdbfhsbhjbshjbgsjhbjshbgjhbsjgsgb.ext
2. trstyxbvjhbxkjvxjhbxhjbjxhbjxhjhbxvjhbjxhbjsgbsjhgbjshbgj.ext2
3. trysjhbjhsbgjhbsghjbsjbgjsbgjhbsjghbjsgjsjhbhjbsfhjbghjbsghjbgjshgbhjsbghjbjsghbghjbsjg.ext3

and you have to edit 3rd file then write command like this
Quote:

sudo nano trys*t3
and if u have to edit 1st file then just this would be enough
Quote:

sudo nano trr*
the wild character * does the rest.

Mr. Alex 07-10-2011 02:55 AM

Thanks rahulkya, first answer did the job. :)


All times are GMT -5. The time now is 03:55 PM.