Sample Practical


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sample Practical
# 1  
Old 05-21-2011
Sample Practical

Hello
Today I had a beautiful test to write some commands using Ubuntu, now I want to make sure of my answers to be reassured, if I had a mistake please correct me
  1. List all files details under ubuntu Desktop.

my answer:

Code:
cd Desktop |ls -l

  1. Navigate to your Desktop directory and write down the full path.

my answer:

Code:
pwd

  1. Create a directory under /home/ubuntu name the directory quiz.

my answer:
Code:
home@ubuntu:~$ mkdir ubuntu

home@ubuntu:~$ cd ubuntu

home@ubuntu:~/ubuntu$ mkdir quiz

home@ubuntu:~/ubuntu$ ls
quiz

home@ubuntu:~/ubuntu$ pwd

/home/home/ubuntu

  1. List all files which contain the letter p and redirect the output to a file under your quiz directory.

my answer:
Code:
ls p* > quiz

  1. Use grep command to extract the word time from ls manual and save the output to a file under your quiz directory.

my answer:

Code:
grep -t > quiz

  1. What does ls om*.su? do? Give an example for the output.

my answer:

Code:
list all files which content first letter o and second letter m and any letter in thread and have extension .su

  1. Student.txt file contains information about students which includes student Id,Student Name, subject, and Grade
Code:
04152:Jhon : COMP222:2 .5
04152:Smath : COMP222:3  
0123:Sara: COMP222:3
03234:Lea: COMP222:2.5

From this file use linux command extract student number and grade and save this information in a new file grade.txt

my answer:

Code:
cp Student.txt > grade.txt



[QUOTE=Chirel;302524109]

Last edited by Scott; 05-21-2011 at 07:54 PM.. Reason: Restore content removed by user; closed thread
# 2  
Old 05-21-2011
Hi,

Please could you read the rule 6 of the Rules here.
# 3  
Old 05-21-2011
Quote:
Originally Posted by S4K
Hello
Today I had a beautiful test to write some commands using Ubuntu, now I want to make sure of my answers to be reassured, if I had a mistake please correct me
Sorry but in my opinion look like you fail the test.

If you want comments , please edit your original post and re-format the post using [code] tags for code and data sample and correct the[list] tags.

Last edited by danmero; 05-21-2011 at 04:38 PM..
# 4  
Old 05-21-2011
Quote:
Originally Posted by danmero
Sorry but in my opinion look like you fail the test.

If you want comments , please edit your original post and re-format the post using [code] tags for code and data sample and correct the[list] tags.
Why do you think that? : (

The best way to learn! error! Even learn right and wrong.
# 5  
Old 05-21-2011
  • Code:
    ls ~/Desktop

  • Code:
    cd ~/Desktop && pwd

  • Code:
    mkdir -p /home/ubuntu/quiz

  • Code:
    ls *p*  > /home/ubuntu/quiz/file

  • Code:
    man ls | grep time > /home/ubuntu/quiz/ls.man.section

  • List all files beginning with om AND ending with .su
  • Code:
    awk -F: '{$0=$1 FS $NF}1' Student.txt > grade.txt


From here you can take the time to study each solution and you can search the forum for similar solution or read the manual for each command.
# 6  
Old 05-21-2011
Code:
home@ubuntu:~/Desktop$ mkdir -p /home/ubuntu/quiz
mkdir: cannot create directory `/home/ubuntu': Permission denied
home@ubuntu:~/Desktop$

# 7  
Old 05-21-2011
Still not working with the following ?
Code:
mkdir -p "$HOME/quiz"

Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. OS X (Apple)

Don't understand the practical difference between command aliases and environmental variables

Hey, I'm recently learning Unix from the video course by Kevin Scoglund. I'm stuck at the moment where he goes into Environmenat variables. I have some issues with understanding what's the essential difference between EV and command aliases: for instance, by writing the command alias ll='ls... (3 Replies)
Discussion started by: scrutinizerix
3 Replies

2. AIX

Looking for AIX Practical Experience

I have been in IT for around 7 years now and have benefited greatly from Open Source as well as free commercial offerings like Vmware Server that allow me to setup virtual environments and get some hands on time with different OS's and software. I am starting a new job in a few weeks which has... (5 Replies)
Discussion started by: supercrazy1
5 Replies

3. UNIX for Advanced & Expert Users

Amoung tar and gzip whiich unix command is more practical with respect to space manag

Hi All Can any body help me out. Amoung tar and gzip whiich unix command is more practical with respect to space management and file restoration. Eg if I use tar or gzip which will be more helpful to reduce the space and during the file restoration. Please help me out. regards... (3 Replies)
Discussion started by: manas6
3 Replies

4. Ubuntu

Can a Pentium III (450mhz) have any practical use these days?

Having had a big sort out at work I've brought home 3 Dell Dimension XPS-450 PCs. I've installed Ubuntu Linux on one which went fine, everything works, network, sound, Graphics Drivers etc. and it can see all the other PCs & storage on my network and can use the Shared printers from other PCs on... (12 Replies)
Discussion started by: Mark Ward
12 Replies
Login or Register to Ask a Question