1 / 18

Linux commands exercise

Linux commands exercise. What do you need, if you try to these at home?. You need to download and install Ubuntu Linux from the Internet DVD is need for saving this You need to download and install Vmware player When Vmware player installed you must install Ubuntu from your DVD

dillian
Download Presentation

Linux commands exercise

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Linux commands exercise

  2. What do you need, if you try to these at home? • You need to download and install Ubuntu Linux from the Internet • DVD is need for saving this • You need to download and install Vmware player • When Vmware player installed you must install Ubuntu from your DVD • You can start vmware player and set up there ubuntu for your Vmware player • Now you can start ubuntu on vmware player but there you must install terminal program that you able to type commands • Then Linux Ubuntu is ready to use for the following exercises

  3. Ubuntu exercise • When you are in the terminal of Ubuntu try the commands starting from the next page • Work in pairs (two people in one group) • Open Word as well • Copy everything from your Linux window to word and save the content. All the content must be in the same file. • Ask Pekka for help if necessary

  4. Key combinations and special characters • Ctrl-R means that you first put Ctrl key down and then press R • Alt-R means that you first put Alt key down and then press R • ~ Tilde

  5. Get familiar with your Linux Ubuntu environment • Who are you? • Type a command whoami • Where are you? • Type a command uname –n • What kind of place this is? • Type a command uname –nmo • What kind of processor and what kind of UNIX you have on UNIX server? • Type a command uname–a

  6. Who else are online? • Type a command who • If you have more users • Type a command who | less • Who is who? • Type a command finger • You can also find detail • Type a command finger –m smith or finger smith • You can type the command by using a user’s first name as finger john finger –m john

  7. What does each user do? • Type a command ps –ef • What do you own here? • Type a command pwd • When you are logged in on a Linux computer and you have started command terminal, you see your home directory as follows • Type a command ls • You can also try the same with a synonym by typing dir

  8. You can shout by using the echo command as follows • Type a command echo how does echo respond? • You can write simplified text files with the pico editor • Type a command pico text.txt • You can show text files by typing • A command cat text.txt (in which text.txt is the name of your file)

  9. Try a command cat /etc/group • It tells the groups of the users on a Linux server to which you are connected • And after that you can try a command less /etc/group • You get output in little pieces • Getting information about the CPU of your server • Try a command cat /proc/cpuinfo • Getting information about helping programs for Linux environment • Try a command ls /bin/ • More helping programs can be found as follows • Try a command ls /usr/bin • If too many programs from these are installed, it can cause the situation called dependency hell

  10. How to learn more when you need this? • Try a command man ls • And then a command man pwd • You can also try a command man finger • But it may not work in the ubuntu implementation of Linux • Try a command info info • In addition you can include help argument to the end of your clause • Try a command ls–help • But be carefully when you do this with the rm command • As rm –help • This time you see the help information, but if you have other argument after “rm”, you can delete the entire file

  11. File management • Try a command cd .. • You can move one step to the root in your directory structure • Then you can try a command ls • You can see the files in your default directory • Followed by trying a command pwd • It shows the name of the current directory

  12. Going to root directory cd \ • Takes you to the entire system's root directory • Try this • Then try ls command to see the content • Let’s create directories • Give a command mkdir osttc12 • And after that use the command ls to see the current content • Then go the course directory by typing a command cd osttc12

  13. Then in osttc12 directory create directories exercise1, exercise2, exercise3 and exercise4 • Check that you were successful • Use ls command

  14. How improve interactivity on Linux shell? • Exercise some with echo command • Type echo {aa,bbb} {1,2,3} {X,Y} • Press the arrow up key • Look at what happened and try again • Try arrow down key as well in the same way • Browse the previous echo command from the command history • Modify the previous echo command that it is in the format echo {aa,bbb} {1,2,3} {W,Y} and after that • echo {aa,bbb} {1,2,3} {moon,Y}

  15. Take one echo for editing • Try key combinations CTRL-A and CTRL-E • Try to create file by the pico editor • pico test.txt • Try to print the previous file on the screen • less test.txt

  16. Using different programs-combining commands • Try to command who | sort • You can see the users in alphabetic order (A, B, etc.) • | is mark for combining commands • After it you tell the additional argument

  17. Putting out into a file • Use grep • Write a file containing Riyadh as the third line • Before that the file can contain anything • pico test2.txt • Then try the command grep Riyadh test2.txt

  18. Reading inputs from a file • You can use < mark for that • Try less < test2.txt

More Related