LINUX COMMANDS TO CHECK THE NETWORK

0
6

Many Linux distributions provide a number of tools to simplify network configuration and connectivity verification. The following tools work with every distribution and allow you to administer your network from the command line:

ping: Checks network connectivity

ifconfig: Displays the configuration for a network interface

traceroute: Shows the path taken to reach a host

route: Displays the routing table and/or lets you configure it

arp: Shows the address resolution table and/or lets you configure it

netstat: Displays the status of the network

WORKING IN LINUX WITH THE BASH SHELL

The bash shell serves as the mediator between the user and the Linux kernel, with bash being the most common shell in use today. To interact with the bash shell, you need to understand how the pipe works (allowing the output of one command to be the input of the next), how to use redirection, and some basic commands and environment variables:

Pipe:

command1 | command2

Redirections:

command > file: output goes to file

command < file: input from file

command >> file: append to file

command2> file: errors go to file

Commands:

alias: Defines a shortcut for a long command

apropos: Searches the manpages for keywords

history: Displays the most recent commands

locate: Finds files

whereis: Finds executable files for a command

which: Shows the full pathname for a command

man: Displays online help

printenv: Displays the environment variables

Environment variables:

HOME: User’s home directory

PATH: Directories to search for commands

TERM: Name of a terminal type

LINUX FILE SYSTEM BASICS

To interact with the Linux file system, you must understand some basics: its key directories, some of the most commonly used commands, and the permissions you can assign to files.

Key directories in the file system:

*/: Root directory (base of file system)

/bin: Executable programs

/boot: Linux kernel and boot loader

/dev: Special device files

/etc: System configuration files

/home: Home directories of all users

/lib: Library files for programs

/media: Mount points for CD-ROM and other media

/root: Home directory of the root user

*/sbin: System administration commands

/srv: Data for services such as Web and FTP

*/tmp: Temporary directory

/usr: Many of the important administration programs

/var: Various system files, such as logs

Common commands:

cat: Copies a file to the standard output

cd: Changes the current directory

chmod: Changes file permissions

chown: Changes file ownerships

cp: Copies files

dd: Copies blocks of data

df: Reports disk space usage by device and available space

diff: Compares two text files

du: Reports disk space usage by directory

file: Displays the type of data in a file

find: Finds files based on specified criteria

grep: Searches for text in a file

ln: Links a filename to an alias name

ls: Displays the contents of a directory

mkdir: Creates a directory

more: Displays a text file, one page at a time

mount: Mounts a file system

mv: Renames or moves a file

pwd: Displays the current directory

rm: Deletes files

rmdir: Deletes directories

sort: Sorts lines in a text file

split: Splits a file into smaller parts

umount: Unmounts a file system

wc: Counts the words and lines in a file

File permissions:

rwxrwxrwx: Three sets of rwx. The leftmost set pertains to the owner, the middle set is for the group, and the rightmost set is for others; rwx stands for read (r), write (w), execute (x); the dash () means no permission.

rwx——: Only the owner can read, write, and execute.

rw-r–r–: Everyone can read, and the owner can also write.

rw——-: Only the owner can read and write.

r–r–r–: Everyone can read.

Permissions can also be expressed numerically, where read (r) is equal to 4, write (w) is equal to 2, execute (x) is equal to 1, and no permission is equal to 0. Therefore, rwxrwxrwx is equal to 777rwx—— is equal to 700rw-r–r— is equal to 644rw——- is equal to 600, and r–r–r— is equal to 444.

Source from : https://www.golinuxcloud.com/linux-basics-command-cheatsheet/

Previous articleSymantec to Broadcom Support Systems Transition Guide – Feb 24, 2020
Next articleHow to create a Hyper-V VM template
Phuong Nguyen
Hi, Nguyen Van Phuong is the owner of the website viettechgroup.vn. I 've been working in the IT sector since 2008. With nearly 12 years experience in the fields of design development, Governance, operating system enterprise network infrastructure.. I'm now a senior Infrastructure Administrator for the Enterprise network. Achivements: IT Project management IT management System and Network IT Security and data protection. Plan and bugged for Infrastructure and Security Deployment system Server (HP, IBM, Lenovo, Dell..), Network (Cisco, Juniper, Enterasys,..), PABX system, Firewall (Cisco ASA 5525-x, Juniper SSG520,..) Network system administration and maintenance: +Management all network configure IT system: AD, DNS, DHCP, Cores switch, Access switch, Router, Firewall, etc. Design & implement IT system, project management and manage IT operation, I also have extensive experience of ERP System base SQL , HRM, etc. Vendor/external system integrator management: support other department in terms of technical specifications for cost optimize, business process efficiency, procurement spend compliance. Virtualization System Deployment on Microsoft Windows Server 2016 (Hyper-V) and VMware ( Vmware vSphere 5.5, 6.5,6.7 vCenter) Backup and restore management on Symantec backup products (Veritas Backup 16, 20, 20.1, 20.2 ), Veeam Backup & Replication 9.0, 9.5U1, 9.5U2 U3, U4

LEAVE A REPLY

Please enter your comment!
Please enter your name here