group 6
-
Be familiar with the use of VirtualBox virtual machines.
-
Be familiar with the Ubuntu operating system.
-
Master the commonly used Linux commands.
-
Hardware:PC machine.
-
Software:VietualBox virtual machine and Ubuntu operating system.
-
Read Section 1.3 about the installation and use of Linux.
-
Read Section 1.5 Linux Common Operation Commands.
-
The use of virtual machine-based Linux operating system.
-
The use of commands related to files and directories.
-
Use of disk management and maintenance commands.
-
The use of system management and setting commands.
-
The use of network-related commands.
-
The use of compressed backup commands.
1.Start VirtualBox application, start Windows, select "Start - program -VistualBox", pop up the interface as shown in the picture, and click "Start" to run the Linux operating system.
2.After starting the system, you need to enter the user name and password, as shown in the figure. Enter the password here.
3.Start the terminal, after successfully entering the system, select "Application - Terminal" as shown in the figure.
4.Execute the Linux command in the terminal, after the terminal runs, you can enter the Linux command here, and press the enter key to execute, as shown in the figure.
_
A related video demonstration can be viewed at assets/5.1/shipin.mp4
_
ll/bin
cd / tmp
mkdir Myshare
Is - ld myshare/
pwd
Touch test file
Is-Id myshare/
Chmod 755 testfile
Is -I testfile
Cp testfile myshare/testfile. bak
Is -I myshare/
In -s/ tmp/testfile /root/testfile. ln
Is -I /root/testfile. In
Cat /etc/inittab |grepinitdefault
_
A related video demonstration can be viewed at assets/5.2/shipin.mp4
_
11 /dev/cdrom
mount-t iso9660 /dev/cdrom testdir
11/media/cdrom
umount /dev/cdrom
cat /proc/partitions
mkdir /mnt/usb
mount -t vfat -o codepage =936,iocharset=gb2312 /dev/sdb1 /mnt/usb
umount /mnt/usb
_
A related video demonstration can be viewed at assets/5.3/shipin.mp4
_
ps -ef
ps -ef | grep sshd
kill - 9
shutdown
_
A related video demonstration can be viewed at assets/5.4/shipin.mp4
_
Run the following command
ifconfig
The information of the current network can be displayed, and the operation result is shown in the figure
If the prompt as shown in the figure appears, you can run the command shown in the diagram to install the package and try again
sudo apt install net-tools
Run the following command
ifconfig ens33 192.168.1.10
You can set the IP address of ens33 to 192.168.1.10
If the following prompts appear
you can add sudo
before the command to elevate the privilege, that is, run
sudo ifconfig ens33 192.168.1.10
After operation, the IP change is observable
Run the following command
ifconfig ens33 netmusk 255.255.255.0
You can set the subnet musk of ens33 to 255.255.255.0
After operation, the subnet mask change is observable
Run the following command
ifconfig ens33 down
It can be observed that the NIC ens33 has been disabled
Run the command
ping 127.0.0.1
The result is as follows
This indicates that the local network loop is normal
Run the command
ifconfig ens33 up
It can be observed that the NIC ens33 is enabled
Run the following command
netstat -r
The kernel routing table is displayed
The result is shown in the figure
Run the following command
netstat -t
The TCP connection status is displayed
The result is shown in the figure
Run the following command
netstat -u
The UDP connection status is displayed
The result is shown in the figure
_
A related video demonstration can be viewed at assets/5.5/shipin.mp4
_
tar cf /root/tmp.tar /tmp/*
tar zcvf /root/tmp.tar.gz /tmp/*
1s -1 /root/tmp.tar /root/tmp.tar.gz
tar ztf /root/tmp.tar.gz
tar zxvf /root/tmp.tar.gz -C /tmp/myshare/
gzip *
gzip-1 *
gzip-dv *
_
A related video demonstration can be viewed at assets/5.6/shipin.mp4
_
1
Use the ls
command to view the information under /root
and redirect the result to save it into the test.txt
file.
Run the following command:
sudo ls /root/
View all files and subdirectory information under the /root directory.
sudo ls /root > text.txt
Write the list of files in the /root directory to the test.txt file.
2
Use disk management and maintenance commands to mount the USB drive to the virtual machine, and copy the test.txt
file generated in question 1 to the USB drive.
Run the following command:
sudo cp /tmp/test.txt /mnt/usb/
Copy the file test.txt from the /tmp directory to the USB drive.
ls /mnt/usb
Check if the file has been successfully copied to the USB drive.
Use ifconfig
to change the IP address of eth0
to 10.3.0.159
and modify the subnet mask to 255.0.0.0
.
Run the following command:
sudo ifconfig enp0s3 10.3.0.159
change the IP address
sudo ifconfig enp0s3 netmask 255.0.0.0
change the subnet mask
ifconfig enp0s3
Verify the modification
4
Compression: _This refers to reducing the size of a file using specific algorithms. Common tools include gzip and bzip2. The compressed file is often a single file._Compression can be lossless (the data is fully restored after decompression) or lossy (some data is lost after decompression, but the loss is usually negligible for the final use).
Archiving: _This involves combining multiple files or directories into a single file. A commonly used tool is tar. After archiving, the file size may not change, but it makes transmission and storage more convenient.That is, archived files can be as large as the sum of the individual files they replace. Common archiving formats include .tar (Tape Archive).
_
_
_
_
_
- Purpose of the experiment
- Experimental equipment
- Experiment pre-study requirements
- Experimental content
- Use of the Linux operating system based on virtual machines
- Use of commands related to files and directories
- Use of commands related to Disk Management and maintenance
- Use of system administration and setting commands
- Establishment and specification of the repository and catalogs
- Specification and modification of the format of document
- Review of document content
- Add and modify comments
- Use of network-related commands
- Use of the Compress Backup command
- Questions
- Modification of document format and content
- Recording of experimental videos
- Recording of experimental videos
_
_
_
-
原仓库链接请点这里
-
Please click here to the original repository
- https://github.com/Bier2004/common-commands-in-Linux