linuxpdf
linuxpdf
(Approved by AICTE, New Delhi and Affiliated to Rajasthan Technical University, Kota (Raj.))
DABOK, UDAIPUR, RAJASTHAN 313022
4CS4-24
Date of
Date of
S.NO Experiment Name Submissio Signature
issue
n
1 Use of Basic Unix Shell Commands: ls, mkdir, rmdir, cd, cat, touch,
file, wc, sort, cut, grep.
1. Use of Basic Unix Shell Commands: ls, mkdir, rmdir, cd, cat, banner, touch, file, wc, sort, cut,
grep, dd, dfspace, du, ulimit.
2. Commands related to inode, I/O redirection and piping, process control commands, mails.
6. banner : command in linux is used to print the ASCII character string in large letter to standrad output.
Syntax - $banner ASCII value
Output:-
7. touch : command is a standard command used in unix/linux operating system which is used to create,
change and modify timestamps of a file.
touch command: It is used to create a file without any content. The file created using touch command
is empty. This command can be used when the user doesn’t have data to store at the time of file creation.
Syntax - $touch file_name
Output:-
8. du : used disk space (du - stands for disk usage)
This command is used to show the amount of disk space consumed by one or more files or directory (or
directory trees.
Syntax - $du
Output:-
10. wc : Print byte, word, and line counts, count the no. of bytes, whitespace- separated words,
and newlines in each given FILE
Syntax - $wc [options] [File]
Options
--bytes
-c Print only the byte counts.
--chars
-w --words Print only the word counts.
-l --lines Print only the newline counts.
Output:-
11. grep : search for a string or word in a file
Syntax - $grep option filename
Output:-
Basically the cut command slices a line and extracts the text. It is necessary to specify option with command
otherwise it gives error. If more than one file name is provided then data from each file is not precedes by its
file name.
Syntax - $cut [option] [file]
Output:-
35. head : the head command to print the first few entries of a file.
Syntax - $head filename
36. tail : tail command is the opposite of head, allowing you to print the last few lines from files or another
utility’s output.
Syntax - $tail filename
Output:-
37. pipe : a pipe (represented by the | symbol) is a powerful tool that allows you to connect the output of one
command to the input of another, creating a chain of commands for efficient data processing.
Syntax - command | command
Output:-
43. top : command displays all running processes in your system and their hardware consumption
Syntax - $top [option]
Output:-
44. ip : shutdown command lets you turn off or restart your Linux system at a specific time
Syntax - $ip [option] [time] [message]
Output:-
46. nslookup : command requests a domain name system (DNS) server to check a domain linked to an IP
address or vice versa
Syntax - $nslookup [options] domain-or-ip [dns-server]
Output:-
EXPERIMENT No:- 3
control structure
------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Q 3.4: Write a shell script to check whether a character is alphabet, digit or special character.
solution :-
echo "enter a char"
read c
------------------------------------------------------------------------------------------------------------------------------------------------------------------
DON’TS
Don’t mishandle the system.
Don’t leave the system on standing for long
Don’t bring any external material in the lab.
Don’t make noise in the lab.
Don’t bring the mobile in the lab.
Don’t enter in the lab without permission of lecturer/laboratory technician immediately
Don’t delete or make any modification in system files.
Don’t bring storage devices like pen drive without permission of lecturer/laboratory
technician.