Home > OS >  Commonly used Linux command daqo (classification clear!!!!! )
Commonly used Linux command daqo (classification clear!!!!! )

Time:12-08

Commonly used Linux command daqo (classification clear!!!!! )
Need to start learning Linux recently, so find some commands, just for your reference:

System information
Display the arch machine architecture
Uname -m display machine processor architecture
Uname -r shows are using the kernel version of
Dmidecode - q display hardware system components - () fix for SMBIOS/DMI)
Hdparm incorrectly listed - I/dev/hda architectural properties of a disk
Hdparm - tT/dev/sda on the disk to perform test reads
The cat/proc/cpuinfo display CPU info information
The cat/proc/interrupts according to interrupt
Cat/proc/meminfo check memory usage
The cat/proc/swaps show which swap used
The cat/proc/version displays the version of the kernel
The cat/proc/net/dev shows the network adapter and statistical
Cat/proc/mounts display loaded file system
Lspci listed - TV PCI devices
Lsusb - TV shows USB device
The date shows system date
CAL 2007 show 2007 calendar table
Date set the date and time - 041217002007.00 month day in years. Second
Amend the time saved to the BIOS clock - w

Shutdown (system shutdown, restart, and logout)
Now shut down the system shutdown - h
Init 0
closed systemTelinit 0
closed systemShutdown - h hours: minutes & amp; According to the scheduled time closed system
Shutdown - c cancelled at predetermined time closed system
Shutdown -r now restart
Reboot to restart
Logout cancellation

File and directory
CD/home into the directory '/home' '
CD.. Back at the next higher level directory
CD../.. Return on two level directory
CD into the personal home directory
CD ~ user1 into personal home directory
CD - returns the last directory
The PWD shows work path
Ls view files in a directory
Ls -f view files in a directory
Ls -l shows details of the file and directory
The ls - a show hidden files
Ls * [0-9] * that contains the number of file names and directory name
Tree display files and directories from the root directory tree structure
Lstree display files and directories from the root directory tree structure
The mkdir dir1-name create a directory called 'dir1-name' '
The mkdir dir1-name dir2 also create two directories
Mkdir -p/TMP/dir1-name/dir2 create a directory tree
The rm -f file1 delete a file called "file1" '
Rmdir dir1-name delete a directory called 'dir1-name' '
Rm - rf dir1-name delete a directory called 'dir1-name and delete its contents at the same time
Rm - rf dir1-name dir2 deleted at the same time two directories and their contents
The mv dir1-name new_dir rename/move a directory
Cp file1 file2 copy a file
Cp dir/*. Copying a directory of all the files to the current working directory
Cp - a/TMP/dir1-name. Copying a directory to the current working directory
Cp - a dir1-name dir2 copying a directory

Cp -r dir1-name dir2 copy a directories and subdirectories
Ln -s file1 lnk1 creates a pointer to a file or directory soft links
Ln file1 lnk1 physical links to create a pointer to a file or directory
Touch - t 0712250000 file1 modify a file or directory timestamp - (YYMMDDhhmm)
The file file1 outputs the mime type of the file as text
Iconv -l lists known coding
Iconv -f fromEncoding -t toEncoding inputFile & gt; OutputFile creates a new from the given input file by assuming it is encoded in fromEncoding and converting it to toEncoding.
The find. - maxdepth 1 - name *. JPG - print - exec convert "{}" - the resize 80 x60 "thumbs/{} \;" Batch resize files in the current directory and send them to the thumbnails directory (the requires the convert from Imagemagick)

File search
The find/-name file1 start with '/' search for files and directories into the root file system
The find/- user user1 search belong to users' user1 'files and directories
Find/home/user1 -name \ *. Bin search in the directory '/home/user1' with 'bin' at the end of the file
The find/usr/bin -type f - atime + 100 search in the past 100 days not is used to perform the file
The find/usr/bin -type f - mtime - 10 search within 10 days is created or modified files
Find/-name \ *. RPM - exec chmod 755 '{} \; Search for 'RPM' at the end of the file and define its permissions
The find/- xdev -name \ *. RPM search to '. The RPM 'at the end of the file, ignore drives home plate, etc. Can be mobile devices
Locate \ *. Ps seek to 'ps' at the end of the file - run' updatedb 'command
Whereis the halt displays a binary file, the location of the source or man
Which the halt to display a full path to the binary or executable file

Mount a file system
Mount/dev/hda2/MNT/hda2 mount a disc - called hda2 determine directory '/MNT/hda2' existing
Umount/dev/hda2 unload a plate - called hda2 first from the mount point "/MNT/hda2 exit
The fuser - km/MNT/hda2 when the device is busy mandatory uninstall
Umount -n/MNT/hda2 run unload operations without written to the/etc/mtab file - when a file is read-only or is useful when the disk write full
Mount/dev/fd0/MNT/floppy mount a floppy disk
Mount/dev/cdrom/MNT/cdrom mount a cdrom or dvdrom
Mount/dev/HDC/MNT/cdrecorder mount a CDRW or dvdrom
Mount/dev/HDB/MNT/cdrecorder mount a CDRW or dvdrom
The mount -o loop file. The iso/MNT/cdrom mount a file or iso image file
The mount -t vfat/dev/hda5/MNT/hda5 mount a Windows FAT32 file system
Mount/dev/sda1/MNT/usbdisk mount a usb jie disk or flash memory device
Mount -t SMBFS -o username=user and password=pass//WinClient/share/MNT/share mount a Windows network share

Disk space
Df -h display the list of partition is mounted
Ls - lSr | more arranged in size file and directory
Du - sh dir1-name estimate directory 'dir1-name' have used disk space '
Du - sk * | sort - rn) based on size, in turn, according to the size of the file and directory
RPM - q - a - qf '10 {NAME} {SIZE} t % % n' | sort - k1, 1 n based on the SIZE of the display has been installed in turn the space used by RPM package (fedora, redhat class system)
DPKG -- query - W f='${Installed - Size; 10} ${Package} n 't | sort - k1, 1 n based on the size of the display installed deb Package used by space (ubuntu, debian system)

Users and groups
Groupadd group_name to create a new user group
Groupdel group_name delete a user group
Groupmod -n new_group_name old_group_name rename a user group
Useradd - c "Name Surname" admin - d - g/home/user1 -s/bin/bash user1 create a user belonging to the "admin" user group
Useradd user1 create a new user
Userdel -r user1 to delete a user (' -r 'exclude home directory)
Usermod - c "User FTP" system - d - g/FTP/user1 -s/bin/nologin user1 modify User attribute
Passwd change password
Passwd user1 to modify a user's password (only allows root to perform)
Chage - 2005-12-31 E user1 set a deadline for the failure of user password
PWCK check '/etc/passwd file format and grammar corrections and existing user
GRPCK check '/etc/passwd file format and grammar corrections and existing group
Newgrp group_name log into a new group so as to change the default group of newly created file

Set the permissions on the file permissions - use "+", use "-" is used to cancel
Ls - lh show permissions
The ls/TMP | pr - T5 - W $COLUMNS will be divided into terminal 5 bar shows
Chmod ugo + RWX directory1 set directory of all the people (u), group (g) and others (o) to read (r), write (w) and execute (x) permission
Chmod go - RWX directory1 delete group (g) and others (o) directory to execute permissions to read and write
Chown user1 file1 change a file all attribute
Chown -r user1 directory1 change a directory of all properties and change at the same time to change the attribute of all files in directory
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull