0% found this document useful (0 votes)
38 views

Experiment No

The document summarizes the basic UNIX commands that students should be familiar with. It discusses commands for changing directories (cd), viewing the current directory (pwd), listing files (ls), moving or renaming files (mv), copying files (cp), deleting files (rm), viewing file contents (cat, more, head, tail), counting words and characters (wc), creating directories (mkdir), deleting directories (rmdir), and viewing manual pages (man). It also provides examples of using each command. The conclusion compares Linux and Unix operating systems, and there are 7 questions asking about their differences, examples of each, how to create folders, what an operating system is, and advantages of Linux and Unix.

Uploaded by

Aditya Gharat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Experiment No

The document summarizes the basic UNIX commands that students should be familiar with. It discusses commands for changing directories (cd), viewing the current directory (pwd), listing files (ls), moving or renaming files (mv), copying files (cp), deleting files (rm), viewing file contents (cat, more, head, tail), counting words and characters (wc), creating directories (mkdir), deleting directories (rmdir), and viewing manual pages (man). It also provides examples of using each command. The conclusion compares Linux and Unix operating systems, and there are 7 questions asking about their differences, examples of each, how to create folders, what an operating system is, and advantages of Linux and Unix.

Uploaded by

Aditya Gharat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Experiment No:01

Name of Student : ADITYA MAHESH GHARAT

Roll NO: 37 Date of Performance :


Staff Signature : Marks :

Experiment Name: Study of basic UNIX commands.


Theory:
Basic commands
There are a number of Unix commands which the user should become familiar with from
the outset:

passwd :
This command allows you to change your login password. You are prompted to enter your
current

password, and then prompted (twice) to enter your new password.

cd
This command, as in DOS, changes directories. Example: cd maindir to move into the
maindir directory, cd ..to move to the directory above, or cd ~ to move to your root
directory.

pwd
This command tells you which directory you are currently working in.

ls
This gives you a listing of all files in a directory. You can't tell which are files and
which are directories.

mv
The "move" command is how you rename files. Example:
mv oldfile.txt newfile.txt

cp
Allows you to copy one or more files. Example: cp myfile.c backup.c

rm
Deletes a file. Example: rm janfiles.*

cat
Sends the contents of a file to stdout (usually the display screen). Example: cat index.html
more
Like cat but displays a file one page at a time. Example: more long_file.txt

wc
Counts the number of lines, words, and characters in a file. Example: wc essay.rtf

tail -n
Displays the last n lines of a file. Example: tail -5 myfile

head -n
Displays the first n lines of a file. Example: head -5 myfile

mkdir
Creates a new directory, located below the present directory. (Use pwd first to check where
you are!)

Example: mkdir new_dir

rmdir
Deletes a directory. Example: rmdir old_dir

man
The most important Unix command! It displays the manual pages for a chosen Unix
command. Example:

man ls

man -k
Displays all Unix commands related to a given keyword. Example: man -k date will list all
Unix commands

whose man pages contain a reference to the word date.

date
Shows the current time and date.

Conclusion :
The study of basic UNIX commands focuses on the differences between Linux and
Unix operating systems. Linux is a portable operating system that can be executed
on different hard drives, while Unix is mainly used in server systems, mainframes,
and high-end computers. Linux is developed by an active Linux Community
worldwide, while Unix is developed by AT&T Developers.
Questions:
1. Explain the difference between Linux and Unix ?

Linux Operating System Unix Operating System

The Source Code of Linux is freely available The Source Code of Unix is not available for
to its Users. the general public.

Linux OS is portable and can be executed in Unix is not portable.


different Hard Drives.

Linux is mainly used in Home Based PC, Unix is mainly used in Server Systems,
Mobile Phones, Desktops, etc. Mainframes and High End Computers.

Different Versions of Linux are: Ubuntu, Different Versions of Unix are: AIS, HP-UX,
Debian, OpenSuse, Redhat, Solaris, etc. BSD, Iris, etc.

Linux is developed by an active Linux Unix is developed by AT&T Developers.


Community worldwide.

2. Give examples of Linux os and Unix os?


Examples of Linux OS:
● Ubuntu:- Ubuntu is a popular and user-friendly Linux distribution.
● Fedora:- Fedora is a community-supported Linux distribution
sponsored by Red Hat.
● Debian:- Debian is known for its stability and is the foundation for
several other Linux distributions.
● Arch Linux:- Arch Linux is a rolling-release distribution with a focus
on simplicity and customization.
● openSUSE:- openSUSE is a Linux distribution developed by the
openSUSE Project.

Examples of Unix OS :
● AIX (IBM AIX):- AIX is IBM's proprietary Unix operating system for
their Power Systems architecture.
● Solaris (Oracle Solaris):- Solaris is a Unix operating system originally
developed by Sun Microsystems, now owned by Oracle.
● HP-UX (Hewlett Packard Unix):- HP-UX is Hewlett Packard's Unix
operating system for their HP 9000 series of servers.

3. How to create a folder on a desktop?


Step 1: Right-click a blank spot on your desktop.
Step 2: Move your cursor to New in the menu and pick Folder in the pop-out menu
Step 3: When you see the folder appear, the default name “New folder” is
automatically selected so that you can just enter a name of your own.
Type the name, press Enter, and your folder is ready to go.
Step 4: Alternatively, you can create a desktop folder from File Explorer or with a
keyboard shortcut.
● Open File Explorer, select Desktop on the left, and pick the New folder in the
ribbon on the Home tab.
● Use the keyboard shortcut Ctrl + Shift + N to create a new desktop folder.
Step 5: Name the folder, press Enter, and you’ll see the new folder on your desktop
in the next open spot.

4. What is an operating system?


An operating system (OS) is the program that, after being initially loaded into the
computer by a boot program, manages all of the other application programs in a
computer. The application programs make use of the operating system by making
requests for services through a defined application program interface (API). In
addition, users can interact directly with the operating system through a user
interface, such as a command-line interface (CLI) or a graphical UI (GUI).

5. Give five advantages of Linux?

● Open Source :- As it is open-source, its source code is easily available.


Anyone having programming knowledge can customise the operating
system. One can contribute, modify, distribute, and enhance the code for any
purpose.
● Security:- The Linux security feature is the main reason that it is the most
favourable option for developers. It is not completely safe, but it is less
vulnerable than others. Each application needs to be authorised by the admin
user.
● Free:- Certainly, the biggest advantage of the Linux system is that it is free to
use. We can easily download it, and there is no need to buy the licence for it.
It is distributed under GNU GPL (General Public License). Comparatively, we
have to pay a huge amount for the licence of the other operating systems.
● Lightweight:- Linux is lightweight. The requirements for running Linux are
much less than other operating systems. In Linux, the memory footprint and
disk space are also lower. Generally, most of the Linux distributions required
as little as 128MB of RAM, around the same amount for disk space.
● Multiuser and Multitasking:- Linux is designed to support multiple users
concurrently, allowing multiple users to log in and use the system
simultaneously. It also excels at multitasking, efficiently managing system
resources to run multiple processes simultaneously.

6. Give five advantages of Unix?


● Ecommerce:- Many big online stores use UNIX or Linux servers to host their
websites. UNIX has also been used to manage mobiles and electronic
machines.
● Portable:- As UNIX is made from using C language so it is a highly portable
OS. You can use this OS on any PC or MAC computers. C is a very popular
language and most programmers can work easily in this language. You can
communicate with hardware by using the C language.
● Memory usage:- UNIX uses less memory while running sophisticated
programs. UNIX OS can handle virtual memory nicely. The virtual memory
expands as more programs come into the main memory. Most of the tasks in
UNIX are done by using fewer resources.
● Less code to execute:- In GUI (graphical user interface), we sometimes need
many mouse clicks to perform some specific task but in the case of UNIX we
can simply write one command in CLI (command line interface) and that task
is done.
● Files used everywhere:- All types of data is stored in files i.e. all devices and
terminals are stored in files. Working with files in the OS becomes fast and
can be easily managed by UNIX.

7. What is the use of the CP command?


The cp command in Unix-like operating systems is used to copy files and directories
from one location to another. It stands for "copy" and is a basic and commonly used
command for file manipulation. The general syntax of the cp command is as follows:
cp [options] source…. Destination

You might also like