Linux common development command

xiaoxiao2021-03-06  21

Basic operational order ----------------------------------------------- ----------------------------------------------------------------- ----------------------------------------- LS # Displays the current manner Directory file list LS -A # Display all files include hidden files LS -L # Display file properties, including size, date, symbolic connection, whether to read and write and perform ls --color = never * .so> Obj # Display text color, record all SO files into the OBJ file

-------------------------------------------------- -------------------- CD Dir # Switch to the DIR directory CD / # switch to the current directory CD .. # Switch to the previous directory CD ../ .. # Switch to the upper secondary directory CD ~ # switches to the user directory, such as the root user, switch to / root

-------------------------------------------------- -------------------- RM File # Delete a file RM -FR Dir # Deletes the entire directory called DIR in the current directory

-------------------------------------------------- -------------------- CP Source Target # Copy the file source to targetcp / root / source. # Copy the file Source under / root to the current directory CP -AV Soure_dir target_dir # Copy the entire directory, two directories are exactly the whole directory copy, and is replicated in a non-linked manner, when the Source directory comes with a symbolic link, the two directories are different.

-------------------------------------------------- -------------------- MV Source Target # Rename the file Source Named Target

-------------------------------------------------- ------------------ DIFF DIR1 DIR2 # Compare Directory 1 is the same as the list of files, but does not compare the actual content of the file, different, Diff File1 File2 # Compare the file 1 is the same as the contents of the file 2, if it is a file in the text format, will not display the content, if it is a binary code, only two files are different Comm file1 file2 # compare files, display two Same content

-------------------------------------------------- ------------------- Echo message # Shows a string of characters echo "message message2" # Display discontinuous string Cat: cat file # Displays the contents of the file, and DOS Type The same CAT file | more # Displays the contents of the file and transfer to the more program implementation paging display, use the command Less file to implement the same function more # paging command, generally pass the content to it, such as ls | more

-------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- " The graphics program running under the terminal can be run directly in XServerDate # Display the current date time date -s 20:30:30 # Set the system time is 20: 30: 30date -s 2002-3-5 # Set the system period 2003-3-3- 5Clock -R # Read the time parameter clock -w # to the system BIOS Write the system time (such as the time of DATE setting) to BIOS ---------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- Eject #umout offs CDROM and pops up the disc, but CDROM cannot be in the state of Busy, otherwise it will be invalid.

-------------------------------------------------- -------------------- DU # Calculate the Current Directory Du -SM / ROOT # Calculate the capacity of the / root directory and in m unit FIND -NAME / PATH FILE # In / Path Directory Looks to see if there is file filegrep -ir "chars" # in all files in the current directory look up string Chars, and ignore cases, -i is case, -r is the next directory

-------------------------------------------------- -------------------- VI File # Editing File Filevi Original Use and Command: Input Commands, press ESC, then enter: x (exit), x! (exit and save): w (write file),: w! (Do not ask in a way to write file),: R File,:% s / oldchars / newchars / g (all strings OldChars replaced with newchars) This category of commands

-------------------------------------------------- -------------------- MAN LS # reads the help of the LS command Man Ls | GREP color # reads the help of the LS command and finds through the GREP program Color string

-------------------------------------------------- -------------------- Startx # Run Linux graphic with environment xfree86 # only Run X graphics Server

-------------------------------------------------- ------------------- Reboot # Restart Computer Halt # Close Computer Init 0 # Turn off all applications and services, enter pure operation Environment Init 1 # Restart App And Services Init 6 # Restart Computers

-------------------------------------------------- -------------------- Extended command -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ------------ TAR XFZV file.tgz # extracts file file.tgz Different Target_path # Unzip file file.tgz to target_path directory TAR CFZV file.tgz source_path # Compress file Source_Path to file.tgztar c directory> Directory.tar # Package Directory to uncompressed Directory.Targzip Directory.tar # will overwrite the original file to generate compressed Directory.Tar.gzgunzip Directory.tar.gz # overwritten the original The file is decompressed to generate a non-compressed Directory.TAR. TAR Xf Directory.Tar # can uncomparable file unpacking ---------------------------------- -------------------------------- DMESG # Display KERNLE boot and drive loading information Uname # Displays the type of operating system Uname -r # Displays the Version of the operating system kernel

-------------------------------------------------- -------------------- Strings File Displays the ASCII character content in the file file

-------------------------------------------------- ------------------ RPM -IHV Program.rpm # Installer Program and Display the installation process RPM2TARGZ Program.rpm program.tgz converts the file in the RPM format to Tarball format

-------------------------------------------------- ------------------- Su root # Switch to Super User Sulogin / DEV / TTY4 # On TTY4, Alt F4 Terminal Wait for users to log in or log in to open a shellchMod A X file # Set the file file to executable, the script file must set one, otherwise you can use Bash File to execute chmod 666 file # Set file file to read and write Chown User / Dir # will set the / DIR directory setting User

-------------------------------------------------- -------------------- MKNOD / DEV / HDA1 B 3 1 # Create block devices HDA1, the main device number is 3, from the device number 1, ie Master hard disk The first partition MKNOD / DEV / TTY1 C 4 1 # Create a character device TTY1, the main device number is 4, the public number is 1, that is, the first TTY terminal

-------------------------------------------------- ---------------------------------------------------------------------------------------- Create a file. -------------------------------------------------- -------------------- Sleep 9 # system hangs for 9 seconds

-------------------------------------------------- ------------------- LPD Stop or Cups Stop # Stop Print Sergers LPD Start or CUPS Start #Noot Print Sergers LPD RESTART or CUPS Restart # Restart Print Services Program lpr file.txt # Print file file.txt --------------------------------------- ------------------------------ FDISK / DEV / HDA # is like performing DOS's FDISKs CFDisk / dev / hda # 比 f m 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息 信息Loading a CD-ROM / CDROM directory mount-t SMB //192.168.1.5/sharedir / mnt -o username = tomlinux, password = tomlinux # Load Windows shared directory to / mnt / smb directory, username, and password All of Tomlinuxmount -t NFS 192.168.1.1:/sharedir / mnt # loads the Shared Directory of the NFS Service to / MNT / NFS Directory Umount / MNT # Uninstall / MNT directory, / mnt directory must be idle Umount / DEV / HDA1 # Uninstall / dev / hda1 device, the device must be in the air-pro-state Sync # Synchronize the contents in cache, copy files in Linux, generally need to system free to write file E2FSCK / DEV / HDA1 # Check / dev / HDA1 has a file system error, prompt repair mode E2FSck -p / dev / hda1 # check / dev / hda1 has an error, if there is an automatic repair E2FSck -y / dev / hda1 # check error, all questions are YES Execute E2FSck -c / dev / hda1 # check if there is a bad area MKFS / DEV / HDA1 # format / dev / hda1 is EXT2 format mkfs.minix / dev / hda1 # formatted / dev / hda1 for minix format file system MFKS / DEV / HDA9 # 工 /化 / dev / hda9 is Linux SWAP format swapon / dev / hda9 # Use SWAP partition as a memory to uninstall SWAP partition

-------------------------------------------------- -------------------- LILO # Run the LILO program, the program automatically finds /etc/lilo.conf and press this configuration LILO -C /ROOT/LILO.CONF # LILO program Press / ROOT/LILO.CONF Configuration Grub # Run Boot Loader Setup in Linux Shell Status Grub-Install # Install the GRUB Disk Booter, successfully upgrade the kernel without restarting the system like Lilo, just modify / ETC / GRUB.CONF Enable new boot configuration RDEV BZIMAGE # Display Kernel's root partition information RDEV BZIMAGE / DEV / HDA1 # Set the root partition of Kernel to / dev / hda1, which is very in the system without Lilo and other boot important.

-------------------------------------------------- ------------------ DD if = / dev / fd0 of = floppy.fd # Copy the content of the floppy disk into a mirror, functionality and HD commonly used in the old stone age -copy The same DD if = / / dev / zero of = root.ram BS = 1024, count = 1024 # Generates a block device with a size of 1M, you can use it as a partition of the hard disk to use mkfs root.ram # Equipment formatted to EXT2 format DD if = root.ram of = / dev / ram0 # 将 ot ot ot ot ot ot ot 图片-------------------------------------------------- -------------------- GCC Hello.c # Compile hello.c into a.out binary execution file GCC Hello.c -o Hello # 将 h h h 将Compiled binary execution files named Hello GCC -STATIC -O Hello Hello.c # Compile hello.c Focusing the binary static execution file LDD Program Objcopy -s Program in the program named Hello. The symbol table and useless debugging information are removed, you can make a lot

-------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- Wait, under Strace, how the program did something in Dongdong. PS # Displays the current system process information PS-EF # Display System All Process Information Kill -9 500 # Dry the process No. 500 Dry off Killall -9 Netscape # kill all the names of Netscape, Kill is not universal, The deadline is invalid. Top # Displays the activity of the system process, pressing the CPU resource percentage of free # Display System Memory and SWAP Usage Time Program After the Program program is completed, the time used by the Program Run is calculated.

-------------------------------------------------- -------------------- Chroot. # Switch the root directory to the current directory, use Chroot / Tomlinux to switch the root directory to / tomlinux directory when debugging new system Tomlinux Sbin / Init # Switch the root directory to / tomlinux and execute sbin / initadduser ID # Add a user userDel ID # 增除 i i i 用户 用户er erer u 显示 i p u p Passwd -d root # Remove the root user's password to the Chown ID / WORK # specified / work directory to your ID users

-------------------------------------------------- -------------------- Ifconfig eth0 192.168.1.1 Netmask 255.255.255.0 # Set the address of the NIC 1 192.168.1.1, the mask is 255.255.255.0, does not write NetMask parameters The default is 255.255.255.0ifConfig eth0: 1 192.168.1.2 # The second address of the bundle network card 1 is 192.168.1.2ifconfig eth0: x 192.168.1.x # Bundle NIC 1 The second address is 192.168.1.xifconfig Down Eth1 # Close the second network card so that it stops working Hostname -f tomlinux.com # Set the host name to Tomlinux.Comroute # Display the current routing setting Route Add Default GW 192.168.1.1 Metric 1 # set 192.168.1.1 is the default Route Route del Default # Start the default route DHCP # Start DHCP service DHClient # Start the DHCP terminal and automatically obtain the IP address ping 163.com # Test and 163.com connection PING 202.96.128.68 # Test and IP 202.96.128. 68 connection --------------------------------------------- ---------------------- Probe RTL8139 # Check driver rtl8139.o Whether working properly LSMOD # Displays the loaded driver Insmod RTL8139.O # loading driver RTL8139.OINSMOD SB.O = 0x280 IRQ = 7 DMA = 3 DMA16 = 7 MPU_IO = 330 # Mount driver and set related IRQ, DMA parameter RMMOD RTL8139 # Delete Drive Modules named RTL8139 GPM -K # Stop Character Mouse service in the state GPM -T PS2 # Start MOUSE in the PS2 type in the character state

-------------------------------------------------- -------------------- Telnet 192.168.1.1 # login IP 192.168.1.1 Telnet server telnet iServer.com # Telnet server ftp 192.168 named iServer.com .1.1 or ftp iServer.com # Log in to FTP services

Transfer: loveunix Author: Echo

转载请注明原文地址:https://www.9cbs.com/read-55765.html

New Post(0)