Open swetank01 opened 2 weeks ago
Package Management
sudo apt update
sudo apt install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
nginx -v
sudo systemctl stop nginx
sudo apt remove nginx
sudo rm -rf /etc/ssh/sshd_config
dpkg -l
apt list --installed
apt list --upgradable
Linux Core Concepts 1
sudo useradd testuser
sudo groupadd devs
sudo usermod -aG devs testuser
id testuser
2
top (cpu memory)
htop
df (disk usage)
corntab -e
crontab -l
systemctl restart crond.service
hostnamectl set-hostname new-hostname
5
sudo vim /etc/nginx/nginx.conf (log messages name change)
Linux Kernel
hostnamectl, uname -srm
File Manipulation
Here are five tasks for each topic with descriptions:
Package Management
Task: Install a specific version of a package.
apt
,yum
, ordnf
) to install a specific version of thenginx
package on your system. Verify the installation and check the version.Task: Remove a package and its configuration files.
apache2
package along with its configuration files. Verify that the package is removed and no longer listed in the package manager.Task: List installed packages and search for a specific package.
curl
. Provide the output of the search.Task: Upgrade all installed packages.
Task: Add a repository and install a package from it.
git
) from that repository. Confirm that the package is installed and list its version.Linux Core Concepts
Task: Demonstrate user and group management.
testuser
, add this user to a group calleddevs
, and set a password for the user. Verify that the user has been created and is part of the correct group.Task: Monitor system resource usage.
Task: Schedule a cron job.
/home/user/script.sh
every day at 2 AM. Ensure the cron job is created successfully and describe how you would check if it runs as expected.Task: Change the hostname of the system.
new-hostname
, and verify the change using appropriate commands. Document any necessary steps to ensure the change persists after a reboot.Task: Configure system logging.
Linux Kernel
Task: Check the kernel version and configuration.
Task: Update the kernel.
Task: Load and unload kernel modules.
dummy
) and then unload it. Verify that the module is loaded or unloaded correctly.Task: Check system boot parameters.
Task: Investigate kernel logs.
dmesg
or check/var/log/kern.log
to investigate kernel messages. Identify any warning or error messages and provide a brief analysis of what they might indicate.File Manipulation
Task: Create and manage file permissions.
testfile.txt
and set the permissions so that the owner can read and write, the group can only read, and others have no access. Verify the permissions after setting them.Task: Archive and compress files.
archive
, move some sample files into it, and then create a compressed tarball of the directory. Verify that the tarball is created successfully.Task: Search for specific content within files.
.log
files located in the/var/log/
directory. Provide the command used and a sample of the output.Task: Copy and move files with different options.
example.txt
from the home directory to/tmp
, preserving its attributes. Then move the file to/var/tmp
and verify both operations.Task: Create a symbolic link.
link_to_example.txt
that points toexample.txt
in the home directory. Verify that the link works by accessing the original file through the link.Let me know if you need more tasks or any adjustments!