changed file names and directories
All checks were successful
learn org at code.softwareshinobi.com/linux.softwareshinobi.com/pipeline/head This commit looks good

This commit is contained in:
2025-06-19 08:36:13 -04:00
parent aa880afc23
commit 611d0816cc
149 changed files with 96 additions and 602 deletions

View File

@@ -0,0 +1,105 @@
# The `df` command
The `df` command in Linux/Unix is used to show the disk usage & information.
`df` is an abbreviation for "disk free".
`df` displays the amount of disk space available on the file system containing each file name argument. If no file name is given, the space available on all currently mounted file systems is shown.
### Syntax
```
df [OPTION]... [FILE]...
```
### Options
|**Short Flag**|**Long Flag**|**Description**|
|:--|:--|:--|
|`-a`|`--all`|Include pseudo, duplicate, inaccessible file systems.|
|`-B`|`--block-size=SIZE`|Scale sizes by SIZE before printing them; e.g., `-BM` prints sizes in units of 1,048,576 bytes; see SIZE format below.|
|`-h`|`--human-readable`|Print sizes in powers of 1024 (e.g., 1023M).|
|`-H`|`--si`|Print sizes in powers of 1000 (e.g., 1.1G).|
|`-i`|`--inodes`|List inode information instead of block usage.|
|`-k`|<center>-</center>|Like `--block-size=1K`.|
|`-l`|`--local`|Limit listing to local file systems.|
|<center>-</center>|`--no-sync`|Do not invoke `sync` before getting usage info (default).|
|<center>-</center>|`--output[=FIELD_LIST]`|Use the output format defined by `FIELD_LIST`, or print all fields if FIELD_LIST is omitted.|
|`-P`|`--portability`|Use the `POSIX` output format|
|<center>-</center>|`--sync`|Invoke sync before getting usage info.|
|<center>-</center>|`--total`|Elide all entries insignificant to available space, and produce a grand total.|
|`-t`|`--type=TYPE`|Limit listing to file systems of type `TYPE`.|
|`-T`|`--print-type`|Print file system type.|
|`-x`|`--exclude-type=TYPE`|Limit listing to file systems not of type `TYPE`.|
|`-v`|<center>-</center>|Ignored; included for compatibility reasons.|
|<center>-</center>|`--help`|Display help message and exit.|
|<center>-</center>|`--version`|Output version information and exit.|
### Examples:
1. Show available disk space
**Action:**
--- Output the available disk space and where the directory is mounted
**Details:**
--- Outputted values are not human-readable (are in bytes)
**Command:**
```
df
```
2. Show available disk space in human-readable form
**Action:**
--- Output the available disk space and where the directory is mounted
**Details:**
--- Outputted values ARE human-readable (are in GBs/MBs)
**Command:**
```
df -h
```
3. Show available disk space for the specific file system
**Action:**
--- Output the available disk space and where the directory is mounted
**Details:**
--- Outputted values are only for the selected file system
**Command:**
```
df -hT file_system_name
```
4. Show available inodes
**Action:**
--- Output the available inodes for all file systems
**Details:**
--- Outputted values are for inodes and not available space
**Command:**
```
df -i
```
5. Show file system type
**Action:**
--- Output the file system types
**Details:**
--- Outputted values are for all file systems
**Command:**
```
df -T
```
6. Exclude file system type from the output
**Action:**
--- Output the information while excluding the chosen file system type
**Details:**
--- Outputted values are for all file systems EXCEPT the chosen file system type
**Command:**
```
df -x file_system_type
```

View File

@@ -0,0 +1,37 @@
# The `du` command
The `du` command, which is short for `disk usage` lets you retrieve information about disk space usage information in a specified directory. In order to customize the output according to the information you need, this command can be paired with the appropriate options or flags.
### Examples:
1. To show the estimated size of sub-directories in the current directory:
```
du
```
2. To show the estimated size of sub-directories inside a specified directory:
```
du {PATH_TO_DIRECTORY}
```
### Syntax:
```
du [OPTION]... [FILE]...
du [OPTION]... --files0-from=F
```
### Additional Flags and their Functionalities:
*Note: This does not include an exhaustive list of options.*
|**Short Flag** |**Long Flag** |**Description** |
|:---|:---|:---|
|`-a`|`--all`|Includes information for both files and directories|
|`-c`|`--total`|Provides a grand total at the end of the list of files/directories|
|`-d`|`--max-depth=N`|Provides information up to `N` levels from the directory where the command was executed|
|`-h`|`--human-readable`|Displays file size in human-readable units, not in bytes|
|`-s`|`--summarize`|Display only the total filesize instead of a list of files/directories|

View File

@@ -0,0 +1,50 @@
# The `fdisk` command
The `fdisk` command is used for controlling the disk partition table and making changes to it and this is a list of some of options provided by it : </b>
- Organize space for new drives.
- Modify old drives.
- Create space for new partitions.
- Move data to new partitions.
### Examples:
1. To view basic details about all available partitions on the system:
```
fdisk -l
```
2. To show the size of the partition:
```
fdisk -s /dev/sda
```
3. To view the help message and all options of the command:
```
fdisk -h
```
### Syntax:
```
fdisk [options] device
```
### Some of the command options:
On writing the following command
```
fdisk /dev/sdb
```
the following window appears :
![Options](https://media.geeksforgeeks.org/wp-content/uploads/20190219152451/Screenshot-711.png)
and then you type m which will show you all options you need such as creating new partition and deleting a partition as in the following picture :
![Options](https://media.geeksforgeeks.org/wp-content/uploads/20190219153114/Screenshot-741.png)

View File

@@ -0,0 +1,118 @@
# The ``lsblk`` command
## Summary
The ``lsblk`` command displays the block and loop devices on the system. It is especially useful when you want to format disks, write filesystems, check the filesystem and know the mount point of a device.
## Examples
1. Basic usage is fairly simple - just execute 'lsblk' sans any option.
```
lsblk
```
2. Make lsblk display empty devices as well
```
lsblk -a
```
3. Make lsblk print size info in bytes
```
lsblk -b
```
4. Make lsblk print zone model for each device
```
lsblk -z
```
5. Make lsblk skip entries for slaves
```
lsblk -d
```
6. Make lsblk use ascii characters for tree formatting
```
lsblk -i
```
7. Make lsblk display info about device owner, group, and mode
```
lsblk -m
```
8. Make lsblk output select columns
```
lsblk -o NAME,SIZE
```
## Syntax
```
lsblk [options] [<device> ...]
```
## Reading information given by ``lsblk``
On running ``lsblk`` with no flags or command-line arguments, it writes general disk information to the STDOUT.
Here is a table that interpretes that information:
| Column Name | Meaning | Interpretation |
|:-----------:|:----------------------------------|:------------------------------------------------------------|
| NAME | Name of the device. | Shows name of the device. |
| RM | Removable. | Shows 1 if the device is removable, 0 if not. |
| SIZE | Size of the device. | Shows size of the device. |
| RO | Read-Only. | Shows 1 if read-only, 0 if not. |
| TYPE | The type of block or loop device. | Shows ``disk`` for entire disk and ``part`` for partitions. |
| MOUNTPOINTS | Where the device is mounted. | Shows where the device is mounted. Empty if not mounted. |
## Reading information of a specific device
``lsblk`` can display information of a specific device when the device's absolute path is passed to it.
For example, ``lsblk`` command for displaying the information of the ``sda`` disk is:
```
lsblk /dev/sda
```
## Useful flags for ``lsblk``
Here is a table that show some of the useful flags that can be used with lsblk
| **Short Flag** | **Long Flag** | **Description** |
|:--------------------------:|:-----------------------|:---------------------------------------------|
| ``-a`` | ``--all`` | `lsblk` does not list empty devices by default. This option disables this restriction. |
| ``-b`` | ``--bytes`` | Print the SIZE column in bytes rather than in human-readable format. |
| ``-d`` | ``--nodeps`` | Don't print device holders or slaves. |
| ``-D`` | ``--discard`` | Print information about the discard (TRIM, UNMAP) capabilities for each device. |
| ``-E`` | ``--dedup column`` | Use column as a de-duplication key to de-duplicate output tree. If the key is not available for the device, or the device is a partition and parental whole-disk device provides the same key than the device is always printed.|
| ``-e`` | ``--exclude list`` | xclude the devices specified by a comma-separated list of major device numbers. Note that RAM disks (major=1) are excluded by default. The filter is applied to the top-level devices only.|
| ``-f`` | ``--fs`` | Displays information about filesystem. |
| ``-h`` | ``--help`` | Print a help text and exit.|
| ``-l`` | ``--include list`` | Displays all the information in List Format. |
| ``-J`` | ``--json`` | Displays all the information in JSON Format. |
| ``-l`` | ``--list`` | Displays all the information in List Format. |
| ``-m`` | ``--perms`` | Displays info about device owner, group and mode. |
| ``-M`` | ``--merge`` | Group parents of sub-trees to provide more readable output for RAIDs and Multi-path devices. The tree-like output is required.|
| ``-n`` | ``--noheadings`` | Do not print a header line. |
| ``-o`` | ``--output list`` | Specify which output columns to print. Use `--help` to get a list of all supported columns. |
| ``-O`` | ``--output-all`` | Displays all available columns. |
| ``-p`` | ``--paths`` | Displays absolute device paths. |
| ``-P`` | ``--pairs`` | Use key="value" output format. All potentially unsafe characters are hex-escaped (\x<code>) |
| ``-r`` | ``--raw`` | Use the raw output format. All potentially unsafe characters are hex-escaped (\x<code>) in NAME, KNAME, LABEL, PARTLABEL and MOUNTPOINT columns.|
| ``-S`` | ``--scsi`` | Output info about SCSI devices only. All partitions, slaves and holder devices are ignored.|
| ``-s`` | ``--inverse`` | Print dependencies in inverse order. |
| ``-t`` | ``--topology`` | Output info about block device topology. This option is equivalent to "-o NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,RQ-SIZE".|
| ``-T`` | ``--tree[=column]`` | Displays all the information in Tree Format. |
| ``-V`` | ``--version`` | Output version information and exit. |
| ``-w`` | ``--width`` |pecifies output width as a number of characters. The default is the number of the terminal columns, and if not executed ona terminal, then output width is not restricted at all by default.|
| ``-x`` | ``--sort [column]`` | Sort output lines by column. This option enables `--list` output format by default. It is possible to use the option `--tree` to force tree-like output and than the tree branches are sorted by the column.|
| ``-z`` | ``--zoned`` | Print the zone model for each device. |
| ``-`` | ``--sysroot directory``| Gather data for a Linux instance other than the instance from which the lsblk command is issued. The specified directory is the system root of the Linux instance to be inspected.|
## Exit Codes
Like every Unix / Linux Program, ``lslbk`` returns an exit code to the environment.
Here is a table of all the exit codes.
| Exit Code | Meaning |
|:---------:|:-----------------------------------------------------------|
| 0 | Exit with success. |
| 1 | Exit with failure. |
| 32 | Specified device(s) not found. |
| 64 | Some of the specified devices were found while some not. |

View File

@@ -0,0 +1,44 @@
# The `mount` command
The `mount` command is used to mount 'attach' a filesystem and make it accessible by an existing directory structure tree.
### Examples:
1. Displays version information:
```
mount -V
```
2. Attaching filesystem found on device and of type type at the directory dir:
```
mount -t type device dir
```
### Syntax Forms:
```
mount [-lhV]
```
```
mount -a [-fFnrsvw] [-t vfstype] [-O optlist]
```
```
mount [-fnrsvw] [-t fstype] [-o options] device dir
```
### Additional Flags and their Functionalities:
|**Short Flag** |**Long Flag** |**Description** |
|:---|:---|:---|
|`-h`|<center>`--help`</center>|Dispaly a help message and exists|
|`-n`|<center>`--no-mtab`</center>|Mount without writing in /etc/mtab|
|`-a`|<center>`--all`</center>|Mount all filesystems (of the given types) mentioned in fstab|
|`-r`|`--read-only`|Mount the filesystem read-only|
|`-w`|`--rw`|Mount the filesystem as read/write.|
|`-M`|`--move`|Move a subtree to some other place.|
|`-B`|`--bind`|Remount a subtree somewhere else *(so that its contents are available in both places)*.|

View File

@@ -0,0 +1,75 @@
# The `parted` command
The `parted` command is used to manage hard disk partitions on Linux. It can be used to add, delete, shrink and extend disk partitions along with the file systems located on them.
You will need root access to the system to run `parted` commands.
**NOTE:** Parted writes the changes immediately to your disk, be careful when you are modifying the disk partitions.
### Examples:
1. Displays partition layout of all block devices:
```
sudo parted -l
```
2. Display partition table of a specific `disk`
```
sudo parted disk print
```
Examples of `disk` are /dev/sda, /dev/sdb
3. Create a new disk label of `label-type` for a specific disk
```
sudo parted mklabel disk label-type
```
`label-type` can take values "aix", "amiga", "bsd", "dvh", "gpt", "loop", "mac", "msdos", "pc98", or "sun" <br />
4. Create a new partition in a specific `disk` of type `part-time`, file system is `fs-type` and of size `size` Mb.
```
sudo parted disk mkpart part-time fs-type 1 size
```
`part-time` can take values "primary", "logical", "extended".<br />
`fs-type` is optional. It can take values "btrfs", "ext2", "ext3", "ext4", "fat16", "fat32", "hfs", "hfs+", "linux-swap", "ntfs", "reiserfs", "udf", or "xfs"<br />
`size` has to less than the total size of the specified disk. To create a partition of size 50Mb, <size> will take the value of 50
5. `parted` can also be run in an interactive format. Operations to manage the disk partitions can be performed by entering appropriate commands in the interactive session.
`help` command in the interactive session shows a list of all possible disk management operations which can be performed.
```
$ sudo parted
GNU Parted 3.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print # prints the partition table of the default selected disk - /dev/sda
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 53.7GB 53.7GB primary ext4 boot
(parted) select /dev/sdb # change the current disk on which operations have to be performed
Using /dev/sdb
(parted) quit # exit the interactive session
```
### Syntax Forms:
```
parted [options] [device [command [options...]...]]
```
### Options:
|**Short Flag** |**Long Flag** |**Description** |
|:---|:---|:---|
|-h|--help|displays a help message listing all possible `commands [options]`|
|-l|--list|lists partition layout on all block devices|
|-m|--machine|displays machine parseable output|
|-v|--version|displays the version|
|-a|--align|set alignment type for newly created partition. It can take the following values:<br /> `none`: Use the minimum alignment allowed by the disk type<br /> `cylinder`: Align partitions to cylinders<br /> `minimal`: Use minimum alignment as given by the disk topology information<br /> `optimal`: Use optimum alignment as given by the disk topology information|