Pra1
Pra1
Practical:- 1
Linux architecture
Feature:
- Multiuser support: UNIX allows multiple users to simultaneously access the same
system and share resources.
- Multitasking: UNIX is capable of running multiple processes at the same time.
- Security: UNIX has a robust security model that includes file permissions, user
accounts, and network security features.
- Portability: UNIX can run on a wide variety of hardware platforms, from small
embedded systems to large mainframe computers.
Page | 1
Operating System [3140702] 240763107002
Commands:-
1. cd:- Change Directory
Usage:- The cd command is used to change the current directory.
Options:-
Options:-
- -i: It known as inode which displays the index number (inode) of each file and directory.
3. man:
Usage:- Print entries from the on-line reference manuals; find manual entries by
keyword.
Page | 2
Operating System [3140702] 240763107002
4. echo:
Usage:- Displays message, as well as evaluates variables.
Options:-
5. cal:- Calendar
Usage:- Display Calendar
Page | 3
Operating System [3140702] 240763107002
Options:-
- cal -j: Shows the calendar of the current month in the Julian calendar format not in the
default Gregorian calendar format.
6. date:
Usage:- Displays current date and time.
Options:-
Page | 4
Operating System [3140702] 240763107002
7. clear:
Usage:- command to clear the terminal in Linux.
8. cat:
Usage:- Displays file contents, creates new file, or appends data to an existing file.
Options:-
- cat -e: This command shows end-of-line characters ($) at the end of each line.
- cat file_name1 >> file_name2: If you want to add the content of one file to another,
‘cat’ can be used along with the append (>>) operator.
- cat -n: This command is used to displays the contents of a file with line numbers.
Page | 5
Operating System [3140702] 240763107002
Options:-
- -L: This command shows the current working directory as a logical path.
- -P: This command shows the current working directory as a physical path.
10. who:
Usage:- Displays Login name of the users, Terminal line numbers, Login time of
the users into the system, The remote host name of the user.
Options:-
11. whoami:
Usage:- Displays user of the current shell only.
Page | 6
Operating System [3140702] 240763107002
12. uname:
Usage:- This command in Linux displays system information.
Options:-
13. passwd:
Usage:- It is used to change a user's password.
Syntax:- passwd [-options] [username]
Options:-
Page | 7
Operating System [3140702] 240763107002
Options:-
Options:-
Page | 8
Operating System [3140702] 240763107002
Options:-
Options:-
Page | 9
Operating System [3140702] 240763107002
19. cut:
Usage:- cut a file vertically. Extract specific columns or fields from an input file.
Options:-
- cut -f: cut by field with space as a field separator or delimiter option.
20. paste:
Usage:- It allows users to merge multiple files or lines of text into a single output.
Options:-
- paste -d: This option specifies a delimiter to combine lines from files.
Page | 10
Operating System [3140702] 240763107002
Options:-
22. ln:
Usage:- It creates symbolic links between files.
Options:-
Page | 11
Operating System [3140702] 240763107002
- -i: This command prompts for confirmation before overwriting an existing file or link.
23. nl:
Usage:- The is used to add line numbers to the contents of a file or input.
Options:-
- -s: It allows you to specify a separator between the line number and the content of the
line.
- -d: numbers the lines in the input, and writes the numbered lines to standard output.
- -i: It allows you to set the increment for the line numbers.
Page | 12
Operating System [3140702] 240763107002
24. head:
Usage:- Display top of the line. default, it display first 10 lines of file.
Options:-
- -c: Prints the first ‘num’ bytes from the file specified.
- -v: data from the specified file is always preceded by its file name.
25. tail:
Usage:- Display end of the line. default, it display last 10 lines of file.
Options:-
- -c: Prints the last ‘num’ bytes from the file specified.
Page | 13
Operating System [3140702] 240763107002
- -q: This command hides the file names when showing the last part of multiple files.
Page | 14