ARISTA - Bash Commands: Difference between revisions

From IT-Arts.net
Created page with "Category:Wiki == Basic File System Commands == === Displaying File System Usage === To check the file system disk usage: <nowiki> df -h</nowiki> This will display the disk space usage of all mounted file systems in a human-readable format. === Checking Available Memory === To check available memory on an Arista switch: <nowiki> free -h</nowiki> This will display memory usage in a human-readable format, showing total, used, free, and available memory. === View..."
 
m Text replacement - "Category:Wiki" to "Category:Wiki '''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' "
 
Line 1: Line 1:
[[Category:Wiki]]
[[Category:Wiki]]
'''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]'''''


== Basic File System Commands ==
== Basic File System Commands ==

Latest revision as of 07:08, 17 January 2026


Return to Wiki Index


Basic File System Commands

Displaying File System Usage

To check the file system disk usage:

df -h

This will display the disk space usage of all mounted file systems in a human-readable format.

Checking Available Memory

To check available memory on an Arista switch:

free -h

This will display memory usage in a human-readable format, showing total, used, free, and available memory.

Viewing Running Processes

Use the following command to view running processes:

ps aux

This will list all running processes with detailed information such as user, PID, CPU, memory usage, and more.

Network Configuration Commands

Displaying Network Interfaces

To display the status of network interfaces on the device:

show interfaces status

This command shows the status of each network interface, including the interface name, VLAN, and link status.

Displaying Routing Table

To view the current routing table:

show ip route

This command will display the routing table, which includes network destinations, subnet masks, next-hop addresses, and routing protocols.

Ping a Remote Host

To check connectivity to a remote device or server:

ping <IP-address>

This will send ICMP echo requests to the target IP address and show response times.

Displaying IP Addresses of Interfaces

To display IP addresses of all interfaces:

show ip interface brief

This will show a brief overview of IP addresses assigned to all interfaces, including operational status.

Advanced System Commands

Viewing System Logs

To view the system log, which includes error messages and other important system-level information:

show logging

This command will display logs with timestamps, severity levels, and message content.

Restarting the Network Daemon

To restart the network daemon:

sudo systemctl restart networking

This command will restart the network service, which is often necessary after changes to network configuration.

Checking System Uptime

To view how long the system has been running since the last reboot:

uptime

This will show the current time, how long the system has been running, and the load averages for 1, 5, and 15 minutes.

Viewing System Processes in Real-Time

Use the following command to view system processes in real-time:

top

This command provides a dynamic real-time view of system processes, resource usage, and system load.

File and Directory Operations

Viewing Directory Contents

To list the contents of the current directory:

ls -l

This command shows detailed information about files and directories, including permissions, ownership, size, and timestamps.

Copying Files

To copy files from one location to another:

cp <source-path> <destination-path>

For example, to copy a configuration file from one directory to another:

cp /mnt/flash/config.txt /mnt/flash/backup/config.txt

Moving Files

To move a file to a new location:

mv <source-path> <destination-path>

For example:

mv /mnt/flash/config.txt /mnt/flash/backup/config.txt

Deleting Files

To delete a file:

rm <file-path>

For example:

rm /mnt/flash/old_config.txt

Creating Directories

To create a new directory:

mkdir <directory-name>

For example:

mkdir /mnt/flash/config_backup

System Monitoring and Debugging

Viewing System Resources

To monitor system resource usage such as CPU and memory utilization:

top

This will provide an interactive, real-time overview of system resources.

Debugging Network Connectivity

To trace the route to a specific IP address:

traceroute <IP-address>

For example:

traceroute 192.168.1.1

This command will show the path packets take to reach the destination, helping diagnose routing issues.

Checking System Health

To perform a quick check on the system’s health:

show system health

This command shows system health status including memory, CPU load, and disk usage.