Linux basic commands common


Here Insert Picture Description

File and directory operations command

ls: spelling list, and its function is to list the contents of a directory content attribute information.
cd: spelling change directory, function is to switch from the current working directory to the working directory specified.
cp: spelling copy, whose function is to copy a file or directory
find: Find meant for finding directories and files in the directory.
mkdir: spelling make directories, and its function is to create the directory.
mv: spelling move, its function is to move or rename files.
pwd: spelling print working directory, its function is to display the current working directory absolute path.
rename: rename the file.
rm: spelling remove, its function is to delete one or more files or directories.
rmdir: spelling remove empty directories, delete function is an empty directory.
touch: Create a new empty file, change the time stamp of the existing file attributes.
tree: function tree structure is displayed contents of the directory.
file: display the type of file.
md5sum: MD5 value calculation and verification document.

View documents and content processing command

cat: spelling concatenate, for connecting a plurality of functions and the print files to a specified file or redirected to the screen output.
more: page display file contents.
less: page display file contents usage contrary, more commands.
head: the head of the display file contents.
tail: the tail of the display file contents.
cut: each line of the file separators and outputs the divided specified.
split: split file into different small fragments.
sort: Sort text contents of the document. uniq: remove duplicate lines. Oldboy
WC: the number of lines statistical document, words or bytes.
grep / egrep: filter string, trio third.
join: the same field two papers merged.
tr: replace or delete characters.
vi / vim: command-line text editor.

File compression and decompression command

tar: compression packing. Oldboy
the unzip: Unzip the file.
gzipgzip: compression tool.
zip: compression tool.

Information display command

uname: display information about the operating system command.
hostname: display or set the hostname of the current system.
dmesg: display the power information used to diagnose system failures.
uptime: show system uptime and load.
du: calculate disk space usage.
df: Usage Report file system disk space.
top: real-time display system resource usage.
free: check the system memory.
date: display and setting the system time.
cal: View calendar time information

Search Files command

which: Find a binary command, press the PATH environment variable to find the path.
find: find files from the disk or directory traversal.
whereis: Find a binary command, press the PATH environment variable to find the path.
locate: Find command from the database (/var/lib/mlocate/mlocate.db), using updatedb update the library.

User Management Commands

useradd: Add a user.
usermod: Modify user attributes already existing systems.
userdel: Delete the user.
groupadd: Add User Group.
passwd: change the user password.
chage: change the user password expiration period.
id: Displays the user's uid, gid ownership and user groups.
su: switch the user.
visudo: Edit / etc proprietary command / sudoers file.
sudo: In addition to a user identity (the default root user) to perform in advance sudoers file allows commands.

Basic network operation command

telnet: telnet using the TELNET protocol.
ssh: Use encryption protocol SSH remote login.
wget: command-line to download files.
ping: the network connectivity between the test host.
route: Display and setting linux system routing table.
ifconfig: view, configure, enable or disable command network interface.
ifup: Start card.
ifdown: Close the card.
netstat: View network status.
ss: View network status.

In-depth network operations command

nmap: Network scan command.
mail: send and receive messages.
mutt: mail management commands.
dig: Find DNS resolution process.
host: DNS query commands.
traceroute: Trace data transmission route status.
packet capture tool command line: tcpdump.

For disk and file system commands

mount: mount a file system.
umount: unmount the file system.
fsck: check and repair a Linux file system.
dd: conversion or copying files.
dumpe2fs: Export ext2 / ext3 / ext4 file system information.
dumpe: xt2 / 3/4 file system backup tool.
fdisk: Partition command, the following applies to 2TB disk partitions.
parted: disk partition command, no disk size limit, commonly used in the following 2TB disk partitions.
mkfs: Create a Linux file system format.
partprobe: updating the kernel partition table information.
e2fsck: Check the ext2 / ext3 / ext4 file system type.
resize2fs: adjust ext2 / ext3 / ext4 file system size.

System privileges and user authorization related commands

chmod: change file or directory permissions.
chown: to change the ownership of a file or directory belongs to the group.
chgrp: Change the file user group.
umask: display or set permissions mask.

Command to view the user's login information

whoami: Displays the current valid user name, id -un equivalent to execute the command.
who: displays the current user login information systems.
w: displays a list of users already log into your system, and displays a user instruction being executed.
last: Displays the user login system.
lastlog: show all users last logged information.
users: displays a list of all users currently logged on user systems.
finger: find and display user information.

Built-in command

echo: variable printing, or direct the output of a specified string
printf: formatting the output to standard output.
rpm: rpm package management commands.
yum: command automation to simplify management of the rpm package.
date: View or set the system time.
clear: clear screen, referred to clear the screen.
history: View historical record command execution.
time: command execution time is calculated.
exec: to call and execute the command instructions.
export: set or display environment variables.
unset: delete a variable or function.
type: for determining whether another command is a built-in command.
bc: Command-Line Scientific Calculator

System management and performance monitoring command

chkconfig: Management Linux system boot entry.
vmstat: virtual memory statistics.
mpstat: display the status of each of the available CPU statistics.
iostat: Statistical system IO.
sar: full access to the system's CPU, run queue, disk I / O, paging (swap), memory, CPU, network outages and performance and other data.
ipcs: for reporting status of the communication facilities between the Linux process, the information displayed includes list of messages, shared memory and semaphores information.
ipcrm: to delete one or more message queues, semaphores, shared memory, or set identifier.
strace: for diagnostics, debugging Linux user-space tracker. We use it to monitor user-space processes and kernel interaction, such as system calls, signal transmission, process changes and other states.
ltrace: Command will track the progress of the library function call, it will show which library function is called.

Shutdown / restart / logoff and view system information command

shutdown: shutdown.
halt: shutdown.
poweroff: Turn off the power.
logout: Exit Shell currently logged on.
exit: Exit Shell currently logged on.
Ctrl + d: Exit shortcuts Shell currently logged on.

Process management related commands

bg: a pause command in the background, becomes proceed (in the background).
fg: the command in the background adjusted foreground continue to run.
jobs: How much command to view the current running in the background there.
kill: terminate the process.
killall: Kills processes by name.
pkill: Kills processes by name.
crontab: cron job commands.
ps: a snapshot of the process.
pstree: tree display process.
nice / renice: adjust the priority program running.
nohup: ignoring hangup signal runs the specified command.
pgrep: Find the matching process conditions.
runlevel: Display the current run level.
init: switching the operating level.
service: start, stop, restart and shut down the system. They can also display the current status of all system services.

The following link can be found all the basic command usage and introduce
Linux command Daquan

Published 60 original articles · won praise 58 · views 10000 +

Guess you like

Origin blog.csdn.net/chen_jimo_c/article/details/104734237