OS Zuriel
OS Zuriel
- The Unix operating system is a set of programs that act as a link between the computer and
the user.
-The computer programs that allocate the system resources and coordinate all the details of the
computer's internals is called the operating system or the kernel.
-Users communicate with the kernel through a program known as the shell. The shell is a command
line interpreter; it translates commands entered by the user and converts them into a language that
is understood by the kernel.
- Kernel − The kernel is the heart of the operating system. It interacts with the hardware and most
of the tasks like memory management, task scheduling and file management.
-Shell − The shell is the utility that processes your requests. When you type in a command at your
terminal, the shell interprets the command and calls the program that you want. The shell uses
standard syntax for all commands. C Shell, Bourne Shell and Korn Shell are the most famous shells
which are available with most of the Unix variants.
-Commands and Utilities − There are various commands and utilities which you can make use of in
your day to day activities. cp, mv, cat and grep, etc. are few examples of commands and utilities.
There are over 250 standard commands plus numerous others provided through 3rd party software.
All the commands come along with various options.
-Files and Directories − All the data of Unix is organized into files. All files are then organized into
directories. These directories are further organized into a tree-like structure called the filesystem.
- Unix, the predecessor to Linux, is a powerful and influential operating system renowned for its
scalability, reliability, and robustness. Developed in the late 1960s at Bell Labs, Unix introduced key
concepts like the shell, file system hierarchy, and multitasking, shaping modern computing
paradigms. Unix systems are widely used in enterprise environments, powering servers,
workstations, and critical infrastructure across various industries. With its modular design,
extensive documentation, and adherence to standards, Unix continues to serve as a cornerstone
for innovation in operating system development and remains relevant in today's computing
landscape.
- Open source refers to software whose original source code is made freely available and can be
redistributed and modified by anyone. This open approach fosters collaboration, innovation, and
transparency within the development community. Users can access, modify, and contribute to the
software, leading to rapid improvements and customization tailored to specific needs. Open
source projects often operate under licenses that ensure the continued openness and availability
of the code for everyone to use and benefit from.
1|Page
Operating System (3140702) 220760107084
-Open source refers to software that is freely accessible, modifiable, and redistributable. Key points
include:
- Benefits: Open-source software allows for rapid bug fixing, threat recognition, and solution due
to community involvement.
Mkdir
grep
ls
rmdir
mv
rm
tail
touch
cat
locate
uname
head command
2|Page
Operating System (3140702) 220760107084
3|Page
Operating System (3140702) 220760107084
UNIX COMMAND:
cd (Change Directory) Command :
-The cd command is used to change the current directory.
-Syntax : cd [-Options] [Directory]
Option Use
cd .. Change Current directory to parent directory
cd ~ Move to users home directory from anywhere
cd lab_1 Change from current working directory to lab_1
cd ../downloads If we are currently in
/home/username/documents then we would
be placed in /home/username/downloads.
ls Command:
-List directory contents.
-Syntax : ls[Options][file|dir]
4|Page
Operating System (3140702) 220760107084
1 ls -l:
2 ls -a:
-List all files including hidden file starting with '.’
3 ls -r:
-List in reverse order
4 ls -t:
-Sort by time & date
5|Page
Operating System (3140702) 220760107084
6|Page
Operating System (3140702) 220760107084
man Command:
-It is the interface used to view the system's reference manuals.
- Syntax : man [command name]
echo Command:
- Display a line of text/string on standard output or a file.
- Syntax : echo [option] [string]
Option Use
echo -n Do not output a trailing newline
echo -e Enable interpretation of backslash escape
sequences
cal Command:
-Displays a simple, formatted calendar in your terminal.
-Syntax : cal [options] [[[day] month] year]
Option Use
cal -1 Display single month output. (This is the
default.)
cal -3 Display three months spanning the date.
cal -s Display Sunday as the first day of the week.
cal -m Display Monday as the first day of
the week.
7|Page
Operating System (3140702) 220760107084
date Command:
-Print or set the system date and time.
Syntax : date [OPTION]... [+FORMAT]
8|Page
Operating System (3140702) 220760107084
Option Use
date +%a The abbreviated weekday name
date +%A The full weekday name
date +%b The abbreviated month name
date +%B Locale's full month name
date +%C The current century; like %Y, except omit last
two digits
date +%w day of week (0..6);
date +%d Display the day of the month
date +%m Displays the month of year (01 to 12)
date +%y Displays last two digits of the year(00 to 99)
date +%Y Display four-digit year.
date +%T Display the time in 24 hour format as
HH:MM:SS
date +%H Display the hour
date +%M Display the minute
date +%S Display the seconds
date +%V ISO week number, with Monday as first day of
week
date +%P locale's equivalent of either AM or PM 26
date Command
clear Command:
- Clear the terminal screen.
- Syntax : clear
9|Page
Operating System (3140702) 220760107084
cat Command:
-It is used to create, display and concatenate file contents.
-Syntax : cat [OPTION] [FILE]
Option Use
cat -b Omits line numbers for blank space in the
output
cat -E Displays a $ (dollar sign) at the end of each
line
cat -n Line numbers for all the output lines
cat -s Suppress repeated empty output lines
cat -T Displays the tab characters as ^I in the output.
who Command :
- It display the users that are currently logged into your Unix computer system.
- Syntax : who [-options] [filename]
Option Use
who -b Display the time of the last system boot
who -H Print a line of column headings
who -q Displays all login names, and a count of
all logged-on users
who -a Display all details of current logged in user
10 | P a g e
Operating System (3140702) 220760107084
whoami Command:
-This command prints the username associated with the current effective user ID.
-Syntax : whoami [-OPTION]
Option Use
whoami --help Display a help message, and exit
whoami --version Display version information, and exit
11 | P a g e
Operating System (3140702) 220760107084
passwd Command:
-The passwd command is used to change the password of a user account.
-Syntax : passwd [-options] [username]
mkdir Command:
-This command is used to make Directories.
- Syntax : mkdir [-OPTION] DIRECTORY
Option Use
mkdir -v Print a message for each created directory
mkdir -p No error if existing, make parent directories
as needed
mkdir -m To control the permissions of new
directories 6
12 | P a g e
Operating System (3140702) 220760107084
rmdir Command:
- This command removes empty directories from your filesystem.
- Syntax : rmdir [-OPTION] DIRECTORY
- rmdir -p Remove directory and its ancestors… e.g., ‘rmdir -p a/b/c’ is similar to ‘rmdir a/b/c a/b
a’
cp(copy) Command:
- This command is used to copy files and directories.
- Syntax : cp [option] source destination/directory
Option Use
cp -i Interactive - ask before overwrite
cp -f Force copy by removing the destination file
if needed
cp -n Do not overwrite an existing file
cp -u Update - copy when source is newer than
destination
cp -s Make symbolic links instead of copying
cp -R Copy directories recursively
cp -v Print informative messages
13 | P a g e
Operating System (3140702) 220760107084
mv(move) Command:
- mv command is used to move files and directories.
Option Use
mv -i Interactive prompt before overwrite
mv -f Force move by overwriting destination file
without prompt
mv -n Never overwrite any existing file
mv -u Update - move when source is newer than
destination
mv -v Print informative messages
rm(remove) Command:
-The ‘rm’ command is used to delete files and directories.
- Syntax : rm [-OPTION] Filename
Option Use
rm -i Prompt before every removal
rm -d Delete a empty directory
rm -r Remove directories and their
contents recursively
rm -f To remove the file forcefully
14 | P a g e
Operating System (3140702) 220760107084
cut Command:
-The cut command extracts a given number of characters or columns from a file
- Syntax : cut [-options] [file]
Option Use
cut -c Select only the characters from each line as
specified in LIST
cut -b Select only the bytes from each line as
specified in LIST
cut -f Cuts the input file using list of field. The
default field to be used TAB. The default
behavior can be overwritten by use of -
d
option
cut -d Specifies a delimiter to by used as a field.
Default field is TAB and this option
overwrites this default behavior 7
paste Command:
- The paste command displays the corresponding lines of multiple files side-by-side.
- Syntax : paste [-options] [file]
- paste -d :Reuse characters from LIST instead of tabs
- paste -s: Paste one file at a time instead of in parallel
15 | P a g e
Operating System (3140702) 220760107084
more Command:
-The more command is a command line utility for viewing the contents of a file or files once
screen at a time.
- Syntax : more [-options] [file]
Option Use
more -c Clear screen before displaying
more -number To Specify how many lines are printed in the
screen for a given file
more -s Doesn’t display extra blank lines 8
16 | P a g e
Operating System (3140702) 220760107084
cmp Command:
- cmp [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]
Option Use
cmp -b Print differing bytes
cmp -i Skip a particular number of initial bytes from
both the files
cmp -s Do not print anything; only return an exit
status indicating whether the files differ
cmp -n Compare at most LIMIT bytes
cmp -l Print byte position and byte value for all
differing bytes 8
comm Command:
- Compare two sorted files line by line.
- Syntax : comm [OPTION]... FILE1 FILE2
- comm -1 :Suppress column 1 (lines unique to FILE1)
- comm -2 Suppress column 2 (lines unique to FILE2)
- comm -3 Suppress column 3 (lines that appear in both files)
17 | P a g e
Operating System (3140702) 220760107084
diff(difference) Command:
- This command is used to display the differences in the files by comparing the files line
by line
- Syntax : diff [options] File1 File2
- diff -b :Ignores spacing differences
- diff -i :Ignores case
18 | P a g e
Operating System (3140702) 220760107084
19 | P a g e
Operating System (3140702) 220760107084
file Command:
- The file command is used to determine a file's type.
- Syntax : file [OPTIONS] file1 file2 …
finger Command
- finger looks up and displays information about system users.
- Syntax : finger [-option] [username]
- finger -m :Match arguments only on user name (not first or last name)
- finger -l :Force long output format
sleep Command:
- The sleep command is used to delay for a specified amount of time.
- Syntax : sleep NUMBER[SUFFIX]...
20 | P a g e
Operating System (3140702) 220760107084
21 | P a g e
Operating System (3140702) 220760107084
ps Command:
- Reports a snapshot of the status of currently running processes.
- Syntax : ps [option]
Option Use
ps -e Display every active process on a
Linux system in generic (Unix/Linux)
format
ps -x View all processes owned by you
ps -f To provide more information on processes
ps -u Filter processes by its user 11
22 | P a g e
Operating System (3140702) 220760107084
kill Command:
- It is used to terminate processes manually.
- Syntax : kill [option] PID
- Kill -l To display all the available signals
wc Command:
- It s used to find out number of newline count, word count, byte and characters count in
a files specified by the file arguments.
- Syntax : wc [options] filenames
Option Use
wc -l Prints the number of lines in a file
wc -w Prints the number of words in a file
wc -c Displays the count of bytes in a file
wc -L Prints only the length of the longest line in a file
23 | P a g e
Operating System (3140702) 220760107084
ln Command:
- ln creates links between files.
- Syntax : ln [OPTION]… [-T] TARGET LINK_NAME
Option Use
ln -f If the destination file or files already exist,
overwrite them
ln -i Prompt the user before
overwriting destination files
ln -s Make symbolic links instead of hard links
24 | P a g e
Operating System (3140702) 220760107084
nl Command:
- nl command numbers the lines in a file.
Syntax : nl [OPTION]... [FILE]...
Option Use
nl -i Line number increment at each line
nl -s Add STRING after (possible) line number
nl -w Use NUMBER columns for line numbers 12
head Command:
- head makes it easy to output the first part (10 lines by default) of files.
- Syntax : head [OPTION]... [FILE]...
- head -n :Print the first n lines instead of the first 10; with the leading '-', print all but the
last n lines of each file
- head -c: Print the first n bytes of each file; with a leading '-', print all but the last n bytes
of each file
-head -q: Never print headers identifying file names .
25 | P a g e
Operating System (3140702) 220760107084
tail Command:
- tail is a command which prints the last few number of lines (10 lines by default) of a
certain file, then terminates.
- Syntax : tail [OPTION]... [FILE]...
Option Use
tail -n Output the last num lines, instead of the
default (10)
tail -c Output the last num bytes of each file
tail -q Never output headers
26 | P a g e
Operating System (3140702) 220760107084
sort Command:
- sort command is used to sort a file, arranging the records in a particular order
- Syntax : sort [OPTION]... [FILE]...
Option Use
sort -c To check if the file given is already sorted or
not
sort -r Reverse the result of comparisons
sort -n Compare according to string numerical value
sort -nr To sort a file with numeric data in reverse
order
sort -k Sorting a table on the basis of any column
sort -b Ignore leading blanks
27 | P a g e
Operating System (3140702) 220760107084
28 | P a g e
Operating System (3140702) 220760107084
tr(translate) Command:
- tr stands for translate.
-Syntax : tr [OPTION] SET1 [SET2]
- tr -s: Replaces repeated characters listed in the set1 with single occurrence
-tr -d :Delete characters in string1 from the input
-tr -c: complements the set of characters in string. i.e., operations apply to characters not in
the given set
-tr -cd: Remove all characters except digits
history Command:
- history command is used to view the previously executed command.
- Syntax : history
29 | P a g e
Operating System (3140702) 220760107084
30 | P a g e
Operating System (3140702) 220760107084
write Command:
- write sends a message to another user.
- Syntax : write user [ttyname]
Option Use
user The user to write to
tty The specific terminal to write to, if the user
is logged in to more than one session
find Command:
-find command searches for files in a directory hierarchy.
-Syntax : find [option] [path...] [expression]
Option Use
find -name filename Search for files that are specified by
‘filename’
find -newer filename Search for files that were modified/created
after ‘filename’
find -user name Search for files owned by user name or ID
‘name’
find -size +N/-N Search for files of ‘N’ blocks; ‘N’ followed by
‘c’ can be used to measure size in characters
find -empty Search for empty files and directories ‘
find -perm octal Search for the file if permission is ‘octal’
31 | P a g e
Operating System (3140702) 220760107084
32 | P a g e
Operating System (3140702) 220760107084
uniq Command :
-uniq -u Prints only unique lines
-uniq -d Only print duplicated lines
33 | P a g e
Operating System (3140702) 220760107084
34 | P a g e