Common Linux Commands

Source: Internet
Author: User
Some common basic commands: uname-a view kernel version ls-al Show all file properties pwd display current path cd-return the last Directory cd ~ Return to the home directory dates set time, date cal display calendar cal2006bc calculator with man & amp; inf...

Some common basic commands:
Uname-a view kernel version
Ls-al: display properties of all files
Pwd displays the current path
Cd-returns the last Directory cd ~ Returns the home directory.
Date s: Set the time and date
Cal display calendar cal 2006
Bc calculator
Man & info Help Manual
Locale displays all available fonts locale-a in the current font/etc/sysconfig/i18n setting file
LANG = en English font
Sync writes data synchronously to the hard disk
Shutdonw-h now & half & poweroff shutdown
Reboot restart
Startx & init 5 enters the graphic interface
/Work &? Work: Search for document content up and down
Chgrp changed the archive group chgrp testing install. log
Chown changed its owner chown root: root install. log
Chmod change attribute chmod 777 install. log read = 4 write = 2 execute = 1
Cp copy cp filename
Rm delete file rm-rf filename force delete File
Rmdir delete folder
Rename mv 123.txt 222.txt
Create a folder using mkdir
Touch file creation update current time
Cat Displays cat from the first line | more pages
Nl adds a row number before the content
More & less side flip
Head-n filename: displays row N content
Tail-n filename: the last N rows of content displayed
Od display non-pure document
Df-h display partition space
Du: displays the directory or file size.
Fdisk partition settings fdisk-l/dev/hda display hard disk partition status
Mkfs creates various file systems mkfs-t ext3/dev/ram15
Fsck checks and fixes LINUX files
Ln hard link ln-s software link
Whereis search command
Locate search
Find/-name "***.***"
Which viewing tool
Whoami displays the current user
Gcc-v view GCC version
Delete chattr-I filename cancel prohibition
Lsattr show hidden attributes
Updatedb updates the database
Mke2fs format mkfs-t ext3
Dd if =/etc/passwd of =/tmp/passwd. bak backup
Mount: list all partitions in the system.
Mount-t iso9660/dev/cdrom/mnt/cdrom mounting disc
Mount-t vfat/dev/fd0/mnt/floppy mount a floppy disk
Mount-t vfat-o iocharset = utf8, umask = 000/dev/hda2/mnt/hda2 mount the fat32 partition
Mount-t ntfs-o nls = utf8, umask = 000/dev/hda3/mnt/hda3 mount ntfs partitions
Linux-NTFS Project: http://linux-ntfs.sourceforge.net/
Umount/mnt/hda3? Load
Ifconfig displays or sets network devices
Service network restart Nic
Ifdown eth0 disable Nic
Ifup eth0 enable Nic
Clear screen
History! 55. execute 55th commands
Stty terminal stty-
Fdisk/mbr delete GRUB
At? H? One-time job schedule
Crontab: routinely executed command [e] edit, [l] display, [r] delete task
& Background running program tar-zxvf 123.tar.gz & ---------> background running
View jobs in the background
Fg transfers the background program to the foreground fg n ------> n is a number, you can specify the program
Bg enables the work to run in the background
Kill end process kill-9 PID [9] force end, [15] Normal end, [l] list available kill signals
Ps aux viewing background programs
Top view background programs top-d 2 update every two seconds top-d 2-p10604 watch a PID
Top-B-n 2>/tmp/top.txt -----> run the top consultation twice, and then? Output to/tmp/top.txt
Pstree uses A tree chart to display the program [A] connected by ASCII, listing the PID and [p] listing the account
What is killall? H except for a service killall-9 httpd
Free display memory status free-m --------> displayed in MB
Uptime displays the current system boot time
Netstat displays the network status netstat-tulnp ------> find the current system? The network connection that is already under monitoring and its PID
Dmesg displays the boot information demsg | more
Nice sets priority nice-n-5 vi & -----> use root? A nice value is-5, used to execute vi
Renice adjusted priority
Runlevel displays the current runlevel
Depmod
Lsmod displays the modules loaded into the system
Modinfo displays information about the kernel module
Insmod loading module
Modprobe automatically processes the load-able module
Rmmod delete Module
Check chkconfig and set various system services chkconfig -- list -----> to list various service statuses.
Ntsysv sets various services of the system. There is also a command setup for the same purpose.
Cpio backup file
Linux directory architecture
/Root directory
/Bin commonly used command binary file directory
/Boot stores the files that must be read when the system starts, including the core (kernel ).
/Boot/grub/menu. lst GRUB settings
/Boot/vmlinuz kernel
/Boot/initrd core to extract the required RAM Disk
/Dev system peripheral devices
/Etc system settings file
/Etc/DIR_COLORS set color
/Etc/HOSTNAME: Set the node name of the user.
/Etc/NETWORKING only indicates YES indicating that the network exists
The/etc/host. conf file shows how the user's system queries the node name. I checked the file on my machine and displayed: [order hosts, bind]
/Etc/hosts: set the table for the user's own IP address and name
/Etc/hosts. allow settings allow inetd machines to use
The/etc/hosts. deny setting cannot be used by machines that use inetd.
/Etc/hosts. equiv
/Etc/inetd. conf: configure the system Network Daemon inetd.
/Etc/gateways
/Etc/protocols: Set the protocols supported by the system
/Etc/named. boot sets the local server as the name server configuration file
/Etc/sysconfig/network-scripts/ifcfg-eth0 set IP
/Etc/resolv. conf set DNS
The configuration file of/etc/X11 X Window, xorg. conf or XF86Config.
/Etc/fstab records the file system to be mounted upon startup
/Etc/inittab: Set the runlevel that the init process will set when the system starts.
/Etc/issue records information displayed before logon
/Etc/group: Set the user's group name and related information
/Etc/passwd account information
/Etc/shadow password information
/Etc/sudoers can be the configuration file of the sudo command
/Etc/securetty to set which terminals can be logged on by the root user
/Etc/login. defs default configuration when all users log on
/Etc/exports: used to set NFS
/Etc/init. d/all servers? These scripts are all stored here, for example, to start or close

/Etc/xinetd. d /? This is the so-called "super daemon management" service configuration file directory.
In the/etc/modprobe. conf kernel module, set additional parameters.

Alias eth0 e1000
Alias scsi_hostadapter mptbase
Alias scsi_hostadapter1 mptspi
Alias scsi_hostadapter2 ata_piix]
/Etc/syslog. conf log setting file
/Home user's home directory
/Library used by the lib system
/Lib/modules kernel related modules
/Var/lib/rpm kit installation
/Lost + found system? When an error occurs abnormally, will it? Why does Pan Yan sodium? What are the four kickochi secrets of Wei fat mi? Br/>/mnt peripheral mount point
/Media is similar to/mnt
/Opt additional software installed on the host
/Proc virtual directory, memory ing
/Proc/version kernel version, and uname-
/Proc/sys/kernel system kernel function
/Root system administrator's home directory
/Sbin command executed by the system administrator
/Srv some servers ??? Again? Yun? @ Services? Accounts? Why? ?
/Tmp is a common user or is it running? Why did Jack give me a try? Br/>/usr Directory, storing applications and files
/Usr/X11R6: X-Window Directory
/Usr/src: Linux source code
/Usr/include: System header file
/Usr/openwin: Store SUN's OpenWin
/Usr/man Online User Manual
/Usr/bin user? What are the targets of binary file?
/Usr/local/bin user? What are the targets of binary file?
Function libraries used by the/usr/lib system
The function library used by the/usr/local/lib system
/Usr/sbin commands that can be executed by the system administrator
/Usr/local/sbin commands that can be executed by the system administrator
/Var log file
/Var/log/secure log logon system? Files used to access data, such as pop3, ssh, telnet, and ftp, are recorded in this file.
/Var/log/wtmp record the login information? Material, last
/Var/log/messages? Indicates an error message that occurs when the value is changed to y.
/Var/log/boot. log records during startup or some services? Indicates the start or close message.
/Var/log/maillog record email access or ?? Sendmail and pop3 user records
/Var/log/cron records the crontab routine service? Hot? Br/>/var/log/httpd,/var/log/news,/var/log/mysqld. log,/var/log/samba,/var/log/procmail. log:
Points? E is ??? Different? Road server? Why? /P>


Compression command:
* Files compressed by the. Z compress program;
*. Files compressed by the bz2 bzip2 program;
*. Files compressed by the gz gzip program;
* Is the. tar package? And?] Compressed;
* Is the .tar.gz tar program packaged? N cases, where? K and compressed by gzip

Compress filename compressed file plus [-d] uncompress
Gzip filename compression plus [-d] decompress zcat 123.gz to view the compressed file content
Bzip2-z filename compression plus [-d] unzip bzcat filename.bz2 to view the compressed file content
Tar-cvf/home/123.tar/etc package without compression
Tar-xvf 123.tar unpacks
Tar-zxvf/home/123.tar.gz unzip with gzip
Extract tar-jxvf/home/123.tar.bz2 with bzip2
Tar-ztvf/tmp/etc.tar.gz view tar content
Cpio-covB> [file | device] parts
Cpio-icduv
Account Management
/Etc/passwd system account information
/Etc/shadow account password information is encrypted by MD5 32-bit
Add "*" in front of the password column 『*』『! "Forbidden to use an account
/Etc/group system group information
/Etc/gshadow
Newgrp change logon Group
Useradd & adduser create new user ---------> useradd-m test automatically create the user's login Directory
Useradd-m-g pgroup test ---------> specify the level
/Etc/default/useradd settings
/Etc/login. defs UID/GID? ? Set
Passwd change password -----------> passwd test
Usermod
Userdel delete account -----------> userdel-r test
Change the SHELL [-l] used when logging on to the system using chsh to display the available SHELL; [-s] modify your own SHELL.
Chfn changes the information displayed by the finger command
Finger finds and displays user information
Id display user ID -----------> id test
Groupadd add Group
Groupmod is similar to usermod.
Groupdel delete group
Su test changes su-to root and uses the root environment variable.
Sudo executes commands in other identities
Visudo edit/etc/sudoers and add a line "test ALL = (ALL) ALL 』
% Wheel ALL = (ALL) ALL users in ALL the wheel groups in the system can use sudo.
% Wheel ALL = (ALL) NOPASSWD: ALL users in the wheel group do not use the NOPASSWD password.
User_Alias ADMPW = vbird, dmtsai, vbird1, and vbird3 are added to the ADMPW group.
Admpw all = NOPASSWD :! /Usr/bin/passwd,/usr/bin/passwd [A-Za-z] *, \
! /Usr/bin/passwd root can change the user password, but cannot change the root password (add it before the command! Cannot represent)
PAM (Pluggable Authentication Modules, embedded mode ?)
Who & w View who is online
Last recent host login information
Recently logged on to lastlog? R? Read/var/log/lastlog
Talk with other users
Write sending information write test [ctrl] + d send
Mesg sets the write permission for the terminal. mesg n prohibits receiving mesg y.
Wall sends a message to all users. wall this is q test
Mail write mail
/Etc/default/useradd home directory default settings
Quota displays the space used by the disk and the limit quota-guvs -----> shows the current limit of the root user's quota.
Quota-vu query
Quotacheck check disk space and restrictions quotacheck-avug ----->? Why? Mechanical Brain/etc/mtab? ?? Partition supported by quota? OK? Why? Br/> [-m] force scan
Quota must be an independent partition. there must be two files, quota. user and quota. group. add the following to/etc/fstab:
/Dev/hda3/home ext3 defaults, usrquota, kgquota 1 2
The chmod 600 quota * setting is complete and the restart takes effect.
Edquota edits the quota user of a user or group, [g] group, [p] copy, and [t] sets the grace period.
Edquota-a yang edquota-p yang-u young -----> Copy
Quotaon enable disk space limit quotaon-auvg --------> ?? Uranium? Filesystem
Quotaoff off disk space limit quotaoff-a --------> ?? Quota restrictions
Repquota-av query? System ?? Persons? What is the filesystem limit of the mechanical parameter quota ?? B
Quota? Operator _ start ?? Filesystem support to the entire ??? OK? What are the main steps? Probably:
1 ,? Set partition filesystem to support quota ?? ? Br/> required by quota? Yes? In partition, only filesystem support is available. what is average? When f, the best support level is ext2/ext3,
Other filesystems? Type? Brother, me?] Yes ?? Now! ?? Filesystem supports quota most ?? Lieutenant fading ?? /Etc/fstab,
Make ?? Why? _ Can the stored quota disk support quota? Sakura? Br/> 2. create a quota ??? N:
Just before ??, Integer ?? Quota? Row disk limit ?? ? The n case is aquota. user/aquota. group,
Create ????? N case is required? Do you need to use quotacheck first? Why did Yu determine fufu? Br/> 3. edit the limit value of quota? Material:
Again? ?Edquota? Why ?? Every ?? User or group? Can be empty ?? Sakura? Br/> 4. try again? C ?? Quota:
? After setting the quota, create? Yes? Line quotacheck once, and then use quotaon ??? Why? Br/> Boot Process overview
1 ,? What is the first hardware input to boot the BIOS? Set the code;
2. get the first boot? Boot Loader (that is, lilo, grub, spfdisk, etc.) of the MBR;
3 ,? Into the Kernel? I series? Core ??, Kernel? Start solution? Whol s ,? K and? L ??? Uranium? Apricot w? Set;
4. run the init Program in the Kernel and obtain the run-level response message;
5. init? Examples/etc/rc. d/rc. sysinit file;
6. start the Core plug-in module? (/Etc/modprobe. conf );
7. run the run-level command in init ?? Batch? N (Scripts );
8. run/etc/rc. d/rc. local in init? N case;
9. run the/bin/login program ,? K. wait for the user to log on;
10. after logging in, start using Shell to control the host.
In/etc/rc. d/rc3.d ?? Start with S, stop with K, and then the number indicates the execution order
GRUB vga settings
Color \ resolution 640x480 800x600 1024x768 1280x1024 bit
256 769 771 773 775 8 bit
32768 784 787 790 793 15 bit
65536 785 788 791 794 16 bit
16.8 M 786 789 792 795 32 bit
./Configure check system information./configure -- help | more help information
Make clean clear the files left before
Make compilation
Make install installation
Rpm-q -----> check whether rpm-ql is installed ------> query all directories of this suite
Rpm-qi -----> description of the query suite rpm-qc [d] -----> configuration file and description file
Rpm-ivh ----> install rpm-V --------> check whether the kit has been updated.
Rpm-e ------> delete rpm-Uvh -------> upgrade and install


-- Nodeps -----> force installation -- test -----> test installation

Author: "Zhu Ying's column"

Related Article

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.