Assign 1 Unix 111111 PDF

Title Assign 1 Unix 111111
Author Biswanath Shaw
Course biophysics
Institution Indian Institute of Science
Pages 4
File Size 64 KB
File Type PDF
Total Downloads 99
Total Views 192

Summary

Asssignment about bioinformatics...


Description

UNIX ASSIGNMENT-2020 BISWANATH SHAW 1) $ cat out1 out2 out3 | grep oil | wc –w > output

Ans: $ cal 12 2026 Ans: To view the month of December of Year 2026 $ rm –i abc.out Ans: It will remove the file abc.out, but before that system will prompt for confirmation. $ spell +a.out aaa.out Ans: It checks for the misspelled words in file +a.out and aaa.out and prints each misspelled word on its own line. $ chmod 741 sek.exe Ans: Sets following permission for the file: sek.exe Owner: Read, write and execute access Group: Read access Others: Execute access

$ mv a.out ../aa.out Ans: Move the file a.out to the destination ../ with the file name aa.out. Since ../ is the same directory, it makes a copy of the file with a different filename. $ tail -20 aa.inp | wc -l Ans: It return no of lines for last 20 lines of the file aa.inp . It will return 20 for files having more than or equal to 20 lines or total number of line in case of file having less number of lines. $ ls –l a?????pdb.*.pdf Ans: lists all the files satisfying the string a followed by 5 characters then pdb. followed by any number of character followed by .pdf. $ grep –y cash funds Ans: Search for the string “cash” without considering the case of the string while searching in the file funds. $ ls T[eE][sS][tT].doc

Ans: Search for following files in the current directory: Test.doc, TEst.doc, TeSt.doc, TESt.doc, TEST.doc, TeST.doc, TEsT.doc, TesT.doc.

2) to change the password of your account Ans: $ passwd to see all the hidden files in a particular directory Ans: $ ls -a to see the bottom 35 lines of a file unix.inp Ans: $ tail -n 35 unix.inp to find out how many lines of a file contain a pattern “seka” Ans: $ cat file | grep seka | wc -l to create a new directory “new” in the existing directory Ans: $ mkdir new To spell check a file called seka.inp Ans: $ spell seka.inp To see the free disk space in giga bytes in Linux Ans: $ df -h To list out all the sub-directories in a particular directory Ans: $ ls -d */ Construct a pipeline to store all the files ending with “.seq” Ans: $ cat *.seq > sample.seq To print the lines 21 to 40 of a file (rad.out) containing 60 lines Ans: $ head -40 rad.out | tail +21 to compressed all the files of a directory “/usr/people/sekar” Ans: tar -czvf compressed.tar.gz /usr/people/sekar 3) grep and man grep: it is a command-line tool in Linux/Unix that is used to search for a string of characters in a specified line. $ grep –[OPTION] “unix” samplefile.txt

man: it is a command line tool in Linux/Unix that provides detailed information of a command such as NAME, DESCRIPTION, EXIT STATUS, FILES, EXAMPLES, SYNOPSIS, OPTIONS, RETURN VALUES, ERRORS, VERSION, AUTHORS.

$ man -[OPTION] [COMMAND NAME]

name all the three modes of “vi editor” The three modes of “vi editor” are : a) Command Mode: This is default mode of vi starts up. In this mode vi interprets any characters we type as commands and this is not displayed on the window. We can move through a file, delete, copy or paste text. To enter into command mode Esc key is pressed. b) Insert Mode: This mode is used to insert text into the file in the form of input and put in the file. To get into the insert mode i key is pressed and to get out Esc key. c) Escape Mode: This mode is used to perform tasks such as saving files and executing commands. By typing the colon [:] when vi is in Command mode, the cursor would move to the last line of screen and would wait for further command.

:set number ( in ‘vi’ editor ) To set numbers in vi editor following steps need to be performed: a) Press Esc Key b) At the: prompt type the following command: set number

:19,39 s/sign/signature ( in ‘vi’ editor )

In the vi editor, this command searches for the string sign and replaces with the string signature for lines 19 to 39 :.,55d ( in ‘vi’ editor ) Remove the first 55 lines of the file....


Similar Free PDFs