User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

STICKY: New to Raspbian and Linux? Start here...

Mon Aug 20, 2012 7:30 pm

One of the things I often see in the forums are Raspberry Pi users new to Linux asking very basic questions that go unanswered. Or, even more often, the answers provided are beyond the knowledge of the person asking the original question to be useful. I know from experience it can be very time consuming for a more experienced user to answer a basic question that is documented in great detail dozens of other places on the Web. It's just human nature to not bother answering a question if you feel you are going to have to spend a lot of time going into excruciating detail. Someone else will do it, right? I believe this can lead to a lot of unnecessary frustration for everyone involved.

For instance, an answer to a new users question might be something such as "Become root and change the permission of file /usr/xxx/yyy to group write and append the line 'aaa bbb ccc' to the file". This answer might be very easy for some of us to understand and use, but such an answer could be a complete mystery to a new user of Linux. How does one become root? I can't run the root command. What are permissions? How do I change them? What is a group? How to I append a line to a file? Is that the same as editing a file? And, on and on...

Therefore, I would like to have this thread be dedicated to suggestions from more experienced users on how new users of Raspbian might best self-educate themselves with some of the basics of Linux. Hopefully this will lead to higher quality questions (often a new user doesn't really even know how to describe what they are asking) and more answers that can be brief and concise.

To kick things off, I'll start with the following:

If you need to know anything, know this...

If there is one thing to know about Raspbian, it is to know that Raspbian is essentially identical to Debian Wheezy. Debian Wheezy will be the next stable release of Debian GNU/Linux and is very similar to the current stable release known as Debian Squeeze. Debian is used by millions of users around the globe on a daily basis and there is a vast store of knowledge and documentation about using Debian across the web. Any answer you find that applies to Debian Squeeze or Debian Wheezy will almost certainly apply to Raspbian. The two most basic places to start are the following links:

Debian Documentation: http://www.debian.org/doc
Debian Support: http://www.debian.org/support

My #1 suggestion...

For anyone new to using Raspbian on the Pi, I would highly recommend the getting and reading "The Debian Administrator's Handbook". An electronic copy of the book can be downloaded for free (they do ask for a small gift though), or a printed copy purchased at a very reasonable price at the following link:

http://debian-handbook.info/

Despite the intimidating title, the book is a pretty easy read and it will quickly grow a new users knowledge of using Raspbian, and Linux in general, on the Raspberry Pi. The book certainly won't teach a new user everything about using Raspbian on the Raspberry Pi, but a new user will be MUCH better prepared to ask questions in a way that will yield clear, concise answers from other experienced users. It provides the necessary framework to understand and learn about other aspects of Raspbian/Debian not covered in the book.

I realize that asking new users to read a book may seem like a burden, but it's no less a burden than expecting others to take 5, 15, 30 minutes or more of time to carefully craft an answer to a basic question that a new user can understand and use.

Other suggestions?

With all that being said, please add additional suggestions on how new users might help themselves quickly learn more about using Raspbian, and Linux in general, on the Raspberry Pi. To keep this thread a concise list of resources for new users, I'll delete messages that stray too far from the topic.

smonkey
Posts: 37
Joined: Wed Aug 15, 2012 8:44 pm

Re: New to Raspbian and Linux? Start here...

Mon Aug 20, 2012 8:52 pm

Here are a few simple ones:

Become root:
sudo -i

Edit a file:
nano /path/to/filename
(then edit as normal, and ctrl+x to exit)

Append to a file (if you dont want to edit it):
echo "this is a new line" >> /path/to/file

See what's running:
ps ax
or
top

Moving around the filesystem:
cd /path/to/directory (change directory)
ls -l (list files in directory)

See the last few lines of a file:
tail /path/to/file
(you can use tail -n 5 to see the last 5 lines etc..)

Watch changes to a file (usually a logfile):
tail -f /var/log/syslog

Output a file to screen:
cat /path/to/file

Reboot:
shutdown -r now

Shutdown:
shutdown -h now

Start/stop a service:
sudo /etc/init.d/servicename restart

Can't think of any more every day commands off the top of my head :)

cutterjohn
Posts: 62
Joined: Tue Jul 24, 2012 9:55 pm

Re: New to Raspbian and Linux? Start here...

Mon Aug 20, 2012 9:48 pm

You forgot one of the very most important commands: man.

e.g. man ls
man man
etc.

(hint manual ...)

User avatar
Dominic
Posts: 7
Joined: Thu Aug 30, 2012 8:14 pm
Location: UK

Re: New to Raspbian and Linux? Start here...

Fri Aug 31, 2012 10:31 am

Thanks for the tips all.

As a newbie Linux user, I've not really had to use any command-line based whatsits, and so this should help me get up to speed.
"That's acceptable. Heck, it's more than acceptable; it's adequately satisfactory."

brs
Posts: 70
Joined: Fri Aug 17, 2012 9:27 pm
Location: Zurich

Re: New to Raspbian and Linux? Start here...

Fri Aug 31, 2012 10:53 am

For those who want to go really deep and understand how things work inside, this is still one of the best books about the foundations of Unix (and by extension Linux): "The Design of the Unix Operating System" by Maurice J. Bach (http://books.google.ch/books?id=BxZpQgAACAAJ)

Tanga
Posts: 30
Joined: Tue Jan 03, 2012 11:18 pm

Re: New to Raspbian and Linux? Start here...

Thu Oct 18, 2012 3:29 am

A helpful command for other noobs would be:

Code: Select all

sudo raspi-config
Which gets you back into the menu that you get on initial startup.

I don't have internet access on the pi at the moment, not having access to a router, but when I do I'll post how I got it up and running. For those that wish to connect over ethernet this how-to looks good:
http://www.raspberrypi.org/phpBB3/viewt ... 26&t=11758

It seems to recognise my tethered mobile phone, now to get it running.
Raspberry Pi (Raspbian) Tutorials by a fellow noob:
http://noobsquared.blogspot.com.au/

GrayHatter
Posts: 18
Joined: Tue Sep 25, 2012 6:29 pm

Re: New to Raspbian and Linux? Start here...

Thu Oct 18, 2012 5:24 am

Does raspi have a irc channel? New users can get faster one on one help better via irc then on a forum; at least for simple things that don't need a new thread.

http://chat.thinstack.net/?channels=%23raspi

maybe?

User avatar
Wizard
Posts: 120
Joined: Sun Aug 19, 2012 4:52 am
Location: Sweden

Re: New to Raspbian and Linux? Start here...

Thu Oct 18, 2012 5:34 am

Network stuff:
ifconfig (displays current config)
sudo ifdown eth0/eth1/wlan0/wlan1 (bring down network interface)
sudo ifup eth0/eth1/wlan0/wlan1 (bring up network interface)
This must be done every time you make a change eg.
iw (allsorts of wireless config)

File/log parsing
head -10 filename (prints the first 10 lines in a file)
tail -20 filename (prints the last 20 lines in a file)
less filename (better more, lists the contents of a file - paginated)

If you want to continuously parse a log but only search for keywords:
tail -f logfile | grep string (this prints all lines that contains string)
tail -f logfile | grep -v string (this prints all lines that doesn't contain string)

Searching:
find -name "*.txt" (show all files with .txt extension)
find /home/foo -name "*.gz" (search in specific path)
find -newer bar.txt (find all files newer than bar.txt)
etc etc...

If you want to run a script (buildscript perhaps) from another script/shell and make sure that you save any error messages that you otherwise would miss...
./the_script.sh 2&>1 (1 is stdout and 2 is stderr. Great for debugging subshells called from shell)

If you want to dig deeper, look into sed and awk. They are the bread & butter of shell scripting!

p.s For editing you only need vi - possibly the best editor EVER! (not vim by the way...)
Raspberry Pi - finally a worthy replacement for A500!!!

GrayHatter
Posts: 18
Joined: Tue Sep 25, 2012 6:29 pm

Re: New to Raspbian and Linux? Start here...

Thu Oct 18, 2012 5:43 am

Wizard wrote: p.s For editing you only need vi - possibly the best editor EVER! (not vim by the way...)
vim > vi ;)

most of these are only going to work on debian e.g. those networking commands wont work on Arch

User avatar
Dominic
Posts: 7
Joined: Thu Aug 30, 2012 8:14 pm
Location: UK

Re: New to Raspbian and Linux? Start here...

Thu Oct 18, 2012 10:14 am

GrayHatter wrote:Does raspi have a irc channel? New users can get faster one on one help better via irc then on a forum; at least for simple things that don't need a new thread.

http://chat.thinstack.net/?channels=%23raspi

maybe?
Yeah it has an IRC channel on Freenode:

irc://irc.freenode.net/RaspberryPi
"That's acceptable. Heck, it's more than acceptable; it's adequately satisfactory."

User avatar
Wizard
Posts: 120
Joined: Sun Aug 19, 2012 4:52 am
Location: Sweden

Re: New to Raspbian and Linux? Start here...

Thu Oct 18, 2012 11:06 am

Using vim does come with its hazards...

vim will parse the file with regards to codecs etc which can be BAD!

One example happened on one of our servers at work that just didn't want to play ball and it was more or less impossible to understand.

After replacing this server I discovered that some friendly colleague (read; idiot) had edited a configuration file with "notepad" - thus creating the infamous 3 char dos header in the file.
Someone at the time thought it was a good idea to "upgrade" vi to vim - which ignores the header and pretends its just a plain text file.

People have forgotten about dos2unix and this was the result.

I prefer the "old" vi and this is a great example.
GrayHatter wrote:
Wizard wrote: p.s For editing you only need vi - possibly the best editor EVER! (not vim by the way...)
vim > vi ;)

most of these are only going to work on debian e.g. those networking commands wont work on Arch
Raspberry Pi - finally a worthy replacement for A500!!!

plugwash
Forum Moderator
Forum Moderator
Posts: 3225
Joined: Wed Dec 28, 2011 11:45 pm

Re: New to Raspbian and Linux? Start here...

Thu Oct 18, 2012 12:29 pm

Personally I wouldn't go reccomending vi (or vim) to newbies. There are a lot of design descisions taken in that editor that made sense at the time but nowadays do little more than make it a PITA to learn.

Tanga
Posts: 30
Joined: Tue Jan 03, 2012 11:18 pm

Re: New to Raspbian and Linux? Start here...

Sun Oct 21, 2012 9:23 am

I use leafpad. Yeah, I know, no credibility, but I don't see the reason to struggle with clunky non-gui and obscure text editors. Besides, I never mastered terminal editors back in the day, and now I don't see the point in learning a bunch of, otherwise useless, shortcuts. These editors are ugly and difficult to use. I just right click on the file that needs editing and have it execute the command sudo leafpad ... I can't believe their is a vi vs vim thing happening in a, supposedly noob friendly, thread.

TBH this 'new to raspbian' thread is less than helpful. Saying RTFM is all very well, but not really a good intro - it certainly put me off delving into the thread. I have created a blog that tries to do one thing per post:
http://noobsquared.blogspot.com/
which will hopefully be more noob friendly.
Raspberry Pi (Raspbian) Tutorials by a fellow noob:
http://noobsquared.blogspot.com.au/

halley
Posts: 1
Joined: Mon Dec 17, 2012 7:26 pm

Re: New to Raspbian and Linux? Start here...

Mon Dec 17, 2012 8:49 pm

I use "echo >>" to add to my text files. This is much easier than vi, vim, nano, or any other, and doesn't use the gui, only an xterm.

User avatar
Mequa
Posts: 172
Joined: Sun Sep 09, 2012 9:54 pm
Location: England
Contact: Website

Re: New to Raspbian and Linux? Start here...

Wed Dec 19, 2012 9:31 am

Leafpad is very lightweight and so ideal for beginners to use on the Pi as a text editor, unlike Gedit which runs much slower (but has more advanced features).

There are already some tough decisions for which apps beginners should use on the Pi. LibreOffice Writer or Abiword? LibreOffice Calc or Gnumeric? Personally I've installed them all, but beginners used to Microsoft Office are likely to get confused with having more than one alternative to choose from. Then there's the wealth of paint programs available - GIMP works surprisingly well on the Pi, but there are more lightweight and faster alternatives for beginners just wanting to do simple painting.

Raspbian is the OS choice for beginners though, along with the likes of Raspbmc for pure media centre use.

randyks
Posts: 6
Joined: Thu Jan 03, 2013 7:17 pm
Location: Andover, Kansas

Re: New to Raspbian and Linux? Start here...

Thu Jan 10, 2013 4:59 pm

Code: Select all

sudo apt-get install joe
This will get you the jstar editor. It is a super easy text editor. I had a tough time picking up vi when I first started using linux (Slackware 3.0) and jstar saved me a ton of headaches.

Code: Select all

jstar <filename>
This will bring up the file. Command hints are built into the editor. Not sexy as vi/vim but really new user friendly.

dkossman
Posts: 26
Joined: Tue Dec 25, 2012 12:35 am
Location: Los Angeles, California

Re: New to Raspbian and Linux? Start here...

Fri Jan 11, 2013 8:12 am

Sorry if this is a dumb question, but how do we keep Raspian up-to-date? is it safe to just run "apt-get update/upgrade/dist-upgrade" periodically? or will this pull in non-Pi compatible package updates?

thanks
Don

lenrem
Posts: 2
Joined: Mon Feb 18, 2013 12:51 am

Re: New to Raspbian and Linux? Start here...

Mon Feb 18, 2013 10:54 am

is it safe to just run "apt-get update/upgrade/dist-upgrade" periodically? or will this pull in non-Pi compatible package updates?
If you have only raspbian related lines in your /etc/apt/sources.list file (likely), you won't be pulling in non-pi stuff.
You may want to learn about aptitude: this gives you a complete overview of what is available, what is installed, what is new etc. With it, you can manage your packages (almost) completely, but you can also use it next to the occasional apt-get. Recommended.

andrewst
Posts: 2
Joined: Sat Mar 02, 2013 3:49 am

Re: New to Raspbian and Linux? Start here...

Sun Mar 03, 2013 1:09 am

I use leafpad. Yeah, I know, no credibility, but I don't see the reason to struggle with clunky non-gui and obscure text editors. Besides, I never mastered terminal editors back in the day, and now I don't see the point in learning a bunch of, otherwise useless, shortcuts. These editors are ugly and difficult to use. I just right click on the file that needs editing and have it execute the command sudo leafpad ... I can't believe their is a vi vs vim thing happening in a, supposedly noob friendly, thread.

TBH this 'new to raspbian' thread is less than helpful. Saying RTFM is all very well, but not really a good intro - it certainly put me off delving into the thread. I have created a blog that tries to do one thing per post:
http://noobsquared.blogspot.com/
which will hopefully be more noob friendly.
Credibility aside and no disrespect, leafpad is pretty great. I don't disagree with you in saying vi(m) is certainly not a beginner's starting point, but it's not fair blatantly turning people away from them simply because "you don't see the point" in using them nowadays. In all fairness, you are comparing apples and oranges, and telling people apples are stupid because you've only eaten oranges. Modern graphical editors and terminal based editors are two different breeds each with advantages and disadvantages, but your post stereotypes the latter as archaic and obsolete.

To those who are ambitious enough to eventually train in using it, vi(m) (and others) can provide unmatched speed and precision in editing; those "otherwise useless shortcuts" can let you crank out code faster than anyone using a mouse ever will... if you give it the respect it deserves, and put instant gratification aside. No, it's not where you should begin, but it is where all the masters end up. And as a beginner's thread, we should be inspiring and seeding interest in topics, not criticizing and deterring based on ignorance.
Besides, I never mastered terminal editors back in the day, and now I don't see the point
What's stopping you? There are free tutorials everywhere, from absolute beginner to extremely advanced. If you are aspiring to be a true Computer Scientist, this area of "dark art" came from founding fathers that held editor development to the same standards as the code they produced with them, and they should be respected for what they are. You can learn everything from the past, but not enough people feel like "it's worth it." :roll:

Don't get me wrong, two years ago I would have said the same thing to someone if they suggested I play with Vim, but then I did a tutorial simply as a way to easily configuration files over SSH. You soon get hooked on the magic and exploring faster ways to do things, and feel gratification in writing code in a traditional way that most people toss out as "a PITA." Great artists are not born overnight. You slowly pick up tricks as you go along, and build a skill set over your entire life. Those editors are from a different age, a more patient, disciplined, and forward thinking one. Frankly I think all the software we produce today would benefit from everyone going back and studying the discipline and values that engineers held themselves to back then.

So for anyone who has never heard of vi, vim, emacs, etc and wants to find their full potential, please do not be intimidated or deterred. I suggest starting with the solutions other people have posted here, but sometime dedicating only an hour to exploring a beginner's tutorial someday, and keep an open mind. I truly believe that open mindset will help you more than anything on your way to use RPies to their fullest potential. ;)

andrewst
Posts: 2
Joined: Sat Mar 02, 2013 3:49 am

Re: New to Raspbian and Linux? Start here...

Sun Mar 03, 2013 1:13 am

One of the most trivial and simple shortcuts for people new to working in terminals is try using the TAB key to auto-complete commands and directory names! :o

I didn't know this for the longest time when I was beginning, and it made it a nightmare to try to get long commands and paths right!

naugaranch
Posts: 1
Joined: Sat Jan 12, 2013 2:29 am

Re: New to Raspbian and Linux? Start here...

Tue Mar 05, 2013 8:30 pm

Where do I find the root password for my RPi? Installed Wheezy and want to update and add packages. Keep getting aurthorization failure...

Tom

nigsy
Posts: 2
Joined: Wed Mar 06, 2013 2:40 pm

Re: New to Raspbian and Linux? Start here...

Wed Mar 06, 2013 2:59 pm

naugaranch wrote:Where do I find the root password for my RPi? Installed Wheezy and want to update and add packages. Keep getting aurthorization failure...

Tom
In terminal type sudo passwd

- It will prompt for new root password

I don't think there is a root password at startup? So you have to create.
Sudo will give you root anyway.

jamaldwise
Posts: 1
Joined: Tue Apr 09, 2013 9:23 pm

Opening Raspbian OS

Tue Apr 09, 2013 9:29 pm

When you change the settings in 'raspi-config' so it doesn't boot to desktop, how do you launch Raspbian through the command interface?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: New to Raspbian and Linux? Start here...

Wed Apr 10, 2013 3:17 am

startx
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

breaker
Posts: 28
Joined: Mon May 06, 2013 6:42 am

Re: New to Raspbian and Linux? Start here...

Mon May 06, 2013 7:16 am

Yes, I am pretty familiar with Linux by way of Ubuntu then Linux Mint, which share some similarities with Debian. Anyway if you are working in a terminal emulator such as LXTerminal, the history command can be pretty useful; http://tldp.org/LDP/GNU-Linux-Tools-Sum ... story.html

I like the Wiki at eLinux.org, very nice work. I feel excellent documentation is a key to success.

Return to “Raspbian”

Who is online

Users browsing this forum: No registered users and 24 guests