Common commands in Linux development

xiaoxiao2021-03-06  186

Basic operation command: ---------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------- LS # Display by default Current Directory File List LS -A # Displays all files including hidden files LS -L # Display file properties, including size, date, symbolic connection, whether you can read and write and do LS --COLOR = never * .so> Obj # Do not display text color, record all SO files to the OBJ file ---------------------------------- ---------------------------------- CD DIR # Switch to the DIR directory CD / # switch to the current directory The root directory CD .. # Switch to the previous directory cd ../ .. # Switch to the upper secondary directory CD ~ # switch to the user directory, such as the root user, switch to / root ----- -------------------------------------------------- --------------- RM File # Delete a file RM -FR Dir # Delete the entire directory called DIR in the current directory -------------- -------------------------------------------------- ------ CP Source Target # Copy the file source to target cp / 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 same CP -Fr source_dir target_dir # Copy the entire directory and copy in a non-linked manner, when the Source directory comes with a symbolic link, the two directories are different ---------------------------------------------------------------------------------------------------------------- -------------------------------------------------- - MV Source Target # Renamed the file Source to Target ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Content, different, the DIFF file1 file2 # compare 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 same content, if it is a binary code, only two files are different COMMs File1 file2 # Compare files, display two files different content ------------------------------------------------------------------------------------------------------------------------------ ------------------------------- Echo message # Show 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 # display the contents of the file and transfer it to the more program implementation paging display, use the command Less file to implement the same function more # paging command, general Pass the content to it through the pipeline, such as LS | More -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------ EXPORT LC_ALL =

EN_CN.GB2312 # Set the value of the environment variable lc_all to zh_cn.gb2312 export display = 0: 0 # passed this setting, the graphics program running under the current character terminal can be run directly on the XServer Date # Display the current date time DATE -S 20: 30:30 # Set the system time 20:30:30 Date -s 2002-3-5 # Set the system period 2003-3-5 Clock -R # to the system BIOS read time parameter clock -w 将 系统 时间(If the time is set by Date), write to BIOS ------------------------------------- ------------------------------- Eject #umout off CDROM and pops up the disc, but CDROM cannot be in the state of busy, otherwise 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 file grep -ir "chars" # in all files in the current directory look up string Chars, and ignore cases, -i is case case, -r is the next level directory - -------------------------------------------------- ------------------ VI File # Editing File File Vi Original Usage and Command: Input Commands, press Ctrl C, then Enter: X (Exit), : x! (Exit and save): W (write file),: w! (Do not ask the way to write files),: R File,:% s / oldchars / newchars / g (all words String OldChars is replaced with newchars) This category of commands ----------------------------------- --------------------------------- Man LS # reads about the help of the LS command Man Ls | GREP Color # Read Take the help of the LS command and find the Color string through the GREP program --------------------------- ----------------------------------------- StartX # 运行 图 图 图形 图 有 图 有 图 图Just run x graphics server --------------------------------------------- ------------------------- Reboot # restart computer HALT # Turn off all applications and services, enter the pure operating environment init 1 # Restart Application and Services Init 6 # Restart Computer ------------------------------------------------------------------------------------------------- --------------------------------- Expanded command --------------- -------------------------------------------------- ----- --------------------------------------------- ------------------------- TAR XFZV file.tgz # 将 文件 file file.tgz decompressed TAR XFZV file.tgz -c target_path # put file file. TGZ unzipped to target_path directory TAR CFZV file.tgz Source_path # Reduces file source_path to file.tgz Tar C Directory>

Directory.tar # Package the directory Directory Directory.tar gzip Directory.tar # will overwrite the original file to generate compressed Directory.tar.gz gunzip Directory.tar.gz # override the original file to decompress the generation of 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 # Display the Version of the operating system kernel ---------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- -------- RPM -IHV Program.rpm # Installer Program and Displays the installation process RPM2TARGZ program.rpm program.tgz # converts files in the RPM format into Tarball format --------- -------------------------------------------------- ----------- Su root # Switch to Super User Sulogin / DEV / TTY4 # In TTY4, Alt F4 Terminal Wait for the user to log in or directly to open a shell chmod a x file # Set the file file settings For executable, the script file must set one this, otherwise you can use Bash File to execute chmod 666 file # Set file file to read and write Chown User / Dir # Set the / DIR directory to User ----- -------------------------------------------------- --------------- MKNOD / DEV / HDA1 B 3 1 # Create block device HDA1, the main device number is 3, from the device number 1, the first partition of the Master hard disk MkNod / DEV / TTY1 C 4 1 # Create a character device TTY1, the main device number is 4, the public device number is 1, that is, the first TTY terminal ------------------------------------------------------------------------------------------------------------------------------------------ -------------------------------------------------- - Touch / TMP / Running # / TMP Create a temporary file Running, disappear after restart ----------------------------------- -------------------------------- Sleep 9 # system hangs for 9 seconds -------- -------------------------------------------------- -------------- LPD Stop or Cups Stop # Stop Print Sergers LPD Start or Cups Start # launch Print Sergers LPD RESTART or CUPS Restart # restart print service Lpr file.txt # Print file file.txt ------------------------------------------- ------------------------ fdisk / dev / hda # is like performing DOS's FDISK, CFDisk / dev / hda # is slightly friendly than the FDISK interface Some mount -t ext2 / dev / hda1 / mnt # put / dev / hda1 loaded to / mnt directory DF # Display file system loading related information Mount -t ISO9660 / dev / cdrom / mnt / cdrom # Loading CD drive to / MNT / CDROM directory Mount-T smb //192.168.1.5/sharedir / mnt -o username = tomlinux, password =

Tomlinux # loads Windows shared directory to / mnt / smb directory, username and password are Tomlinux Mount -t NFS 192.168.1.1:/sharedir / mnt # load the Shared Directory SharedIr of NFS Services to / MNT / NFS Directory Umount / MNT # Uninstall / MNT directory, / mnt directory must be idle Umount / DEV / HDA1 # uninstall / dev / hda1 devices, the device must be in the air-pro-state sync # Synchronize the contents in cache with disk, in Linux Copy files, generally need to system free talent to write file E2FSCK / DEV / HDA1 # check / dev / hda1 has file system errors, prompt repair mode E2FSck -p / dev / hda1 # Check / dev / hda1 is wrong, if There is an automatic repair E2FSck -y / dev / hda1 # check error, all questions Perform 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 # Take SWAP partition as memory To use swapoff / dev / hda9 # to uninstall SWAP partition -------------------------------------------------------------------------------------------------- ------------------------------ LILO # Run the LILO program, the program automatically looks for /etc/lilo.conf and press this Configuration Lilo -c /Root/lilo.conf #LILO program Press /Root/lilo.conf Configuration Effective GRUB # Run Boot Loader Setup in Linux Shell Grub-Install # Install the GRUB Disk Booter, successfully upgrade the kernel without To restart your system like Lilo, just modify /etc/grub.conf to implement new boot configuration RDEV BZIMAGE # Show Kernel's root partition information RDEV BZIMAGE / DEV / HDA1 # Set Kernel's root partition to / dev / hda1 This is very important in the system without boot procedures such as LILO. --------- -------------------------------------------------- ----------- DD if = / dev / fd0 of = floppy.fd # Copy the content of the floppy disk into a mirror, functionality is the same for HD-COPY, which is commonly used in the old stone era, DD if = / dev / Zero of = root.ram BS = 1024, count = 1024 # Generates a block device with a size, which can use MKFS root.ram # to use mkfs root.ram # to use mkfs root.ram # to use mkfs root.ram # = Root.ram of =

/ dev / ram0 # Import the contents of the ROOT.RAM of the init.rd format Mount / DEV / RAM0 / MNT #Ramdisk / DEV / RAM0 loaded to / mnt directory -------------- -------------------------------------------------- ------ GCC Hello.c # Compile hello.c into a.out binary execution file GCC Hello.c -o hello # compile hello.c into binary execution file GCC -STATIC -O HELLO Hello.c # Compile hello.c Text-based static execution file LDD program # display procedure which librar # display procedure to remove the symbolic table and useless debugging information, can be much smaller - -------------------------------------------------- --------------------------------------------- Under Strace, what the program did a look at it. 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.

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

New Post(0)