Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Full Summary all in one computer science Subject, Study notes of Computer Science

Delve into the World of Computer Science: A Comprehensive Full Summary Embark on a journey through the intricate landscape of computer science with our all-encompassing summary, designed to encapsulate the entirety of this dynamic field in one concise overview. From fundamental concepts to cutting-edge advancements, this summary offers a panoramic view of the diverse subjects that compose the realm of computer science. Explore the Foundations: Uncover the bedrock of computer science as we delve into the essential building blocks. Discover the underpinnings of algorithms, data structures, and programming languages, gaining a deep understanding of how these elements shape the digital world we inhabit. Programming Paradigms Demystified: Dive into the multifaceted world of programming paradigms, from procedural and object-oriented to functional and beyond. Gain insights into the rationale behind these approaches and learn how they influence software development and problem-solving strat

Typology: Study notes

2022/2023

Available from 08/10/2023

words-of-lofi
words-of-lofi 🇮🇳

1 document

1 / 51

Toggle sidebar

Related documents


Partial preview of the text

Download Full Summary all in one computer science Subject and more Study notes Computer Science in PDF only on Docsity! 5 Operating System UNIT 1 OPERATING SYSTEM Structure Page No. 1.0 Introduction 5 1.1 Objectives 6 1.2 Familiarization (I/O Port, Keyboard, Memory) 6 1.2.1 Computer and Motherboard 6 1.2.2 I/O Ports 8 1.2.3 I/O Devices 9 1.2.4 Memory 14 1.3 Windows Operating System 16 1.3.1 Overviews of Windows 16 1.3.2 Windows Installing Procedure 17 1.3.3 Working with XP 25 1.4 Linux Operating System 31 1.4.1 Overview of LUNIX/LINUX Operating System 31 1.4.2 How to install Linux Operating System 32 1.4.3 Linux utilities and Basic Commands 41 1.5 Summary 53 1.6 Answers to Check Your Progress 53 1.0 INTRODUCTION In this unit, we are going to learn basics of computer. Computer is a machine that performs tasks or calculations according to a set of instructions, or programs. Compared to those early machines, today's computers are amazing. Not only are they thousands of times faster, they can fit on your desk, in your lap, or even in your pocket. Computers work through an interaction of hardware and software. Hardware is physical component of a computer system. It is a tiny rectangular chip inside the computer called the central processing unit (CPU), or microprocessor. It is the "brain" of computer—the part that translate instructions and performs calculations. Hardware items such as monitor, keyboard, mouse, printer, and other items are often called hardware devices. Software refers to the instructions or programs that tell the hardware what to do. The operating system (OS) is system software that manages computer and the devices connected to it. OS is responsible for management and coordination of activities and the sharing of the limited resources of computer. The OS acts as a host for other application software. 6 Lab Course We will be discussing about two well known operating systems: (a) Windows operating system, and (b) Linux operating system. 1.1 OBJECTIVES After going through this unit, you should be able to: understand about computer and it‘s components; features of Windows XP; know the installation procedure of Windows XP; features of Linux (Fedora); know the installation procedure of Fedora; and know the utilities and basic commands of Fedora. 1.2 FAMILIARIZATION WITH I/O PORT, KEYBOARD, MEMORY Computer plays a key role in how individuals work and how they live. Even the smallest organizations have computers to help them operate more efficiently, and many individuals use computers at home for educational, entertainment, and business purposes. Thus you must be familiar with computers and its components. In the following sub-sections, we will discuss the same and there is practice session also at the end of this section. Hope you will enjoy this practice session. 1.2.1 Computer and Motherboard Computer : A computer is programmable machine that receives input, stores, manipulate data, and provides output in a useful format. Computer takes input from input devices and then compute in CPU and stores in memory and sends output to output devices. The most common device for input is the keyboard. When you type, you are putting information into the computer, which is known as input. The most common device for output is the monitor. These input output devices are connected through I/O Ports. 9 Operating System Figure 1. 3. I/O Port I/O ports are there to connect to I/O devices. There are various I/O devices which are discussed in the next subsection: 1.2.3 I/O Devices Few I/O devices are given Table 1.1. Table 1.1 : I/O Devices Here, we are discussing about Keyboard and mouse. Rest is kept for you to explore. Keyboard Basics Keyboard is used to type data into the computer. is most common input device. has special keys for giving the computer commands. Commands tell the computer to do something, like save the file. These special keys are called command or function keys. Input Devices Output Devices Mouse Monitor Joystick LCD Scanner Printer Light Pen Plotter 10 Lab Course Figure 1.4: Overview of Keyboard Types of Keys Typing Keys / Main Typing Keypad: It holds alphabetic character such as letter, special characters and numbers for typing. Numeric Keypad: It can be used as numeric and directional keys, pressing the Num Lock key above the numeric keypad will tell whether the keys are on numeric or directional mode. If it is on, it is on numeric mode and can enter numbers. If it is off, it is on directional mode and only used for moving a cursor on screen UP, Down, Left or Right. Function Keys: There are 12 functions keys starting from F1 through F12. These keys are used for special purposes. Control Keys: It has two groups of keys, arranged from top to bottom. The top keys holds Insert, Home, Page Up, Page Down, Delete, and End keys. Insert key switches between insert and overtype modes. Home key brings you back at the beginning of a page. Page Up and Page Down keys help you to move one page or screen up or down. Delete key erases a text or page. The End key takes you at the end of a page. The bottom keys are independent directional keys, which let you to move the cursor Left, Right, Up and Down. Status lights, Escape key, Print Screen/SysRq, Scroll Lock, and Pause/Break are user for frequent functions. Status Lights : These light indicate whether Num Lock, Caps Lock or scroll Lock light is on /off. There are several short cut keys to make our work convenient when mouse is not working or if we do not want to do several manouvres with the mouse. It makes our work convenient while working with MS-Word. Shortcut Keys Description 11 Operating System Ctrl + A Select all contents of the page. Ctrl + B Bold highlighted selection. Ctrl + C Copy selected text. Ctrl + E Aligns the line or selected text to the center of the screen. Ctrl + F Open find box. Ctrl + I Italic highlighted selection. Ctrl + J Aligns the selected text or line to justify the screen. Ctrl + K Insert link. Ctrl + L Aligns the line or selected text to the left of the screen. Ctrl + M Indent the paragraph. Ctrl + P Open the print window. Ctrl + Spacebar Reset highlighted text to the default font. Ctrl + 1 Single-space lines. Ctrl + 2 Double-space lines. Ctrl + 5 1.5-line spacing. Ctrl + Alt + 1 Changes text to heading 1. Ctrl + Alt + 2 Changes text to heading 2. Ctrl + Alt + 3 Changes text to heading 3. Alt + Ctrl + F2 Open new document. Ctrl + F1 Open the Task Pane. Ctrl + F2 Display the print preview. Ctrl + Shift > Increases the highlighted text size by one. Ctrl + ] Increase selected font +1pts. Ctrl + Shift + < Decrease selected font -1pts if 12pt or lower, if above 12 decreases font by +2pt. Ctrl + [ Decrease selected font -1pts. Ctrl + / + c Insert a cent sign (¢). 14 Lab Course 1.2.4 Memory Now we discuss about one of the most important parts of computers i.e memory. Computers generally possess several distinct types of memory, each of which "holds" or stores information for subsequent use. The vast majority of computer memory can be placed into one of two categories: primary memory and secondary memory. Figure 1.6 : Hierarchy of memory Primary memory, often called main memory, constitutes that device, or group of devices, that holds instructions and data for rapid and direct access by the computer's central processing unit (CPU). Primary memory is synonymous with random-access memory (RAM). Figure 1.7 : RAM Modern RAM is made of semiconductor circuitry. RAM is a volatile form of information storage, meaning that when electrical power is terminated any data that it contains is lost. There are other semiconductor memory devices accessed by the CPU that are generally considered as being distinct from primary memory (i.e., different from RAM). These memory units include cache memory, read-only memory (ROM), and Programmable Read Only Memory (PROM) and EPROM (erasable programmable read-only memory Secondary memory, also called auxiliary memory or mass storage, consists of devices not directly accessible by the CPU. Hard drives, floppy disks, tapes, and optical disks are widely used for secondary storage. First, most secondary storage devices are capable of containing much more information than is feasible for primary memory (hence the use of the term "mass storage" as a synonym for secondary memory). A second, and essential, feature of secondary memory is that it is non-volatile. This means that data is stored with or without electrical power being supplied to the device, as opposed to RAM, which can retain its data only so long as electrical power is present. Like primary memory, many secondary memory devices are capable of storing information, as well as retrieving it. Magnetic technology devices (such as hard drives, floppy disks, and tape) have this read-write capability, as do magneto- optical drives. However, some mass storage devices can only read data, as in the case of CD-ROM (Compact Disk-Read Only Memory) drives. CD-ROMs utilize 15 Operating System optical technology; however, newer optical technologies, such as CD-RW (compact disk-rewriteable), can both read and write information like magnetic storage devices. Hard Disk Figure 1.8(a) : Internal view Figure 1.8(b) : External view The hard disk is the main, and usually largest, data storage device in a computer. The operating system, software titles and most other files are stored in the hard disk. Now let‘s have a Practice Session Check Your Progress 1 1. Find shortcut keys for the following: a) To Open Help. b) To repeat the last action performed. c) To save document d) To Bold the selected text e) Change the text in Microsoft Word from uppercase to lowercase or capital letter at the beginning of every word. 2. List use of following function keys: F1, F2, F3, F4, F5, F7, F8, F12 3. Type the following passage in MS-WORD over the past few years the growth of the computer industry has been quiet remarkable and today it is the fastest growing industry in our economy. Nowadays, many schools are equipped with computers for educating their students. Thereby making computers an integral part of education system. Teachers and profesors use computers for teaching, giving presentations, assessing various data banks, maintaining database of students, communication in the form of e mails or chat, browsng the Internet and 16 Lab Course Preparing students to have a competitive edge in the global job market. Computers have revolutionized the learning for students in a big way. They can watch various films on wild life, history, geography, science and encyclopedias with loud sound and excellent picture quality on CompactDisc‘sorDVD‘s. (a) In this paragraph, there are few spelling errors. Try spelling check for this. Try to find and replace ‗loud‘ by ‗‗excellent‖. (b) Now save this paragraph with the name ‗computer‘ on your desktop. 1.3 WINDOWS OPERATING SYSTEM The main operating systems involved in networking now days are Windows and Linux. Both are having their own advantages and disadvantages. Linux works better on older, less powerful computer hardware because it requires less resource (memory or processing) as compared to Windows. Compared to Windows, Linux is virus-free and bugs free. Windows provides the user a mature, familiar and interactive interface that is easy to learn and understandable. But we think that a network administrator should have an expertise on both of these leading network operating systems. Even most of the network administrators are running both Linux and Windows on the server for the best networking. This section provides you the: (1) Discussions, demonstrations, and lab exercises to sharpen your skills and knowledge necessary to admin and support Windows XP/Linux networking. (2) It contains an overview of Windows XP and Linux/Unix in the beginning to develop your understanding of these operating systems. (3) Further in this course you have an example to introduce you in the lab. Then you have different lab exercises on Linux/Unix and on Windows XP. 1.3.1 Overview of Windows Background to Windows Windows XP is an operating system that was produced by Microsoft for use on personal, including home and business desktops, laptops, and media centers. It was first released to computer manufacturers on August 24, 2001, and is the most popular version of Windows, based on installed user base. The name "XP" is short for "experience." 19 Operating System Step 7 : You will be presented with the End User Licensing Agreement. Press F8 to accept and continue Step 8 : This step is very important. Here we will create the partition where Windows will be installed. If you have a brand new unformatted drive you will get a screen similar to below. In our case the drive size is 8190MB. We can choose to install Windows in this drive without creating a partition, hence use the entire size of the drive. If you wish to do this you can just press enter and Windows will automatically partition and format the drive as one large drive. Step 9: Windows will show the total size of the hard drive and ask you how much you want to allocate for the partition you are about to create. I will choose 6000MB. You will then get the screen below. Notice it shows C: Partition 1 followed by the size 6000 MB. This indicates the partition has been created. We still have an unpartitioned space of 2189MB. Next highlight the unpartitioned space by pressing down the arrow key. Then press C to create another partition. You will see the total space available for the new partition. Just choose all the space left over, in our case 2180MB. Step 10 : Choose format the partition using NTFS file system.This is the recommended file system. If the hard drive has been formatted before then you can choose quick NTFS format. We chose NTFS because it offers many security features, supports larger drive size, and bigger size files. 20 Lab Course Windows will now start formatting drive C: and start copying setup files as shown on the two images below : Step 11 : After the setup has completed copying the files the computer will restart. Leave the XP CD in the drive but this time DO NOT press any key when the message "Press any key to boot from CD" is displayed. In few seconds setup will continue. Windows XP Setup wizard will guide you through the setup process of gathering information about your computer. Step 12 : Choose your region and language. 21 Operating System Step 13 : Type in your name and organization. Step 14 : Enter your product key. Step 15: Name the computer, and enter an Administrator password. Don't forget to write down your Administrator password. Step 16: Enter the correct date, time and choose your time zone. Step 17: For the network setting choose typical and press next. 24 Lab Course If there are any yellow exclamation mark "!" next to any of the listed device, it means that no drivers or incorrect drivers has been loaded for that device. In our case we have a Video Controller (VGA card) which has no drivers installed. Your hardware should come with manufacturer supplied drivers. You need to install these drivers using the automatic setup program provided by the manufacturer or you need to manually install these drivers. If you do not have the drivers, check the manufacturer‘s website to download them. To install a driver manually use the following procedure: (a) From the device manager double click on the device containing the exclamation mark. (b) This would open a device properties window. (c) Click on the Driver tab. (d) Click Update Driver button. The Wizard for updating device driver pops up as shown below: You now get two options. The first option provides an automatic search for the required driver. The second option allows you to specify the location of the driver. If you don't know the location of the driver choose the automatic search which would find the required driver from the manufacturer supplied CD or Floppy disk. Windows would install the required driver and may ask you to restart the system for the changes to take affect. Use this procedure to install drivers for all the devices that contain an exclamation mark. 25 Operating System 1.3.3 Working with XP i) Desktop The typical Windows XP desktop includes following desktop icons Icons are small pictures that represent files, folders, programs, and other items. Double-clicking a desktop icon starts or opens the item it represents. For e.g. Internet Explorer. It is used to quickly access Internet. The Taskbar is usually located on the bottom of the screen. It houses the Start button, clock, and a task button for each active program currently running and each open folder. ii) Parts of a window Most windows have the same basic parts: 26 Lab Course Title bar. Displays the name of the document and program (or the folder name if you‘re working in a folder). Minimize, Maximize, and Close buttons. These buttons hide the window, enlarge it to fill the whole screen, and close it, respectively (more details on these shortly). Menu bar. Contains items that you can click to make choices in a program. See Using menus, buttons, bars, and boxes. Scroll bar. Lets you scroll the contents of the window to see information that is currently out of view. Borders and corners. You can drag these with your mouse pointer to change the size of the window. a) Moving a window To move a window, point to its title bar with the mouse pointer . Then drag the window to the location that you want. (Dragging means pointing to an item, holding down the mouse button, moving the item with the pointer, and then releasing the mouse button.) Changing the size of a window To make a window fill the entire screen, click its Maximize button or double-click the window's title bar. To return a maximized window to its former size, click its Restore button (this appears in place of the Maximize button). Or, double-click the window's title bar. To resize a window (make it smaller or bigger), point to any of the window's borders or corners. When the mouse pointer changes to a two- headed arrow (see picture below), drag the border or corner to shrink or enlarge the window. A window that is maximized cannot be resized. You must restore it to its previous size first. b) Hiding a window Hiding a window is called minimizing it. If you want to get a window out of the way temporarily without closing it, minimize it. 29 Operating System Copy or Move a Folder or file Select the folder to be copied. Once the folder has been selected, click on Copy. Select the folder where you want to copy then open that folder , right click and select paste option. In the case of not having the folder created to which we want to copy to, click Make new folder, rename new folder with name you want and Click OK. Copy or Move Multiple Files or Folders 1. Double-click on the folder My documents and create folder 1 and folder 2 . 2. Select the folder ‗folder 1‘ 3. Press CTRL , Select another folder ‗folder 2‘ 4. Select from right panel under ‗file and folder task ‗heading ‗Copy the selected items‘ or ‗Move the selected items‘ 5) The following window will be open 6) Then double-click the folder you want to move the selected items 7) if you want to copy in new folder then select ‗ make new folder ‗ and new folder is created then select copy This can also be done to move or copy Files. Some Windows XP Tips Check the Taskbar for the programs that are currently running on your computer. You should close (click on the X at the upper right) all duplicate instances of the same program to free up memory. 30 Lab Course If your application should "hang" (keyboard or mouse does not respond), hold down the CONTROL and ALT keys, then depress and release the DELETE key. You will get a menu of the tasks currently loaded in memory. Highlight the application that hung (usually the one that is marked "not responding"), and click on End Task. You can usually unload the application gracefully without having to reboot your computer. Files deleted from your local hard drive will be saved in the Recycle Bin until you empty the Recycle Bin. To empty the Recycle Bin, right click on Recycle Bin, and select Empty Recycle Bin. If you need to recover deleted files from the Recycle Bin, right click on Recycle Bin, and select Explore. You should move the file from the Recycle Bin to another folder on the hard drive (for example, click and drag the file in Recycle Bin, Explore to the desktop). It's best to empty the Recycle Bin from time to time as deleted files saved in the Recycle Bin actually take up more hard disk space than if they were in a regular folder. But remember, once the Recycle Bin is emptied, you can NOT recover the deleted files. Also, files deleted from diskettes are not saved in the Recycle Bin. Finding a "Missing" Document If the document was created recently on your computer, launch the application you used to create it, and select File. Windows remembers the last nine documents you opened by default. If you remember the file name or part of the file name but not its location, click on the START button, Search, and Files or Folders. On the menu on the left side, select All Files and Folders. In the Look In box, select (C:). In the All or Part of Name: box, enter the file name, and click Search. Windows will list all instances of the file if it finds any matches. If you know part of the file name, you can enter it in A Word or Phrase In the File: box. Saving Documents In Microsoft Word, the default location to save your document is the My Documents folder. To save your document in a different folder, click on the yellow folder with the up-arrow to browse one level up, on the left side click on the yellow folder with the * to get to your Favorites folders, or click the yellow folder with a yellow * on it (on the toolbar) to create a new folder. The Save In: box shows the current folder. 31 Operating System Note: if you use Corel WordPerfect, your default folder for saving documents is My Files. You may use either folder but it's best to create a folder for each project and save your documents in their corresponding project folder. Check Your Progress 2 1. Find out whether your PC has compatibility to install windows XP. 2. Practice and install Windows XP in your PC. Check Your Progress 3 1. Organize your Desktop icons by name then change the Desktop theme also 2. Your desktop is showing date ―Wednesday, may 22, 2011‖ and time ―11:48 AM‖ now change it to present date and time. 3. Create shortcuts for MS-Word. 4. i) Create new folder rename it as ―Lab1‖. ii) Create new ms-word document. Type a paragraph on ―computer operating system ―and save it as ―session 3‖ iii) Ask your friend to search document ―session 3‖ 5. How can you remove an item from the Start menu or from a Program menu? 6. Search Calculator, notepad, paint. 7. Where the pen drive is connected? 8. How will you install extra ram in your computer. 1.4 LINUX OPERATING SYSTEM 1.4.1 Overview of UNIX/ LINUX Operating System Even after thirty years of its creation UNIX is still regarded as one of the most versatile, flexible and powerful operating systems in the computer world. It was created at Bell Labs in 1970 written in the C programming language, which was developed at the same time. It supports large numbers of simultaneous users, runs 34 Lab Course Choose your language... Choose your keyboard layout... 35 Operating System Type a name for the computer. It can be anything you want... Select your location (country/city)... 36 Lab Course Enter the root (System Administrator) password. The longer, the better (WRITE IT SOMEWHERE)... Here, comes the partitioning part! If you have an empty hard drive, all you have to do is click "Next," but make sure the"Remove all partitions on selected drives and create default layout" option is selected. If you don't have an empty hard drive and you still want to install Fedora 10 on your machine, then make sure you select the "Use free space on the selected drives and create default layout" option (10 GB minimum of free space is required). Click "Next"... 39 Operating System When the installation is over, you will get a "Congratulations, the installation is complete" screen. Click the "Reboot" button and your computer will automatically restart... Remove the DVD from your optical drive. Your brand new Fedora 10 operating system will boot for the first time... If you've chosen to encrypt your partition, then you'll be prompted for the password ... 40 Lab Course The system will continue to boot and in a few seconds you will see the First Boot Configuration Wizard. Click "Forward" on the Welcome screen... Click "Forward" on the License screen... 41 Operating System Create a regular user for the system... Set the date and time... Click "Finish" and you will see the login screen. Enter the password for the regular user you've just created... That's it! 1.4.3 Linux utilities and Basic Commands The following is a list of commonly used commands which are organized under different categories for understanding and ease of use. Keys proceeded by a ^ character are CONTROL key combinations. 44 Lab Course crontab run program at specified intervals limit see or set resource limits for programs alias create alias name for program (in .login) sh, csh execute command file Description of Commonly Used UNIX Commands The description for the most commonly used UNIX commands is given below in an alphabetic order. a) cat cat allows you to read multiple files and then print them out. You can combine files by using the > operator and append files by using >>. Syntax: cat [argument] [specific file] Example: cat abc.txt If you want to append three files (abc.txt, def.txt, xyz.txt), give the command as, cat abc.txt def.txt xyz.txt > all b) cd, chdir cd (or chdir) stands for ―change directory‖. This command is the key command to move around your file structure. Syntax: cd [name of directory you want to move to] When changing directories, start with / and then type the complete file path, like cd /vvs/abc/def in this eg. You are moving from vvs directory to abc directory then move to def directory . You can also move relative to the current directory by typing cd vvs/abc/def To move relative to the parent directory of your current directory, use Cd ../vvs/abc/def c ) chmod chmod (which stands for ―change mode‖) changes who can access a particular file. A ―mode‖ is created by combining the various options from who, opcode, and permission. Syntax: chmod [option] mode file If you look at a list of files using the long list command ls –l, you‘ll see the permissions, owner, file size, modification time, and filename. The first column of the list shows who can read, write, and execute the files or directories, in other words, the permissions. It basically shows who has permission to do what to a given file or directory. r stands for ―read‖ and means that you‘re allowed to read the file or directory. w stands for ―write‖ and gives permission to edit or change the file as well as create, move, rename, or remove a directory. x stands for ―execute‖ which gives permission 45 Operating System to run a file or search a directory. Every file or directory has four sets of rwx permissions. The first set represents the user (u), the second set represents the group (g), the third set represents other (o), and the fourth set represents all (a). The column will look like this: rwxrwxrwx Each set of rwx represents user, group, and other respectively. Only the owner of a file or a privileged user may change the permissions on a file. There are two ways to change permissions on a file or directory, either numerically or by using lettered commands. Both ways use the command chmod. To add permissions to a file, you use +, to remove permissions you use-. For example, take a file: -rw-r--r-- 1 yash mony 476 Apr 14 17:13 vvs.txt To allow a group (mony, in this case) ―write‖ access, you would type: chmod g+w vvs.txt If you wanted to remove ―read‖ ability from ―other‖ you would type: chmod o-r vvs.txt It is also possible to specify permissions using a three-digit sequence. This is a more efficient way to change permissions (or at least it requires less typing), so use this method if it doesn‘t confuse you. Each type of permission is given an octal value. Read is given the value of 4, write is given the value of 2, and execute is given the value of 1. These values are added together for each user category. The permissions are changed by using a three-digit sequence with the first digit representing owner permission, the second digit representing group permission, and the third digit representing other permission. For example, if you wanted to make vvs.txt readable, writable, and executable for the user, readable and writable for the group, and readable for other, you would type: chmod 764 vvs.txt The first digit means readable and writable for the user (4+2+1), the second digit means readable and writable for the group (4+2+0), and the third digit means readable for other (4+0+0). if you want to change the permissions on a directory tree use the -R option. chmod –R will recursively change the permissions of directories and their contents. d) cp The cp command copies files or directories from one place to another. You can copy a set of files to another file, or copy one or more files under the same name in a directory. If the destination of the file you want to copy is an existing file, then the existing file is overwritten. If the destination is an existing directory, then the file is copied into that directory. 46 Lab Course Syntax: cp [options] file1 file2 If you want to copy the file favourites.html into the directory called laksh, you give the command as: cp favourites.html /vvs/laksh/ A handy option to use with cp is -r. This recursively copies a particular directory and all of its contents to the specified directory, so you won‘t have to copy one file at a time. e) date The date command can be used to display the date or to set a date. In unix the term date includes the time as well. Syntax: date [option] [+format] date [options] [string] The first structure shows how date can be used to display the current date. A certain format can be specified in which the date should be displayed. Check the Unix manual for specific formats and options. The second structure allows you to set the date by supplying a numeric string. Only privileged users will be able to use this second command structure. f) diff diff displays the lines that differ between two given files. Syntax: diff [options] [directory options] file1 file2 diff can be an extremely valuable tool for both checking errors and building new pages. If you run a diff between two files, you'll be shown what differences the files have line by line. The lines referring to file1 are marked with the < symbol. The lines referring to file2 are marked by the > symbol. If the file is a directory, diff will list .the file in the directory that has the same name as file2. If both of the files are directories, diff will list all the lines differing between all files that have the same name. If you have a file that is not working properly, it can be a great help to check it against a similar file that is working. It will often quickly alert you to a line of code that‘s missing. A handy option to use if you want to generally compare two files without noting the complex differences between them is the -h option (h stands for half-hearted). Using -i as an option will ignore differences in uppercase and lowercase characters between files, and -b will ignore repeating blanks and line breaks. 49 Operating System Syntax: kill [options] PIDs There are different levels of intensity to the kill command, and these can be represented either numerically or symbolically. kill -1 or HUP makes a request to the server to terminate the process, while kill -9 or kill KILL forces a process to terminate absolutely. Most politely, UNIX users will attempt to kill a process using-1 first before forcing a process to die. l) ls ls will list all the files in the current directory. If one or more files are given, ls will display the files contained within ―name‖ or list all the files with the same name as ―name‖. The files can be displayed in a variety of formats using various options. Syntax: ls [options] [names] ls is a command you'll end up using all the time. It simply stands for list. If you are in a directory and you want to know what files and directories are inside that directory, type ls. Sometimes the list of files is very long and it flies past your screen so quickly .You miss the file you want. To overcome this problem give the command as shown below: ls | more The character | (called pipe) is typed by using shift and the \ key. | more will show as many files as will fit on your screen, and then display a highlighted ―more‖ at the bottom. If you want to see the next screen, hit enter (for moving one line at a time) or the spacebar (to move a screen at a time). | more can be used anytime you wish to view the output of a command in this way. A useful option to use with ls command is -l. This will list the files and directories in a long format. This means it will display the permissions (see chmod), owners, group, size, date and time the file was last modified, and the filename. drwxrwxr-x vvs staff 512 Apr 5 09:34 sridhar.txt -rwx-rw-r-- vvs staff 4233 Apr 1 10:20 resume.txt -rwx-r--r-- vvs staff 4122 Apr 1 12:01 favourites.html There are several other options that can be used to modify the ls command, and many of these options can be combined. -a will list all files in a directory, including those files normally hidden. -F will flag filenames by putting / on directories, @ on symbolic links, and * on executable files. m) man The man command can be used to view information in the online Unix manual. 50 Lab Course Syntax: man [options] [[section] subjects] man searches for information about a file, command, or directory and then displays it on your screen. Each command is a subject in the manual. If no subject is specified, you must give either a keyword or a file. You can also search for commands that serve a similar purpose. For example, if you want more information about the chmod command, you should type: man chmod A screen will then appear with information about chmod. Type q to quit. n) mkdir mkdir creates a new directory. Syntax: mkdir [options] directory name For example, to create a directory called parkhyath in the present working directory, give the command as, mkdir prakhyath o) more more displays the contents of files on your screen. Syntax: more [options] [files] To have the next line displayed, hit the return key, otherwise press the spacebar to bring up the next screen. Press h for assistance with other commands, n to move to the next file, or q to quit. p) less less is similar to more in that it displays the contents of files on your screen. Unlike more, less allows backward and forward movement within the file. It does not read the whole file before displaying its contents, so with large files less displays faster than more. Press h for assistance with other commands or q to quit. Syntax: less [options] [files] q) mv mv moves files and directories. It can also be used to rename files or directories. Syntax: mv [options] source target If you wanted to rename vvs.txt to vsv.txt, you should give the command as: 51 Operating System mv vvs.txt vsv.txt After executing this command, vvs.txt would no longer exist, but a file with name vsv.txt would now exist with the same contents. r) passwd The passwd command creates or changes a user‘s password. Only the owner of the password or a privileged user can make these changes. Syntax: passwd [options] files s) pwd pwd prints the pathname of the current directory. If you wanted to know the path of the current directory you were in you give the command as pwd. You will get the complete path. t) rm rm removes or deletes a link to a file from a directory. If a file has more than one link then removing a link does not delete the file. But when the last link to a file is removed, the file gets deleted. A link is a name of a file. In unix a file can have many names. Syntax: rm [options] files In order to remove a file, you must have write permission to the directory where the file is located. While removing a which does‘t have write permission on, a prompt will come up asking you whether or not you wish to override the write protection. The -r option is very handy and very dangerous. -r can be used to remove a directory and all its contents. If you use the -i option, you can possibly catch some disastrous mistakes because it‘ll ask you to confirm whether you really want to remove a file before going ahead and doing it. u) rmdir rmdir allows you to remove or delete directories but not their contents. A directory must be empty in order to remove it using this command. Syntax: rmdir [options] directories If you wish to remove a directory and all its contents, you should use rm -r. 54 Lab Course To change the Date follow these steps: 1) Double-click on the clock on the task bar to open the dialog box. 2) To change the month, place the pointer on the month box and click with the mouse on the arrow to the right. A list with the months will be displayed. Select the appropriate month. 3) To change the year, place the pointer on the year box and with the arrows you can change the year. 4) To change the days select it on the calendar that appears. 5) Click Apply and OK To change the Time do the following: 1) Place the pointer on the clock. 2) To change the time select the time digits with the arrows to the right and adjust to the necessary time. 3) This same process must be done with the minutes and seconds. 2. To create a desktop shortcut for a default folder such as My Computer and My Document: . 3: To create a program desktop shortcut: 1. Click on the start button 2. Right click on My Computer or My Document on the right panel of the start menu 3. Click on "Show on Desktop" just like it shows on the picture 1. Click on the start button 2. Select "All Programs" 3. Select and right click the program you want place on the desktop 4. Select "Send To" from the displayed menu 5. Click on "Desktop (create shortcut)" 55 Operating System 4. Try it yourself 5. Click on the Start button and choose Control Panel Click on Add or Remove Programs option, a window will display with the three basic options shown on the left side of the picture as it appears below. Then click on Change or Remove Programs. 6. Click on the Start button and choose Search button and type Calculator /notepad / paint. It will open the respective application. Check Your Progress 4 1. Refer to the section 1.4.1 2. Try it your self Check Your Progress 5 Try exercise 1-8 yourself.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved