Ls # display the current directory file list by default
Ls? A # show all files, including hidden files
Ls? L # display file attributes, including the size, date, and symbolic connection, whether the file can be read/written, and whether the file can be executed
Ls -- color = never *. so> obj # the text color is not displayed, and all so files are recorded in the obj file.
Cp/root/source. # copy the file source under/root to the current directory.
Cp? Av soure_dir target_dir # copy the entire directory. the Two directories are identical.
Cp? Fr source_dir target_dir # copies the entire directory in non-link mode. when the source directory has a symbolic link, the two directories are different.
Diff dir1 dir2 # compare whether the list of files in directory 1 and directory 2 is the same, but does not compare the actual content of files.
Diff file1 file2 # compare whether file 1 and file 2 have the same content. if a file is in text format, different contents are displayed, if the code is binary, the two files are different.
Comm file1 file2 # compare files and display different contents of the two files
Cat file # displays the file content, which is the same as the DOS type.
Cat file | more # display the content of the file and transfer it to the more Program for pagination. use the command less file to implement the same function.
More # Paging command, generally pass the content to it through pipelines, such as ls | more
Du-sm/root # Calculate the capacity of the/root directory in MB
Find-name/path file # search in the/path directory to see if there is any file
Grep-ir "chars" # search for the character string chars in all files in the current directory, and ignore case sensitivity.-I is case sensitivity and-r is the next level Directory.
Press ctrl + c to enter the command, and then enter: x (exit),: x! (Exit and save): w (Write file),: w! (Write files without inquiry),: r file (read file),: % s/oldchars/newchars/g (replace all strings with oldchars newchars ).
Fdisk/dev/hda # just like the fdisk that executes dos
Cfdisk/dev/hda # A little more friendly than the fdisk interface
Mount-t ext2/dev/hda1/mnt # load/dev/hda1 to the/mnt Directory
Df # display information about file system loading
Mount-t iso9660/dev/cdrom/mnt/cdrom # attach the optical drive to the/mnt/cdrom directory.
Mount-t smb // 192.168.1.5/destination dir/mnt-o username = tomlinux, password = tomlinux # load the windows shared directory to the/mnt/smb Directory. the username and password are all tomlinux.
Mount-t nfs 192.168.1.1:/1_dir/mnt # load the shared directory of nfs to the/mnt/nfs Directory
Umount/mnt # unmount the/mnt Directory. The/mnt directory must be idle.
Umount/dev/hda1 # Uninstall the/dev/hda1 device. the device must be empty.
Sync # synchronize the content in the cache with the disk. copy the file in Linux. Generally, the file is written only when the system is idle.
E2fsck/dev/hda1 # check whether/dev/hda1 has a file system error and the system prompts how to fix it.
E2fsck-p/dev/hda1 # Check for/dev/hda1 errors. If yes, it is automatically repaired.
E2fsck-y/dev/hda1 # check errors. all questions are executed in the yes mode.
E2fsck-c/dev/hda1 # check whether the disk has a bad partition
Mkfs/dev/hda1 # Format/dev/hda1 in ext2 format
Mkfs. minix/dev/hda1 # Format/dev/hda1 as a file system in minix format
Mfks/dev/hda9 # lattice/dev/hda9 is in Linux swap format
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.