element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Linux Commands Necessary for Rasberry Pi?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 3 replies
  • Subscribers 663 subscribers
  • Views 334 views
  • Users 0 members are here
  • raspberry_pi
Related

Linux Commands Necessary for Rasberry Pi?

Former Member
Former Member over 12 years ago

I am a new bee, in the Linux platform...

My background is Embedded Firmware and Hardware developer having experience of close to 7years, in Windows based 'C' IDE's, using ARM Microcontroller,Microprocessor based controllers...
So I dont have Idea of RTOS,Linux OS Concept.Even I dont know threading concept

I want to make a toy car which is drvien by the rasberry pi, which will do the following functinality

1. A car with DC Motor say 5V.

2. Can detect the Center lane(Using some Image processing algorithm) of the road, having VGA camera to move in the single lane.

3. Automatic sensing of disturbances and moving in one direction by forward/backward motion, for detecting the disturbance I may use 4 IR sensor.


My question is,

1. Learn Linux Commands/Shell Scripts, for above application to be developed.If yes how much I may need to learn?Any link or guidelines is greatly helpful


2. Do I need to learn RTOS/Linux OS concept? If yes how much I may need to learn?Any link or guidelines is greatly helpful.

 

3. Any IDE is better for new learners like me is for development or GCC is better to learn?

 

4. Does threading is necessary when it comes to algorithm development?


If any clarification about my project or my raised questions, ur free to ask me, any criticism and feddback is most welcome... image

  • Sign in to reply
  • Cancel
  • shabaz
    shabaz over 12 years ago

    You have a lot of questions, which are clearly too much to be done much justice in a forum, and this doesn't help you. As a suggestion, you may need to read some books to get up-to-speed in any useful/significant detail, and then ask more narrower, specific questions.

    But, to get you started:

    RTOS: If you've been working for 7 years with microcontrollers then you should already know most of this: Basically, when you're designing certain things (airplane, washing machine) the system may have elements that are time-critical (i.e. as opposed to a key-press on a keyboard, which you won't mind to be sluggish occasionally). They are known as real-time systems, and traditionally they are coded as a main program loop (e.g. while(forever)) which cycles round, executing tasks in a fixed sequence, one after the other. This works to a degree, but isn't really maintainable if you want to add features, or if a task takes some uncertain time (e.g. how long to wait for a motor to spin up? What if the motor is replaced?). When to quit waiting and continue with the remainder tasks? It ends up messing with the timings of the entire system!.

     

    A solution is to execute each task concurrently, i.e. multi-task. One approach is to use interrupts, but there are a number of reasons why this is not always recommended (although for small programs it is often ideal). Another approach is to use an RTOS, which basically lets you write several small programs that can all execute in place of the single large program. The RTOS provides functions to allow each individual program to communicate with each other. In other words, the RTOS replaces the big control loop and jumps that traditionally controlled the overall program execution.

     

    Beyond that, there is a lot of theory that you'd need to read to understand such OS's. There are good books on the subject (I've not found good web resources on the subject). One simple book to read is by Jean J. Labrosse (it is unfortunately only geared to his own particular OS) but at least it gives you some background. There are more advanced books.

     

    Linux can be (and is) used to implement real-time systems but isn't traditionally known as a real-time OS. It does offer ways to create threads (of program flow) and communicate between them. This is a fairly advanced topic for a beginner. I'm guessing your C knowledge may already be fine? GCC is fine if you wish to use C. You can use the fairly regular tutorial on C/C++ in the blogs section, to brush up. It's as good as a textbook so far.

     

    Doing things like image processing requires you to either become very competant at programming and at maths, or requires you to be able to take some pre-existing library of code and use it; the latter is preferred usually. It still requires you to know a programming language first. Sometimes people go for more simpler methods like line-tracking using a reflective sensor rather than a VGA camera.

     

    Learning Linux commands is fairly essential for any programmer, since a large quantity of software uses Linux or Linux tools.

    Here is the absolute bare minimum to get you started (I wrote these up for someone once..).

    Quick Linux Guide

    Once logged into the Linux machine via Telnet, you will see a command prompt. In Linux, the software that is running that displays the prompt and allows you to type content is called the ‘shell’. You can leave the shell at any time by typing ‘exit’.

    Command Prompt

    Commands typically (but not always) have the syntax

    command -option -option argument

     

    An example would be

    ls –l *.txt

    The command ‘ls’ performs a directory (i.e. folder) listing. The argument ‘-l’ displays in a ‘lengthy’ format. The ‘*.txt’ argument defines what files to list.

    Redirection

    You can force the output into a file, using ‘>’.

    For example,

    ls > listing.txt

    would place the directory listing output into a file called listing.txt.

    History

    You can see earlier commands that you have typed by using the history command. It is very useful.

    Commands

    Useful commands are shown here.

    Command

    Example

    Description

    cd

    cd /home

    Change directory (folder)

    mkdir

    mkdir bob

    mkdir /home/bob

    Make a directory (folder)

    pwd

    pwd

    Display the current directory

    ls

    ls -altr

    Directory listing of files. The ‘-altr’ is a combination of 4 options. ‘-a’ lists hidden files too. ‘-l’ displays in a lengthy detailed format. ‘-t’ displays in date stamped order. ‘-r’ reverses the order, so that the most recent file is printed last.

    cp

    cp bob.txt mytest1.txt

    Copies a file

    mv

    mv bob.txt tests/.

    Moves a file into a folder or to a new file name. The example shown here would move the file into the tests folder.

    rm

    rm bob.txt

    Delete a file

    cat

    cat readme.txt

    Displays the contents of a file.

    more

    more readme.txt

    ls –altr | more

    cat readme.txt | more

    Displays content, but pauses per page. It can be combined with other commands that print lots of output, using the ‘pipe’ character ‘|’. The second example would be useful for viewing the contents of a folder with hundreds of files. The third example does the same as the first example.

    su

    su

    su - bob

    Change user. This allows you to jump from one user to another. It effectively creates a new shell. The first example allows you to become the root user who has administrator privileges. The second example changes to the user called ‘bob’. You can revert back to the original user (i.e. the original shell) by typing ‘exit’.

    ps

    ps -ef

    View the running processes. The example lists all processes (‘-e’) and in a long format (‘-f’). This command is useful to see what is running, and also useful if you want to force a process to close using the next command in this table

    kill

    kill -9 3244

    Force a process (program) to be closed. The ‘-9’ is a special signal that usually tells the program to close. The argument 3244 is the process number, found by using the ‘ps –ef’ command mentioned above.

    df

    df -k

    Check disk space. The ‘-k’ displays the values in kbytes.

    history

    history

    See all the previous commands that were typed

     

     

     

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • johnbeetem
    johnbeetem over 12 years ago in reply to shabaz

    The most useful GNU/Linux command is "man", which displays a short user guide ("manual page") for the command.  For example, "man ls" displays a guide for the "ls" command.

     

    To get started with Raspberry a lot of people recommend The MagPi: http://www.themagpi.com/.

     

    To get started with GNU/Linux, there are lots of books out there but I'll leave recommendations to others.  You might look at your local library for hard copy.  GNU/Linux evolves very slowly at the user and application developer level, so older books are a fine way to get started.  I mostly just use the Unix commands I learned back in the late 1970s and learn the latest options -- which do evolve -- using "man".

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to johnbeetem

    Agreed that #man is THE most usefull command.  Try #man man and you will soon discover the power of #man -k . image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube