Report writing for fundamental of computing (week 9)
Topic D02: Introduction to Linux
Linux is a community of open-source Unix like operating systems that are based on the Linux Kernel.
To manage files, use;
1.Terminal(CLI)
2.File Manager(GUI)
LAUNCHING THE CLI ON UBUNTU:
To open the terminal on an Ubuntu Linux system, you have two options:
- Go to the “Dash” (a launcher menu), type “terminal” in the search bar, and select the terminal application.
- Use the keyboard shortcut by pressing “CTRL + ALT + T” simultaneously.
Upon launching the CLI, you will notice a prompt that typically includes your username and the hostname, indicating the user and system you are working on. The tilde (‘~’) symbol signifies that you are in your home directory. If you navigate to a different directory using the ‘cd’ command, the tilde symbol disappears. It reappears when you return to the home directory. The dollar sign (‘$’) indicates that you are working as a regular user in Linux. If you work as the root user, you will see a hash (‘#’) symbol instead.
- In the above second image we have moved from the /home directory to /hello using the cd command.
- ~ sign does not display while working in /hello directory. It appears while moving back to the home directory.
- ‘$’ sign suggests that we are working as a regular user in Linux.
- While working as root user ‘#’ is displayed.
- root@VirtualBox:~#
PRESENT WORKING DIRECTORY
The directory that you are currently browsing is referred to as the Present Working Directory (PWD). When your PC boots, it logs you into the home directory by default. To identify the current directory, you can use the ‘pwd’ command, which stands for “print working directory.”
CHANGING DIRECTORIES
To switch to a different directory, you can use the ‘cd’ command. Alternatively, you can use ‘cd ~’ to return to the home directory. Moving to the root directory in Linux is as simple as typing ‘cd /’, where the forward slash (‘/’) denotes the root of the file system. Unlike Windows, which uses backward slashes (”), Linux uses forward slashes to represent directory paths.
MOVING TO ROOT DIRECTORY
To navigate up one directory level, you can use the ‘cd ..’ command. This command allows you to move up in the directory hierarchy. For example, if you are in a directory and want to navigate up to the ‘/home’ directory, ‘cd ..’ will take you there.
RELATIVE AND ABSOLUTE PATHS
There are two types of paths in Linux: absolute and relative paths. Absolute paths specify the complete address of a file or directory from the root directory. For example, ‘/home/user/downloads’ is an absolute path. In contrast, relative paths are used when navigating within a directory. For example, if you are in the home directory and want to access the downloads directory within it, you can use the relative path ‘cd Pelden’ instead of typing the entire absolute path.
ACCESSING HARDWARE INFORMATION
Linux provides various commands to access hardware information:
- Disk Space Usage: The ‘df -h’ command displays the disk usage of mounted file systems. You can also use ‘lsblk’ to list block devices.
- Memory: To view RAM and virtual memory information, you can use ‘free -h’ or ‘cat /proc/meminfo.’
- CPU Details: To access information related to your CPU, you can use ‘lscpu’ or ‘cat /proc/cpuinfo.’
- Peripheral Component Interconnection (PCI) Devices: The ‘lspci’ command displays a list of PCI devices and their information.
- Comprehensive Hardware Information: You can gather various hardware details, including those mentioned above, by using the ‘lshw’ command. This single command provides an extensive overview of your system’s hardware components.
Comments
Post a Comment