Pratical 311
Pratical 311
1. Go to the https://www.virtualbox.org/
2. Click on "Downloads" and select the appropriate version for your operating system:
o Windows
o macOS
o Linux
o Solaris
For Windows
For macOS
1. Open VirtualBox from the Start Menu (Windows) or Applications Folder (macOS/Linux).
2. If it opens without errors, the installation was successful!
LINUX SETUP
Popular options:
• Ubuntu (beginner-friendly)
• Fedora (cutting-edge, good for developers)
• Debian (stable, but requires manual setup)
• Arch Linux (for advanced users who want customization)
1. Download the ISO file of your chosen Linux distro from its official website.
2. Use a tool like Rufus (Windows) or Etcher (Mac/Linux) to create a bootable USB.
3. Plug in the USB and select the correct ISO file.
4. Set the partition scheme to GPT (for UEFI) or MBR (for Legacy BIOS).
5. Click Start to make the bootable drive.
1. Restart your PC and enter the BIOS/UEFI (press F2, F12, Del, or Esc during boot).
2. Set the USB drive as the first boot option.
3. Save changes and reboot.
1. Once booted, you’ll see an option like "Try" or "Install" Linux. Choose Install.
2. Follow the on-screen setup:
o Choose Language & Keyboard Layout
o Select Installation Type:
▪ Erase disk (deletes everything and installs Linux)
▪ Dual Boot (install alongside Windows)
▪ Manual Partitioning (for custom setups)
o Create a user account
o Set up partitions (if required)
3. Click Install and wait for it to complete.
Step 5: Reboot & Finalize Setup
1. Basic Commands
pwd
• cd → Change directory
cd /home/user/Documents
cd .. # Move up one directory
mkdir new_folder
rm file.txt
rm -r folder_name # Remove directory
2. File Management
touch newfile.txt
cp file.txt /destination/
cp -r folder/ /destination/
mv oldname.txt newname.txt
mv file.txt /new/location/
less file.txt
3. User Management
whoami
who
passwd
PROCESS CREATION USING JAVA / C++
import java.io.*;
process.waitFor();
System.out.println("Process finished!");
} catch (Exception e) {
e.printStackTrace();
}
}
}
This will open Notepad (on Windows). Replace "notepad.exe" with another command if needed.
Process Termination
import java.io.*;
System.out.println("Process terminated!");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Explanation:
Explanation:
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Override
public void run() {
System.out.println("Thread " + id + " is running");
try {
Thread.sleep(1000); // Simulating some work
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("Thread " + id + " has finished");
}
}
Explanation: