Linux-commands
Linux-commands
==================================================
Exercise 2 - File Handling:
Linux -> Windows
touch -> (Create empty file) , type nul.> filename
chmod -> icacls (Change file permissions)
chown -> takeown (Change file ownership)
ln -> mklink (Create links)
find -> find/findstr (Search for files/text)
locate -> where (Find file locations)
grep -> findstr (Search text patterns)
===============================================
Exercise 3 - Process Management:
Linux -> Windows
ps -> tasklist (List processes)
top -> taskmgr (Task manager - GUI)
kill -> taskkill (Terminate processes)
nice -> start /priority (Set process priority)
================================
=============================================
Exercise 7 - Backup:
==============================
==============================
Exercise 9 - Basic Scripting (Batch Files):
# Variables
# Loops
for loop:
do echo %%i
echo $i )
done
while loop:
do if condition (
commands commands
# Conditionals
then commands
commands )
fi else (
commands
===================================
Exercise 10 - Redirection:
=====================================
Exercise 11 - Wildcards:
========================================
```bat
@echo on
set var=value
echo %var%
@echo off
@echo off
somecommand.exe
if errorlevel 1 (
goto :error
:error
pause
=================
pause
if exist "filename" (
) else (
Set
@echo off
echo Starting...
@echo on
command1
command2
@echo off
echo Done.
Ques: How to create user registration details like, username,
name,age,gender,etc.with the help of commands?
echo.
echo ---------------------
echo.
pause
1. Save the file with a .bat extension, for example, registration.bat.
2. Make sure to select "All Files" in the "Save as type" dropdown in
Notepad to avoid saving it as a .txt file.
Output
The script will output the collected information both on the screen and in a
file named registration.txt. The file will contain the following:
Registration Details:
---------------------