Skip to content

Cannot edit files using nano?

Hey, I'm pretty new to Arch, and this may be a super easy fix and I could just be stupid for not seeing it earlier.

I am trying to get access to /etc/netctl/examples in order to help me automatically connect to wifi.

The problem is, whenever I try to access it using nano (sudo nano /etc/netctl/examples) it comes up as a blank document, which I am 99% sure is not supposed to be the case.

Any help will be greatly appreciated.

Edit: I got everything working. Im not sure what the rules are for leaving posts up, but Im going to leave it up in case there are any resources here that others can use.

Edited 11 Apr 2015. We only hold this version.

0 points16 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
0 · 100% up
Kind
Text
ID
329cyl

17 comments

It's blank because the document doesn't exist. I'm not sure how netctl works, but it sounds like it isn't installed and that's why there's no file there. cd to /etc/netctl/ and then type ls and see if it says there are any files there.

5 points

There are files in the /etc/netctl path. examples, hooks, and interfaces.

Also, I have no clue what you mean by "cd to". (I seriously apologize for the newness).

1 points

So examples does exist. Are you sure it's not a directory? If it is a file, and you type

nano /etc/netctl/examples

and it's blank, then I don't know how to help you, sorry. Google is your friend!

BTW, cd is the command for change directory, it's how you navigate via terminal. Don't worry, I'm actually pretty new to this too!

3 points

cd = change directory

"cd" is the command needed to change directory in the terminal.

if I'm starting in the /home directory and my user us ldl2 and I'd like to go into that directory I'd type

cd ldl2

I could also type

cd /home/ldl2

the difference here is the full path name v one which assumes which folder I've started in.

1 points

Use ls function in netctl directory to confirm that the /examples file exists.

ls /etc/netctl    

Edit: Just checked my system and /etc/netctl/examples is a directory not a file. Try:

ls /etc/netctl/examples    

and you'll see what I mean.

4 points

Ah, ok, I see what you mean.

What I'm trying to do is set up a profile like what it says in the wiki here, which requires me to copy one of the profiles to /etc/netctl, how would I do that?

1 points

You can use cp to copy a file:

sudo cp /etc/netctl/examples/wireless-wpa /etc/netctl/

then,

sudo nano /etc/netctl/wireless-wpa
1 points

Try sudo nano /etc/netctl/examples/<tab> (<tab> means pressing the tab on your keyboard). Your shell should suggest you what files are in the directory. Then use tab multiple times to select which file you want.
Use cd and ls a lot. Seriously, you won't be comfortable with anything in the command line until you know how to navigate within your directories just like you would with any file explorer. Also look at pwd, cat, find, less, head, tail, du, wc, these tools are great complements.

3 points

I havent heard of the other ones, but I am pretty familiar with ls, and I'm using cd more extensively now. Thanks for the tip!

1 points

In a few months, you'll find out that command line is way simpler and faster for most of the use cases you'll encounter with a computer. Keep learning, we're all learning new things everyday here !

1 points

Cd into the directory containing the file you want to view/edit to check the path and spelling of the file name or do a less /path/to/file as another way to check the validity of your spelling /name of the file. Edit: for spelling

3 points

Alright, so I got everything working correctly.

Apparently, I didnt even need to go into /etc/netctl/examples, my wifi profile was in /etc/netctl. The only thing I had to do was netctl enable (profile name here)

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.