bash
This command initiates a system reboot using the `shutdown` command with the `--reboot` option. It demonstrates how to restart a system from the command line.
shutdown
bash
This command initiates a system reboot using the `shutdown` command with the `--reboot` option. It demonstrates how to restart a system from the command line.
shutdown
bash
Run the command `foo` with the highest priority (`-20`) using the `nice` command. This demonstrates setting process priority in a Unix-like system.
nice
bash
List all processes using TCP port 4000 with `lsof`. This command helps identify which processes are occupying a specific network port.
lsof
bash
The `lsof` command lists open files and the processes that opened them. This is useful for identifying which processes are using specific files or directories.
lsof
bash
The `pidof` command is used to find the process ID (PID) of a running program named `foo`. This is useful for identifying and managing specific processes.
pidof
bash
linux
List all running processes on a Linux system, displaying detailed information such as CPU and memory usage, process ID, and command. This is a common command for monitoring system activity.
ps
bash
This snippet enhances the Bash shell experience by defining a custom `cd` function that lists directory contents after changing directories, and by creating aliases for common commands (`cp`, `mv`, `rm`, `df`, `du`) with interactive or human-readable options. This demonstrates how to customize and improve command-line workflows in Bash.
ls cp mv rm df du
bash
This snippet demonstrates configuring an SSH connection using the `~/.ssh/config` file. It defines a host named `name` with specific settings for the user (`foo`), hostname (`127.0.0.1`), and port (`8765`). The `ssh name` command then uses this configuration to establish a connection. This shows how to simplify SSH connections with predefined settings.
cat ssh
bash
Reattach to a detached screen session with the ID `31166`. This demonstrates using the `screen` command to manage terminal sessions, allowing users to resume work in a previously detached session.
screen
bash
List all active screen sessions. This command is used to check the currently running screen sessions in a terminal multiplexer environment.
screen
bash
The `lshw` command lists detailed information about the system's hardware configuration, including CPU, memory, storage, and peripherals. This is useful for diagnosing hardware issues or gathering system specifications.
lshw
bash
List all PCI devices connected to the system using the `lspci` command. This provides detailed hardware information about PCI devices.
lspci
bash
List all USB devices connected to the system using the `lsusb` command. This provides information about the USB buses and the devices attached to them.
lsusb
bash
Display the contents of the `/etc/resolv.conf` file, which contains DNS resolver configuration. This is used to view the DNS settings on a system.
cat
bash
Query the DNS records for `example.com` using the `host` command. This demonstrates how to retrieve DNS information for a domain.
host
bash
This command uses `nmap` to perform a ping scan (`-sP`) on the IP range `192.168.1.1/24`, identifying active hosts on the local network. This is useful for network troubleshooting and discovering devices connected to the network.
nmap
bash
Scan all TCP ports (1-65535) on the localhost (`0.0.0.0`) using `nmap`. This command is useful for network troubleshooting and identifying open ports on a system.
nmap
bash
Run a network diagnostic tool `mtr` to trace the route to `example.com`, generating a report with 100 cycles of data collection. This is useful for network troubleshooting and analyzing packet loss or latency issues.
mtr
bash
Use `mtr` with the `--report-wide` option to perform a network diagnostic on `example.com`. This command combines the functionality of `traceroute` and `ping` to provide a detailed report of the network path and packet loss. This demonstrates network troubleshooting.
mtr
bash
The `traceroute` command is used to trace the path that packets take from the local machine to a specified destination (e.g., `example.com`). It helps in diagnosing network issues by showing each hop along the route and the time taken to reach each hop. This is a common tool for network troubleshooting.
traceroute