Skip to main content

ads1

Class 11th Chapter-6 Basic Ubuntu Linux Commands (GSEB)



Terminal :-  To open a terminal Press  CTRL+ ALT + t keys together(As Shorcut).

Command

1. Calendar (cal) :- The cal command is used to display a calendar of any specific month or entire year.
2. Date (date) :- Another utility command is date; it is used to display the system date.
3. Calculator(bc) :- The bc command in linux is a command line calculator.
    The ibase function allow us to set the numbering system.
(a) obase = 16
(b) obase = 2
(c) sqrt = (256)

4. echo :- The echo command is used to display a message on the terminal.
eg :- $echo Hi,Welcome to techonespot.

5. Changing password (passwd) :- It is used to change the password of the current login account by default.
eg :- $passwd

6.Clearing the Screen (clear) :- we have one simple solution for this problem, use the clear command to remove data on the screen.

7. Present Working Directory (pwd) :- The directory where we are located at that moment is known as current directory or present working directory. To know the current directory  we can use the pwd command.
eg :- Spwd

8.Creating a Directory (mkdir) :- A directory in Linux can be created using the mkdir command. The command takes the name of the directory to be created as its argument.
eg :- $mkdir subject

9. Change Directory (cd) :- We can change a specific directory using the cd command.
eg :- $cd subject  
eg :- $mkdir math science economics

10. Create a file using cat command :- $cat > introduction
Concatenating multiple files using cat command
The cat command can also be used to concatenate the contents of multiple files and store it in another file. The syntax of using the concatenation is shown below :
$cat file1 file2 > file3

11. Deleting a File (rm) :-The rm command is used to delete/remove one or more files.
eg :- $rm introduction
To delete multiple file
eg :- $rm file1 file2 file3

12.The symbol * is known as wildcard character.

13.$cat > .introduction  Learning Ubuntu Linux is fun....
TO end the file :- [CTRL + d]

14. Copying a file (cp) :- It creates an exact replica of a file on the disk at the location specified by the user. The cp command needs at least two arguments.

15.Renaming files and/or moving files (mv) Changing the name of a file or directory is another operation that user performs regularly. The mv command is used for renaming a file or directory.  

eg :- $mv file1 file2 my_dir

16. Compare two files (cmp) :-  If the two files compared differ in contents then the byte and line number at which the first dissimilarity occurred is reported.

17. Counting lines, words and characters in a file (wc):- The wc command is used to count the number of lines, words, and characters in the specified file or files.

18.Ordering Output (sort) :-The sort command is used to order the data stored within a file in ascending or descending sequence at the time of display.

19. Pattern matching (grep) :- The grep command performs similar operation from the command line interface. The command is based on a fundamental idea of search globally for a regular expression and display lines where instances are found

MCQ

1. Which of the following command is used to count the total number of lines, words, and  characters contained in a file?
(a) countw   (b) wcount   (c) Wc   (d) wordcount

2. Which of the following command is used to remove files?
(a) dm   (b) rm   (c) delete  (d) erase

(3) Which of the following command is used to remove the directory?
(a) rdir  (b) remove  (c) rd   (d) rmdir

(4) Which of the following command is used to count just the number of lines contained in a file?
(a) wc - r (b) wc - w  (c) wc - c  (d) wc - 1

(5) The command chmod 761 letter is equivalent to which of the following access
rights?
(a) chmod u=7, g = 6, 0 = 1
(b) chmod a = 761
(c) schmod u = rws, g = rw, o = x
(d) chmod 167

6. Which of the following refers to the maximum length of a filename in Linux?
(a) 8     (b) 10     (c) 200     (d) 255

(7) The hierarchy of a series of directories branching in a user system starts from which of the following directories?
(a) home     (b) \root     (c) home     (d) /root

(8) Which of the following command is used to copy a file?
(a) tar    (b)cpio     (c) cp     (d) copy

(9) Which of the following command is used to display your current working directory?
(a) path     (b) pwd     (c) prompt $pg     (d) dir

(10) Which of the following command is used for searching a pattern in a file?
(a) grep     (b) find       (c) lookup      (d) All of the above

(11) Which of the following is not a redirection symbol?
(a) >     (b) <     (c) *    (d) >> 

 

Link to download :-  MCQ


 

 

 

 

 

 

 

 

 

ads2

Popular posts from this blog

11. Write a Java program to input basic salary of an employee and calculate its Gross salary according to following:

    11. Write a Java program to input basic salary of an employee and calculate its Gross salary according to following: Basic Salary <= 10000 : HRA = 20%, DA = 80% Basic Salary <= 20000 : HRA = 25%, DA = 90% Basic Salary > 20000 : HRA = 30%, DA = 95% Static Solution :-  class salary {     public static void main(String args[])     {     double basic=20000.50,gross,da,hra;     if(basic <=10000)     {         da = basic * 0.8;         hra = basic *0.2;     }              else if(basic <=20000)     {         da = basic * 0.9;         hra = basic *0.25;     }     else     {         da = basic * 0.95;         hra = basic * 0.3;     }     gross = basic + da + hra;     System.out.println("The Gross Salary is :-"+gross);     } } Output :-  Dynamic Solution :-  class salary {     public static void main(String args[])     {     double basic=20000.50,gross,da,hra;     Scanner in = new Scanner(System.in);     System.out.println("Enter the Basic Salary

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise or class wise.

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise  or class wise. Solution :-   # x-axis is shows the subject and y -axis # shows the markers in each subject # import pandas and matplotlib  import pandas as pd  import matplotlib.pyplot as plt # Simple Line Chart with setting of Label of X and Y axis, # title for chart line and color of line  subject = ['Physic','Chemistry','Mathematics', 'Biology','Computer'] marks =[80,75,70,78,82] # To draw line in red colour plt.plot(subject,marks,'r',marker ='*')     # To Write Title of the Line Chart plt.title('Marks Scored') # To Put Label At Y Axis plt.xlabel('SUBJECT')           # To Put Label At X Axis plt.ylabel('MARKS')             plt.show() Output :- 

24.Create a Data Frame quarterly sales where each row contains the item category, item name, and expenditure. Group the rows by the category and print the total expenditure per category.

24.Create a Data Frame quarterly sales where each row contains the item category, item name, and expenditure. Group the rows by the category and print the total expenditure per category. import pandas as pd  # initialize list of lists data = [['CAR','Maruti',1000000],['AC','Hitachi',55000],['AIRCOLLER','Bajaj',12000], ['WASHING MACHINE','LG',15000],['CAR','Ford',7000000],['AC','SAMSUNG',45000],['AIRCOLLER','Symphony',20000],['WASHING MACHINE','Wirlpool',25000]] Col=['itemcat','itemname','expenditure'] # Create the pandas DataFrame qrtsales = pd.DataFrame(data,columns=Col) # print dataframe.  print (qrtsales) qs=qrtsales.groupby('itemcat')  print('Result after Filtering Dataframe')  print(qs['itemcat','expenditure'].sum()) Output :-