77 Common Linux commands and tools

Source: Internet
Author: User
Tags echo command cpu usage nslookup rsync

77 Common Linux commands and tools

Linux administrators cannot eat with GUI graphical interfaces alone. That's why we're editing this most useful Linux command manual. This guide is specifically designed for Linux administrators and system administrators, and brings together some of the most useful tools for their daily maintenance reference manuals. By learning these simple tools, those who are afraid of the command line can also become a scripting master, thereby maximizing the role of Linux by executing kernal commands and shell commands. Please make good use of our guide, have any Linux problems or need to find relevant answers please be sure to send a post to our TechTarget China Server Forum to communicate.

Alias

Run a command or a series of UNIX commands with a defined thumbnail name associated with a command.

How to use the alias command under Linux.

Apt-get

Apt-get is a tool used to automatically update the Debian system, obtain and then install Debian patch packages/programs.

If you use "aptitude" and "apt-get" to manage programs on Ubuntu servers.

Understand the archive and apt-get of Debian.

Use Apt-get to update your Debian machine.

Aspell
The GNU Aspell is a free, open-source spelling checker that is designed to replace Ispell. It can be used as a font, or as a separate spelling checker.

How to use Aspell to check spelling.

AWK, Gawk

This is a programming language tool for working with text. The language of the awk tool has a large part to learn from the Shell programming language that is commonly used in many fields, and of course awk's syntax is largely original.

Learn how to use the awk tool

Gawk is the version of the AWK programming language under the GNU project.

Bzip2

This is a quick and easy open source program for high-rate compression and decompression files.

How to use bzip2 under Linux.

More about using the BZIP2 compression program instructions.

Cat

A unix/linux command that reads, changes, or merges text files, most often used to display the contents of a file.

How to display file contents under Linux with the Cat command.

An article about what cat commands can do.

Cd

The CD command is used to change the day's directory under Linux, so you can easily see jumps in several directories. It is similar to the CD and CHDIR commands in MS-DOS.

See more about how to use the CD command to change the contents of a directory.

chmod

Chmod is used to Giabian access patterns (permissions) on one or more files. Only one file owner or privileged user can change this permission.

See an example of using the chmod command to change file access permissions.

Chown

The Chown command is used to change the ownership of a file or group, as well as to bulk change the ownership of all objects in a directory, and to see information about the object in which the property is being modified.

Learn how to change file ownership with the Chown command.

Cmp

The CMP tool is used to compare the contents of two files and output the results in a standard format. By default, if two files are identical, CMP will not return any results, and if two files are different, the first difference in bytes and the number of rows will be returned as a result.

See examples of IBM using CMP commands.

Comm

The Comm command is used to select a public row of two sorted files. The input results are divided into three columns, from left to right: only the lines in file 1, the lines in file 2, and both in file 1 and in File 2.

For more information on comparing rows with the Comm command.

Detailed guidance on using the Comm command.

Cp
The CP command is used to copy files and directories, and if the target directory is a different name, the entire directory can be copied to the destination synchronously.

See if you copy the Linux files and directories with the CP command.

Cpio

The Cpio command is used to copy files into and out of the archive memory and directory, and a file contains additional information about them, such as their file name, owner, change time, and access rights. The archive location can be another file on the disk, or a box of tapes. The CPIO has three modes of operation that are more efficient than the tar command.

Learn to perform a Unix-to-Linux migrated file move with the Cpio command.

See how to back up files with the Cpio command.

Cron

Cron is a Linux system process that can run a program at a specified time. To use cron, the user must prepare a text file containing information about what program will be executed with Cron at what time. The crontab command time program is then used to load the text file that describes the cron task, which executes cron.

Executes the command at a specified time using the cron command.

Date

The date command is used to set the system day and time. Another useful thing is that you can output/print the current time information when working with a script file.

A series of examples from IBM about setting date and time with the date command.

Declare

The declare command is used to declare a variable, assign a variable property, or change the quantity property.

An example of declaring a variable with the Delcare command.

Df

The DF command is used to display the free disk space of a file system where a file (as a parameter of a command) resides. If you do not use the file name as a parameter, the free disk space for the entire file system is displayed.

More information about using the DF command to display free disk space.

Echo

Echo is used to repeat or write a string to standard output.

More information about using the echo command in shell scripts.

Enable

The Enable command is used to stop or start the printer queue device.

Example of how to use the Enable command to start a LP printer.

Env

Env is used to set the environment for executing commands, or to display the current environment and its parameters.

An example of changing the environment with the ENV command.

Eval

The eval command can calculate several parameters and then find a separate command in which to generate the state of these parameters.

For more information about using the Eval command to find the result of a parameter.

Exec

The EXEC command is used to enter a command to replace a running parent process. This command executes the input parameters as one or more sub-processes.

More examples of replacing a parent process with exec.

Exit

The exit command terminates a script and then returns a value to the parent process.

More examples of using EXEC to terminate script runs.

Expect

The expect command is used to talk to another interacting process in the script and waits for a response, often to find a specific match in a string.

Use expect to seek a response.

Export

The Export command is used to convert a file to another format. Once a file has been converted, it can be accessed by programs that support this format.

An example of exporting data from a database using the Export command.

Find

The Find command is used to find files in the directory tree that meet certain criteria, including parameters such as Name,type,exec,size,mtime and user.

Quickly locate a file with the Find command

For, while

The for and while are used to perform or iterate over a sequence of actions that satisfy a condition.

Loop through the option action with the for command.

Loop through the option action with the while command.

Free

The free command is used to show the size of the idle and used physical memory and the swap partition size of the system, as well as the cache size used by kernel.

Learn to use the free command to optimize your computer's memory usage.

Gawk
Look at AWK, please.

Grep

The grep command is used to find a file that contains a string, and you can replace the string with a specified value. This is a good way to search for files under Linux.

An example of using grep to search for files.

Gzip

Gzip is an open source program for compressing files in the GNU environment, compressing the pages on the server in the background, and then decompressing the display on the browser.

It is also widely used for the compression of streaming media files, which can merge and compress multiple streaming media files at the same time.

Example of compressing files with gzip.

Ifconfig

The ifconfig is used to configure the network interface. It is used to set up the network interface at startup. After that, it is usually used only when troubleshooting or system adjustment.

Example of configuring a network with Ifconfig.

Use Ifconfig to find Linux network configuration issues.

Ifup

The ifup is used to configure the network interface and initiate a network connection.

More information about the IFUP command to configure the network interface.

Ifdown

The Ifdown command is used to shut down a network interface and disable a network connection.

For more information about shutting down the network with the Ifdown command.

Less, more

The less command enables the administrator to roll back the browse configuration and error log files, displaying the text file one screen at a time, which can be conveniently moved forward and backward in the file. More flexible than other commands.

View a few different files that are viewed with the less command.

Similar to the less command, the more command can display the file one screen at a time, but there is no easy way to move the files back and forth.

View an example of displaying text with the more command.

Locate, Slocate

The locate command is used to read one or more databases and then output the file names that match the target parameters.

Quickly search for files/directories with locate.

Like the locate command, slocate, or security locate, provides a way to index and quickly search for files, while also securely storing file permissions and owner information so that users who are not authorized will not be able to view the files.

An example of a safe and fast index file with the Slocate command.

LfT

The LFT command, similar to Traceroute, is used to determine the connection route, but it provides more information to debug the connection or find the location of the box/system. It can display routing packets and file types.

Use the LFT command to view more information about routed packets.

ln

The ln command can create a file name from a hard connection, allowing multiple users to share one.

Example of ln Creating a hard-connect file.

More examples of using the LN command.

Ls

The LS command lists the files and directories for the current path, which the administrator can use to determine when the profile was last edited.

This article also discusses the LS command.

Use the LS command to list file and directory examples.

Mans

As a shorthand for manual, the Man command allows a user to display the built-in user manual of a Linux system in a specified manner, including command documentation and other system functions.

This article also has a discussion about the man command.

See if you use the Man command.

See the example of the man command displaying the page format.

Mc

This is a menu-style shell that provides a text-based file management approach to UNIX systems.

An extension guide for managing files with MC.

More

Take a look at the introduction to the less command earlier.

Neat

Neat is a management tool under the GNOME graphical interface that allows administrators to specify the information needed to set up a network card, plus other features.

Configure a NTL cat with the neat command.

Configuring UNIX and Linux systems neat play a role when you see network connectivity.

Netconfig, Netcfg

The Netconfig command is used to configure the network, enable the NIC, and display the information needed to provide a series of configurations on the screen.

Configure the network with the Red Hat netcfg command.

Netstat

Netstat provides information and statistics on what protocols are being used and the current TCP/IP network connection. A useful function is to find out what processes and programs are activated on the computer and participate in network communication.

Use the netstat command to view more information about the network status.

Nslookup

Nslookup allows the user to enter a host name and then locate the appropriate IP address. It also supports the reverse process of finding a host name by IP address.

More information on how to find IP addresses with Nslookup is provided by Microsoft.

Od

OD is used to output binary files as an octal format file to standardize the output.

Example of exporting files with OD.

More instructions for OD commands from IBM.

passwd

PASSWD is used to update the user's login password (change the current password).

Some IBM examples of changing passwords with passwd.

Ping

Ping allows a user to verify that an IP address exists and that it receives a request packet. Can be used to test network connectivity and response times, and the working status of the host to which the user is trying to connect.

IBM's example of using ping to authenticate IP addresses.

Ps

PS is used to report the current process status of the system.

Some examples of PS commands.

Pwd

The PWD (print working directory) command is used to display the directory where the current work is located. This is a basic Linux command.

Learn the difference between $path and PWD commands.

Use PWD to display the current working directory.

Read

Read is used to read a line of text from the standard input and assign the value of the field of the input row to the shell variable for further processing.

Read use example from IBM.

Rpm

Red Hat Package Manager (RPM) is a command-line-driven program used to install, uninstall, and manage Linux software installation packages.

RPM using the white paper.

Yum and RPM are different.

Examples of installing software using RPM.

Rsync

The rsync command is used to synchronize a disk or file over a network to another disk or file. Similar to RCP, it also has a number of options available.

An article that uses rsync to back up data.

How to use rsync to back up the Linux directory.

Screen

The screen tool in the GNU environment is a terminal multi-window program that allows users to run multiple applications with a single terminal window.

A guide to running multiple windows and other related applications with Scrren.

A note on the use of Scrren.

Sdiff
The Sdiff command can be used to compare the differences between the two files and then list the differences in a side-by-side format. It can then merge the files and input the results into an output file.

An example of comparing files with Sdiff.

More examples of Sdiff from IBM.

Sed

Sed is a stream editor that can filter text, and it differs from other editors. SED parses the input text and operations on it and then outputs the part of the change. Often used in a part of a file that performs a matching argument or Heze is a part of an alternative file that matches a specified string.

An example of a part of a document executed and substituted with SED.

Examples from IBM regarding the use of SED filtering.

Shutdown

Shutdown is a command that is used to shut down, and it can be restarted by adding a parameter such as-H to terminate the operating system after shutting down the computer, plus-R.

Shut down or terminate a computer with the shutdown command.

Slocate
Please look at the Locate section.

Snort

Snort is an open-source network intrusion detection system that can also be used to monitor network traffic by grabbing packets, which check each packet to detect dangerous loads or suspicious data. It is based on Libpcap.

Use snort to stop hackers.

More information on snort usage from Red Hat.

Sort

Used to sort the lines of text alphabetically or numerically; supports multiple keywords to sort by.

An example of sorting rows with sort.

More examples of multi-keyword sequencing.

Sudo

sudo allows a system administrator to give a specific user permission to run a command at the root level and log all commands and parameters.

A guide that gives users permissions with the sudo command.

Ssh

SSH is a command-line interface that is used to safely log on to a computer remotely, and is often used by network administrators to remotely control servers.

A secure remote login with SSH guide.

Tar

The TAR program is used to compress multiple files into a single file, or to unzip one file into multiple files.

Example of creating an archive file with tar.

TOP

Top is a series of network protocols that provide process information that can display the most memory-intensive tasks in the system. Top can sort tasks based on conditions such as CPU usage, memory usage, and run time.

Monitor the system process with top.

Tr

Used to replace or delete characters from a text stream and write to standard output, but does not accept file names as parameters-only standard input is supported.

An example from IBM about replacing characters with the TR command.

Traceroute

Traceroute tracks and records the path of Internet communication between two computers, which is useful for troubleshooting network/router problems. Even if the domain does not work or does not exist, the IP can also be used to track the route.

A guide to diagnosing network faults with traceroute.

Uname

Uname displays the name of the day's operating system and can enter relevant system information.

Use uname to view the current Cao group system Information examples.

Uniq
A tip from IBM in removing redundant lines with uniq.

Uniq is used to compare rows in a file and to delete/report each duplicate row.

Delete duplicate rows with the Uniq command.

An article from IBM that deletes duplicate lines with Uniq.

Vi

VI is a text editor that allows the user to control the system only with the keyboard, without the need for a mouse or other input tool.

A completed VI using the wizard, with the keyboard to control the system.

Vmstat

Vmstat is used to take a snapshot of the contents of the system and report information such as processes, memory, paging files, and CPU status. For administrators, this is a good way to quickly identify system failures.

How to monitor the performance status of Linux with Vmstat time.

Use Vmstat to see examples of system memory usage.

Wc

WC is used to calculate the number of characters in a file, the number of rows and bytes, and if multiple files are selected, the corresponding number of objects in multiple files can be calculated.

An example of how the number of characters is calculated using WC from IBM.

Wget

Wget is a network tool used to obtain files from the Http,https and FTP sites. It is not working in interactive mode and can still run in the background after the user logs off. It can create a copy of the remote site locally, or recreate the original site.

Example of creating a mirrored site with wget.

While

Please see for.

WhoAmI

The whoami is used to output the user name of the current logged-on user to standard output.

An example from IBM about using WhoAmI to find current login account information.

Xargs

Xargs reads from the standard input, creates and executes the specified command. Empty rows in the input are ignored.

An example from IBM about running commands with Xargs.

77 Common Linux commands and tools

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.