Linux Mint Lab
Linux Mint Lab
TECHNOLOGY
Department of Computer Science & Engineering
Lab Report
BATCH: 8(R)
SEMESTER: Fall-2023
2. Version: 7.0.10
4. Download the latest version of Linux Mint’s ISO file from its website
(https://www.linuxmint.com/download.php).
5. Open Virtual Box. Virtual Box is up & running now ready to started.
Click the New button, then set
• Name: LinuxMint
• Folder: C:\Users\Naim\VirtualBox\Ms
• ISO Image: select the LinuxMint iso file
• Then click Next
• Base Memory: Select at least required selected
• MB Processor: 6, checked Enable EFI
• Then click next
• Select Create a Virtual Hard Drive now and set the Hard Drive size
128GB.
• Then click Next
pwd Command:
The pwd command is used to display the location of the current working
directory.
Syntax: $ pwd
Output:
mkdir Command:
The mkdir command is used to create a new directory under any directory.
Syntax:
$ mkdir <directory name>
Output:
rmdir Command:
The rmdir command is used to delete a directory.
Syntax:
$ rmdir <directory name>
Output:
ls Command:
The ls command is used to display a list of content of a directory.
Syntax: $ ls
Output:
cd Command:
The cd command is used to change the current directory.
Syntax: $ cd <directory name>
Output:
touch Command:
The touch command is used to create empty files. We can create multiple
empty files by executing it once.
Syntax:
$ touch <file name>
$ touch <file1> <file2> ....
Output:
cat Command:
The cat command is a multi-purpose utility in the Linux system. It can be
used to create a file, display content of the file, copy the content of one file to
another file, and more.
Syntax:
cat [OPTION]... [FILE]..
To create a file, execute it as follows:
$ cat > <file name>
// Enter file content
Press "CTRL+ D" keys to save the file. To display the content of the file,
execute it as follows:
$ cat <file name>
Output:
rm Command:
The rm command is used to remove a file.
Syntax:
$ rm <file name>
Output:
cp Command:
The cp command is used to copy a file or directory.
Syntax:
To copy in the same directory:
$ cp <existing file name> <new file name>
Output:
mv Command:
The mv command is used to move a file or a directory form one location to
another location.
Syntax:
$ mv <file name> <directory path>
Output:
rename Command:
The rename command is used to rename files. It is useful for renaming a
large group of files.
Syntax:
$ rename 's/old-name/new-name/' files
Output:
head Command:
The head command is used to display the content of a file. It displays the first
10 lines of a file.
Syntax:
$ head <file name>
Output:
tail Command:
The tail command is similar to the head command. The difference between
both commands is that it displays the last ten lines of the file content. It is
useful for reading the error message.
Syntax:
$ tail <file name>
Output:
tac Command:
The tac command is the reverse of cat command, as its name specified. It
displays the file content in reverse order (from the last line).
Syntax:
$ tac <file name>
Output:
more Command:
The more command is quite similar to the cat command, as it is used to
display the file content in the same way that the cat command does. The only
difference between both commands is that, in case of larger files, the more
command displays screenful output at a time.
In more command, the following keys are used to scroll the page:
ENTER key: To scroll down page by line.
Space bar: To move to the next page.
b key: To move to the previous page.
/ key: To search the string.
Syntax:
$ more <file name>
Output:
less Command:
The less command is similar to the more command. It also includes some
extra features such as 'adjustment in width and height of the terminal.'
Comparatively, the more command cuts the output in the width of the
terminal.
Syntax:
$ less <file name>
Output:
cat Command:
The cat command is also used as a filter. To filter a file, it is used inside
pipes.
Syntax:
$ cat <fileName> | cat or tac | cat or tac |. . .
Output:
cut Command:
The cut command is used to select a specific column of a file. The '-d' option
is used as a delimiter, and it can be a space (' '), a slash (/), a hyphen (-), or
anything else. And, the '-f' option is used to specify a column number.
Syntax:
$ cut -d(delimiter) -f(columnNumber) <fileName>
Output:
grep Command:
The grep is the most powerful and used filter in a Linux system. The 'grep'
stands for "global regular expression print." It is useful for searching the
content from a file. Generally, it is used with the pipe.
Syntax:
$ command | grep <searchWord>
Output:
comm Command:
The 'comm' command is used to compare two files or streams. By default, it
displays three columns, first displays non-matching items of the first file,
second indicates the non-matching item of the second file, and the third
column displays the matching items of both files.
Syntax:
$ comm <file1> <file2
Output:
tr Command:
The tr command is used to translate the file content like from lower case to
upper case.
Syntax:
$ command | tr <'old'> <'new'>
Output:
uniq Command:
The uniq command is used to form a sorted list in which every word will
occur only once.
Syntax:
$ command <fileName> | uniq
Output:
wc Command:
The wc command is used to count the lines, words, and characters in a file.
Syntax:
$ wc <file name>
Output:
sort Command:
The sort command is used to sort files in alphabetical order.
Syntax:
$ sort <file name>
Output:
gzip Command:
The gzip command is used to truncate the file size. It is a compressing tool. It
replaces the original file by the compressed file having '.gz' extension.
Syntax:
$ gzip <file1> <file2> <file3>...
Output:
find Command:
The find command is used to find a particular file within a directory. It also
supports various options to find a file such as byname, by type, by date, and
more.
The following symbols are used after the find command:
(.) : For current directory name
(/) : For root
Syntax:
$ find . -name "*.pdf"
Output:
locate Command:
The locate command is used to search a file by file name. It is quite similar to
find command; the difference is that it is a background process. It searches
the file in the database, whereas the find command searches in the file
system. It is faster than the find command. To find the file with the locates
command, keep your database updated.
Syntax:
$ locate <file name>
Output:
date Command:
The date command is used to display date, time, time zone, and more.
Syntax: $ date
Output:
cal Command:
The cal command is used to display the current month's calendar with the
current date highlighted.
Syntax: $ cal
Output:
sleep Command:
The sleep command is used to hold the terminal by the specified amount of
time. By default, it takes time in seconds.
Syntax:
$ sleep <time>
Output:
time Command:
The time command is used to display the time to execute a command.
Syntax: $ time
Output:
exit Command:
Linux exit command is used to exit from the current shell. It takes a
parameter as a number and exits the shell with a return of status number.
Syntax: $ exit
Output:
clear Command:
Linux clear command is used to clear the terminal screen.
Syntax: $ clear
Output:
whoami Command:
It tells you about the system's username.
Syntax: $ whoami
Output:
who Command:
The who command gives the information about the users logged on to the
system.
Syntax:
$ who
Output:
w Command:
This command tells about the users who are logged in and what are they
doing.
Syntax:
$w
Output: