0% found this document useful (0 votes)
9 views4 pages

Day1 EXPERIMENT

Uploaded by

lite66688
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)
9 views4 pages

Day1 EXPERIMENT

Uploaded by

lite66688
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/ 4

EXPERIMENT – 1

AIM:To study the Execution of various file/directory handling commands.


THEORY:

The Linux file system is the structure in which all the information on your computer
is stored. Files are organized within a hierarchy of directories. Each directory can
contain files, as well as other directories.

If you were to map out the files and directories in Linux, it would look like an upside-
down tree. At the top is the root directory, which is represented by a single slash
( / ). Below that is a set of common directories in the Linux system, such as bin,
dev, home, lib , and tmp , to name a few. Each of those directories, as well as
directories added to the root, can contain subdirectories.

Some of the Linux directories that may interest you include the following:
● /bin - Contains common Linux user commands, such as ls, sort , date , and
chmod .

● /boot - Has the bootable Linux kernel and boot loader configuration files
(GRUB).

● /dev - Contains files representing access points to devices on your systems.


These include terminal devices ( tty* ), floppy disks ( fd* ), hard disks ( hd*
or sc* ), RAM (
ram* ), and CD-ROM ( cd* ). (Applications normally access these devices
directly through the device files, but end users rarely access them
directly.)
● /etc - Contains administrative configuration files.

● /home - Contains directories assigned to each user with a login account.

● /media - Provides a location for mounting devices, such as remote file


systems and removable media (with directory names of cdrom , floppy , and
so on). In Fedora and RHEL, many removable media are mounted
automatically in this directory when the media is inserted (CD or DVD) or
connected (USB pen drives or cameras ).

● /proc - Provides a mechanism for the kernel to send information to processes.

● /root - Represents the root user's home directory.

● /sbin - Contains administrative commands and daemon processes.

● /sys - A /proc -like file system, added with the Linux 2.6 kernel and intended
to contain files for getting hardware status and reflecting the system's device
tree as it is seen by the kernel. It pulls many of its functions from /proc .
● /tmp - Contains temporary files used by applications.

● /usr - Contains user documentation, games , graphical files (X11), libraries


(lib), and a variety of other user and administrative commands and files.
● /var - Contains directories of data used by various applications. In particular,
this is where you would place files that you share as an FTP server (
/var/ftp ) or a Web server ( /var/www ). It also contains all system log files
( /var/log ). In time, FTP, HTTP, and similar services will move to the /srv
directory to adhere to the Linux Standards Base (
www.freestandards.org/spec ).

COMMAND :

1.Date Command :

This command is used to display the current data and time.


Syntax :

$date
$date +%ch
Options :
a = Abbrevated weekday. A
= Full weekday.
b = Abbrevated month. B
= Full month.
c = Current day and time.
C = Display the century as a decimal number.
d = Day of the month.
D = Day in „mm/dd/yy‟ format
h = Abbrevated month day. H
= Display the hour.
L = Day of the year. m =
Month of the year. M =
Minute.
P = Display AM or PM S
= Seconds
T = HH:MM:SS format u
= Week of the year.
y = Display the year in 2 digit. Y
= Display the full year.
Z = Time zone .

To change the format :


Syntax :
$date „+%H-%M-%S‟

2.Calender Command :

This command is used to display the calendar of the year or the particular month of
calendar year.

Syntax :
a.$cal <year>
b.$cal <month> <year>

Here the first syntax gives the entire calendar for given year & the second Syntax gives
the calendar of reserved month of that year.
3.Echo Command :

This command is used to print the arguments on the screen .


Syntax : $echo <text>
4.Banner Command :

It is used to display the arguments in „#‟ symbol .

Syntax :$banner <arguments>

You might also like