fpga_exp1 thiru

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

EXP NO:1 STUDY OF LINUX COMMANDS

DATE:
AIM:
To study the LINUX Commands and the task performed by the
commands.
THEORY:
Linux software offers versatility across a wide range of applications,
including development, VLSI design, system administration, office productivity,
media editing, scientific computing, security, gaming, virtualization, and web
browsing. Notable tools in the Linux ecosystem are Git, GIMP, Docker,
LibreOffice, and VirtualBox. Linux is highly valued for its stability, flexibility,
and robust support from the open-source community for both professional and
personal use.
In the realm of VLSI design, Linux supports various tools for design,
simulation, and synthesis. Popular choices include Yosys for synthesis, GHDL
for VHDL simulation, and Magic for layout design.
1. ls
The `ls` command in Linux is used to list the contents of directories, displaying
information about files and directories along with their attributes. It provides a
valuable overview of the files and directories within a specified directory.
Syntax: ls [option] [file/directory]
Output: It lists the files and directories within the home directory.
1.1. ls -al

Output: It displays detailed information about the directory, including hidden


files, in a long format.
1.2. ls- 1

Output: It shows one file or directory per line.


1.3. ls -a

Output: It shows all files and directories, including hidden ones, in the current
directory.
1.4. ls -ld

Output: It presents detailed information about the directory in a long format.


2. cd
The `cd` command enables users to change their current working directory
within the file system. The basic syntax of the `cd` command is:
Syntax: cd [directory]
Output: To navigate into a subdirectory within the Home directory, use the `cd`
Linux command, replacing `[directory name]` with the name of the directory
you wish to enter.
2.1. cd..

Output: This command allows you to move to the directory that was your
previous working directory.
2.2. cd ~

Output: This command allows the user to move from any directory to the home
directory in Linux.
3. touch
The `touch` command is used to create an empty file without any content. It is
useful when the user needs to create a file but does not have any data to store at
the time of creation.
Output: A file named ` thiru.txt ` has been created, and it is currently empty.
4. mkdir
In Linux, the `mkdir` command is used to easily create folders. Short for "make
directory," this command helps you organize your files by creating new
directories with a single command.
Syntax: mkdir [options...] [directory_name]

Output: A directory named ` thiru ` has been created in the Linux file system.
5. rmdir
The `rmdir` command in Linux is designed specifically for removing empty
directories. It is a simple yet essential tool for keeping your directory structure
organized. The command checks whether a directory is empty before deleting it,
ensuring that only empty directories are removed and helping to prevent
accidental data loss.
Syntax: rmdir [option] directory name

Output: A directory named `aa` has been removed in the Linux file system.
6. rm
The `rm` command stands for "remove" and is used to delete objects such as
files, directories, and symbolic links from the file system in Unix-like systems.
More specifically, `rm` removes references to these objects from the filesystem,
even if there are multiple references to the same object (for example, a file with
different names).
Syntax: rm [OPTION]... FILE...

Output: A file named `aaaa` has been permanently deleted using the `rm`
command.
7. gedit
The `gedit` command in Linux is a versatile text editor that allows you to open
and edit multiple files simultaneously. It supports various encodings and offers
both terminal and GUI integration, making it a flexible and user-friendly tool
for managing text files.
Syntax: gedit filename.txt

Output: A file named `thiru1.txt` has been created and opened in a text editor
tool.
8. nano
Nano is a command-line text editor that is pre-installed with most Linux
distributions. It features a user-friendly interface similar to popular graphical
text editors and offers essential editing capabilities. Nano is well-suited for
quick edits, creating configuration files, and writing scripts directly from the
terminal.
Syntax: nano new filename

Output: It creates a file named `thiru3.txt` and opens the editor directly in the
command line.
9. mv
The `mv` command stands for "move." As its name implies, it is used to rename
files and directories or to move files from one location to another within the file
system.
mv [source_file_name(s)] [Destination_file_name]

Output: A file named thiru2.txt has been renamed to a file named renamed.
10. cat
The most basic use of ‘cat’ is to display the contents of a file on the terminal.
This can be achieved by simply providing the filename as an argument.
Syntax: cat filename

Output: The content of the file `thiru3.txt` has been displayed in the terminal.
11.tac
The most basic use of ‘tac’ is to display the contents file with reverse order on
the terminal. This can be achieved by simply providing the filename as an
argument.

Output: The content of the file `thiru3.txt` has been displayed in the terminal.
12. pwd
The `pwd` command outputs the full path name of your current directory,
starting from the root directory. All directories in the path are separated by a
slash (`/`).
Syntax: pwd
Output: It displays the current working directory, providing the full path
starting from the root directory.

13. clear
It clears the content from the command terminal.
Syntax: clear

14. ln
The `ln` command creates a link from the file specified as the source to the file
or directory designated as the target. By default, `ln` creates hard links. If you
specify a different directory as the target, it creates a hard link with the same file
name in that directory.
Syntax: ln [OPTION]... [-T] TARGET LINK_NAME
Output: The file `thiru` is linked to `thiru12`. Any changes made to `thiru` will
be reflected in `thiru12` as well.
15. sort
The `sort` command is used to arrange the contents of a file in a specified order.
By default, it sorts the file based on ASCII values. You can also use options with
the `sort` command to sort the contents numerically.
Syntax: sort filename
Output: It sorts the contents of the file in ascending order, line by line. The
`sort -r` command sorts the contents in descending order.

16. diff
This command is used to display the differences between files by comparing
them line by line.
Syntax: diff file_name1 file_name2
Output: It displays the differences between the renamed file and the thiru1.
17. ps
The ps command in Linux is a powerful tool that allows you to view
information about the processes running on your Linux system. It stands for
“process status” and it's a command that you can use from the command line to
get information about the currently running processes.
18. du
The `du` command in Linux is a useful tool for analysing and reporting disk
usage within directories and files.
Syntax : du [options] [directory/file]

Output: The command `du *` shows the amount of storage used by the
directories and files in the current working directory.

20. basename
The `base name` command can be used easily by typing `base name` followed
by the file name or full pathname.
Syntax: basename NAME [SUFFIX]
Output: It shows the base name of the directory or file from the specified path.
21. head
The `head` command prints the first N lines of the given input. By default, it
displays the first 10 lines of the specified files.
Syntax head[options] filename
ji

Output: It prints first 10 lines from the file.

22. tail
The ` tail` command prints the last 10 lines of the specified files.
Syntax tail [options] filename -r
Output: It prints last ‘5’ lines from the file because I mentioned -5.

23. chmod
The `chmod` command is used to change the access mode of a file or directory,
with "chmod" being an abbreviation for "change mode." Each file and directory
has a set of permissions that control who can read, write, or execute the file.
These permissions are categorized into three types: read (`r`), write (`w`), and
execute (`x`). These letters are combined to define specific permissions for
different user groups.
Syntax: chmod [options] [mode] [File_name]
`
Output: The first command removes read, write, and execute permissions for
all users from the directory `a2`, while the second command grants read, write,
and execute permissions to all users for the directory `a2`.

RESULT:
Thus, the commands in LINUX and various tasks performed by the
commands are hence studied.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy