Linux common command classification collection

Time:2019-12-2

1. System information

arch                    
		#Display the processor architecture of the machine (1) 
		uname -m                
		#Display the processor architecture of the machine (2) 
		uname -r                
		#Show the kernel version in use 
		dmidecode -q            
		#Display hardware system components - (SMBIOS / DMI) 
		hdparm -i /dev/hda      
		#List the architecture features of a disk 
		hdparm -tT /dev/sda     
		#Performing a test read operation on disk 
		cat /proc/cpuinfo       
		#Display information about CPU info 
		cat /proc/interrupts    
		Interruption 
		cat /proc/meminfo       
		#Verify memory usage 
		cat /proc/swaps         
		#Show which swap is used 
		cat /proc/version       
		#Show kernel version 
		cat /proc/net/dev       
		#Display network adapter and statistics 
		cat /proc/mounts        
		#Show loaded file systems 
		lspci -tv               
		#List PCI devices 
		lsusb -tv               
		#Display USB device 
		date                    
		#Display system date 
		cal 2007                
		#Show calendar for 2007 
		date 041217002007.00    
		#Set date and time month day time year second 
		clock -w                
#Save time changes to BIOS

2. shutdown

(shutdown, restart and logout of the system) 
		shutdown -h now             
		#Shut down the system (1) 
		init 0                      
		#Shut down the system (2) 
		telinit 0                   
		#Shut down the system (3) 
		shutdown -h hours:minutes & 
		#Turn off the system according to the scheduled time during background operation 
		shutdown -c                 
		#Cancel system shutdown at scheduled time 
		shutdown -r now             
		Reboot (1) 
		reboot                      
		Reboot (2) 
		logout                      
Write off

3. Documents and directories

cd /home                              
		#Enter '/ home' directory ' 
		cd ..                                 
		#Return to the previous directory 
		cd ../..                              
		#Return to the previous two levels of directory 
		cd                                    
		#Enter a directory 
		cd ~user1                             
		#Enter personal home directory 
		cd -                                               
		#Return to last directory 
		pwd                                                
		#Show work path 
		ls                                                 
		#View files in directory 
		ls -F                                              
		#View files in directory 
		ls -l                                              
		#Show file and catalog details 
		ls -a                                              
		#Show hidden files 
		ls *[0-9]*                                         
		#Display file and directory names with numbers 
		tree                                               
		#Displays the tree structure of files and directories starting from the root (1) 
		lstree                                             
		#Displays the tree structure of files and directories starting from the root (2) 
		mkdir dir1                                         
		#Create a directory called 'dir1' 
		mkdir dir1 dir2                                    
		#Create two directories at the same time 
		mkdir -p /tmp/dir1/dir2                            
		#Create a tree 
		rm -f file1                                        
		#Delete a file called 'file1' 
		rmdir dir1                                         
		#Delete a directory called 'dir1' 
		rm -rf dir1                                        
		#Delete a directory called 'dir1' and delete its contents at the same time 
		rm -rf dir1 dir2                                   
		#Delete two directories and their contents at the same time 
		mv dir1 new_dir                                    
		#Rename / move a directory 
		cp file1 file2                                     
		#Copy a file 
		cp dir/* .                                         
		#Copy all files in one directory to the current working directory 
		cp -a /tmp/dir1 .                                  
		#Copy a directory to the current working directory 
		cp -a dir1 dir2                                    
		#Copy a directory 
		ln -s file1 lnk1                                   
		#Create a soft link to a file or directory 
		ln file1 lnk1                                      
		#Create a physical link to a file or directory 
		touch -t 0712250000 file1                          
		#Modify the timestamp of a file or directory - (yymmddhhmm) 
		file filename                                      
		#Output file type and encoding format 
		iconv -l                                           
		#Lists the encoding list supported by iconv. This command is used to transform the encoding of files
		echo $LANG                                         
		#View the encoding format of the current operating system
		iconv -f UTF-8 -t GBK file1 -o file2               
		#Convert the utf8 encoded file1 to GBK and output to File2
find . -maxdepth 1 -name *.jpg -print -exec convert "{}" -resize 80x60 "thumbs/{}" \; batch

4. File search

find / -name file1                                       
		#Enter the root file system from '/' to search for files and directories 
		find / -user user1                                       
		#Search for files and directories belonging to user 'user1' 
		find /home/user1 -name \*.bin                            
		#Search directory '/ home / user1' for files ending in '. Bin' 
		find /usr/bin -type f -atime +100                        
		#Search for executables that have not been used in the past 100 days 
		find /usr/bin -type f -mtime -10                         
		#Search for files created or modified within 10 days 
		find / -name \*.rpm -exec chmod 755 '{}' \;              
		#Search for files ending in '. RPM' and define their permissions 
		find / -xdev -name \*.rpm                                
		#Search for files ending in '. RPM', ignoring removable devices such as optical drives, agile disks, etc 
		locate \*.ps                                             
		#Find files ending in '. PS' - run' updatedb 'first 
		whereis halt                                             
		#Show the location of a binary, source, or man 
		which halt                                               
#Displays the full path of a binary or executable

5. Mount a file system

mount /dev/hda2 /mnt/hda2                      
		#Mount a disk called hda2 - make sure the directory '/ MNT / hda2' already exists 
		umount /dev/hda2                               
		#Unload a disk called hda2 - exit from mount point '/ MNT / hda2' first 
		fuser -km /mnt/hda2                            
		#Force uninstall when device is busy 
		umount -n /mnt/hda2                            
		#Run the unload operation without writing to the / etc / mtab file - useful when the file is read-only or when the disk is full 
		mount /dev/fd0 /mnt/floppy                     
		#Mount a diskette 
		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 
		mount -o loop file.iso /mnt/cdrom              
		#Mount a file or ISO image file 
		mount -t vfat /dev/hda5 /mnt/hda5              
		#Mount a Windows FAT32 file system 
		mount /dev/sda1 /mnt/usbdisk                   
		#Mount a USB flash disk or flash device 
		mount -t smbfs -o username=user,password=pass //WinClient/share /mnt/share 
             
#Mount a Windows network share

6. Disk space

df -h                            
		#Display the list of mounted partitions 
		ls -lSr |more                    
		#Arrange files and directories by size 
		du -sh dir1                      
		#Estimate disk space already used by directory 'dir1' 
		du -sk * | sort -rn              
		#Display the size of files and directories based on their capacity 
		rpm -q -a --qf '%10{SIZE}t%{NAME}n' | sort -k1,1n              
		#Display the space used by the installed RPM package based on its size (Fedora, RedHat class system) 
		dpkg-query -W -f='${Installed-Size;10}t${Package}n' | sort -k1,1n              
#Display the space used by the installed DEB package based on its size (Ubuntu, Debian class system)

7. Users and groups

groupadd group_name                                    
		#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 " -g admin -d /home/user1 -s /bin/bash user1              
		#Create a user who belongs to the "admin" user group 
		useradd user1                                          
		#Create a new user 
		userdel -r user1                                       
		#Delete a user ('- R' exclude home directory) 
		usermod -c "User FTP" -g system -d /ftp/user1 -s /bin/nologin user1              
		#Modify user properties 
		passwd                                               
		#Change password 
		passwd user1                                         
		#Change the password of a user (only root is allowed to execute) 
		chage -E 2005-12-31 user1                            
		#Set expiration date of user password 
		pwck                                                 
		#Verify the integrity of content and format of system authentication files / etc / passwd and / etc / shadow
		grpck                                                
		#Check the file format, syntax correction and existing groups of '/ etc / passwd' 
		newgrp group_name                                    
#Log in to a new group to change the default group for the newly created file

8. Permission of documents

  • Use “+” to set permissions and “-” to cancel
ls -lh                                       
		#Display permissions 
		ls /tmp | pr -T5 -W$COLUMNS                  
		#Divide the terminal into 5 columns for display 
		chmod ugo+rwx directory1                     
		#Set the permissions of directory owner (U), group (g), and others (o) to read (R), write (W), and execute (x) 
		chmod go-rwx directory1                      
		#Delete group (g) and other people (o) read and write access to the directory 
		chown user1 file1                            
		#Change the owner property of a file 
		chown -R user1 directory1                    
		#Change the owner property of a directory and change the property of all files in the directory at the same time 
		chgrp group1 file1                           
		#Change the group of files 
		chown user1:group1 file1                     
		#Change the owner and group properties of a file 
		find / -perm -u+s                            
		#List all the files controlled by suid in a system 
		chmod u+s /bin/file1                         
		#Set the suid bit of a binary file - the user running the file is given the same permissions as the owner 
		chmod u-s /bin/file1                         
		#Disable the suid bit of a binary 
		chmod g+s /home/public                       
		#Set the sgid bit of a directory - similar to suid, but this is for the directory 
		chmod g-s /home/public                       
		#Disable the sgid bit of a directory 
		chmod o+t /home/public                       
		#Set the stiky bit of a file - only legal owners are allowed to delete files 
		chmod o-t /home/public                       
#Disable the stiky bit of a directory

9. Special properties of documents

  • Use “+” to set permissions and “-” to cancel
chattr +a file1                      
		#Only files can be read and written in append mode 
		chattr +c file1                      
		#Allow this file to be automatically compressed / decompressed by the kernel 
		chattr +d file1                      
		#During a file system backup, the dump program ignores this file 
		chattr +i file1                      
		#Set as immutable file and cannot be deleted, modified, renamed or linked 
		chattr +s file1                      
		#Allow a file to be deleted safely 
		chattr +S file1                      
		#Once the application program writes to the file, the system writes the modified result to disk immediately 
		chattr +u file1                      
		#If the file is deleted, the system will allow you to recover the deleted file later 
		lsattr                               
#Show special properties

10. Package and compress files

bunzip2 file1.bz2                                    
		#Unzip a file called 'file1. Bz2' 
		bzip2 file1                                          
		#Compress a file called 'file1' 
		gunzip file1.gz                                      
		#Unzip a file called 'file1. GZ' 
		gzip file1                                           
		#Compress a file called 'file1' 
		gzip -9 file1                                        
		#Maximum compression 
		rar a file1.rar test_file                            
		#Create a package called 'file1. Rar' 
		rar a file1.rar file1 file2 dir1                     
		#Compress' file1 ',' File2 'and directory' dir1 'at the same time 
		rar x file1.rar                                      
		#Unzip rar package 
		unrar x file1.rar                                    
		#Unzip rar package 
		tar -cvf archive.tar file1                           
		#Create an uncompressed tarball 
		tar -cvf archive.tar file1 file2 dir1                
		#Create a file containing 'file1', 'File2' and 'dir1' 
		tar -tf archive.tar                                  
		#Show the contents of a package 
		tar -xvf archive.tar                                 
		#Release a package 
		tar -xvf archive.tar -C /tmp                         
		#Release the compressed package to the / tmp directory 
		tar -cvfj archive.tar.bz2 dir1                       
		#Create a compressed package in bzip2 format 
		tar -xvfj archive.tar.bz2                            
		#Decompress a compressed package in bzip2 format 
		tar -cvfz archive.tar.gz dir1                        
		#Create a gzip compressed package 
		tar -xvfz archive.tar.gz                             
		#Decompress a gzip compressed package 
		zip file1.zip file1                                  
		#Create a zip package 
		zip -r file1.zip file1 file2 dir1                    
		#Compress several files and directories into a zip package at the same time 
		unzip file1.zip                                      
#Decompress a zip package

11.RPM package

-(Fedora, RedHat and similar systems) 
		rpm -ivh package.rpm                                 
		#Install an RPM package 
		rpm -ivh --nodeeps package.rpm                       
		#Install an RPM package而忽略依赖关系警告 
		rpm -U package.rpm                                   
		#Update an RPM package without changing its configuration file 
		rpm -F package.rpm                                   
		#Update an RPM package to confirm that it has been installed 
		rpm -e package_name.rpm                              
		#Delete an RPM package 
		rpm -qa                                              
		#Display all installed RPM packages in the system 
		rpm -qa | grep httpd                                 
		#Display all RPM packages with "httpd" in their names 
		rpm -qi package_name                                 
		#Get special information about an installed package 
		rpm -qg "System Environment/Daemons"                 
		#Display the RPM package of a component 
		rpm -ql package_name                                 
		#Displays a list of files provided by an installed RPM package 
		rpm -qc package_name                                 
		#Displays a list of profiles provided by an installed RPM package 
		rpm -q package_name --whatrequires                   
		#Displays a list of dependencies with an RPM package 
		rpm -q package_name --whatprovides                   
		#Display the volume of an RPM package 
		rpm -q package_name --scripts                        
		#Show scripts executed during install / remove 
		rpm -q package_name --changelog                      
		#Display the modification history of an RPM package 
		rpm -qf /etc/httpd/conf/httpd.conf                   
		#Confirm which RPM package provides the given file 
		rpm -qp package.rpm -l                               
		#Displays a list of files provided by an RPM package that has not been installed 
		rpm --import /media/cdrom/RPM-GPG-KEY                
		#Import public key digital certificate 
		rpm --checksig package.rpm                           
		#Verify the integrity of an RPM package 
		rpm -qa gpg-pubkey                                   
		#Verify the integrity of all installed RPM packages 
		rpm -V package_name                                  
		#Check file size, license, type, owner, group, MD5 check and last modified time 
		rpm -Va                                              
		#Check all installed RPM packages in the system - use with care 
		rpm -Vp package.rpm                                  
		#Verify that an RPM package is not installed 
		rpm2cpio package.rpm | cpio --extract --make-directories *bin*              
		#Run the executable from an RPM package 
		rpm -ivh /usr/src/redhat/RPMS/`arch`/package.rpm                            
		#Install a built package from an RPM source 
		rpmbuild --rebuild package_name.src.rpm                                     
#Building an RPM package from an RPM source

12. Yum package upgrader

-(Fedora, RedHat and similar systems) 
		yum install package_name                       
		#Download and install an RPM package 
		yum localinstall package_name.rpm              
		#An RPM package will be installed to use your own software repository to resolve all dependencies for you 
		yum update package_name.rpm                    
		#Update all installed RPM packages in the current system 
		yum update package_name                        
		#Update an RPM package 
		yum remove package_name                        
		#Delete an RPM package 
		yum list                                       
		#List all packages installed in the current system 
		yum search package_name                        
		#Searching for software package in RPM warehouse 
		yum clean packages                             
		#Clean up RPM cache delete downloaded package 
		yum clean headers                              
		#Delete all header files 
		yum clean all                                  
#Delete all cached package and header files

13.DEB package

(Debian, Ubuntu and similar systems) 
		dpkg -i package.deb                          
		#Install / update a DEB package 
		dpkg -r package_name                         
		#Remove a DEB package from the system 
		dpkg -l                                      
		#Display all installed DEB packages in the system 
		dpkg -l | grep httpd                         
		#Show DEB packages with "httpd" in all names 
		dpkg -s package_name                         
		#Get information about a special package that is already installed in the system 
		dpkg -L package_name                         
		#Display the list of files provided by a DEB package installed in the system 
		dpkg --contents package.deb                  
		#Displays a list of files provided by a package that has not been installed 
		dpkg -S /bin/ping                            
#Confirm which DEB package provides the given file

14. Apt software tools

(Debian, Ubuntu and similar systems) 
		apt-get install package_name                     
		#Install / update a DEB package 
		apt-cdrom install package_name                   
		#Install / update a DEB package from CD 
		apt-get update                                   
		#Packages in upgrade list 
		apt-get upgrade                                  
		#Upgrade all installed software 
		apt-get remove package_name                      
		#Remove a DEB package from the system 
		apt-get check                                    
		#Confirm that the dependent software warehouse is correct 
		apt-get clean                                    
		#Clean cache from downloaded packages 
		apt-cache search searched-package                
#Returns the package name containing the string to search for

15. View document content

cat file1                                    
		#View the contents of the file forward from the first byte 
		tac file1                                    
		#Reverse viewing the contents of a file from the last line 
		more file1                                   
		#View the contents of a long file 
		less file1                                   
		#Similar to the 'more' command, but it allows the same reverse operation in the file as the forward operation 
		head -2 file1                                
		#View the first two lines of a file 
		tail -2 file1                                
		#View the last two lines of a file 
		tail -f /var/log/messages                    
#View content added to a file in real time

16. Text processing

cat file1 file2                                          
		#Check the contents of two documents
		cat file1 | command( sed, grep, awk, grep, etc...) > result.txt               
		#Merge the detailed description text of a file and write the introduction to a new file 
		cat file1 | command( sed, grep, awk, grep, etc...) >> result.txt              
		#Merge the detailed description text of a file and write the introduction to an existing file 
		grep Aug /var/log/messages                               
		#Find the keyword "Aug" in the file '/ var / log / messages' 
		grep ^Aug /var/log/messages                              
		#Find words starting with "Aug" in file '/ var / log / messages' 
		grep [0-9] /var/log/messages                             
		#Select all lines containing numbers in the '/ var / log / messages' file 
		grep Aug -R /var/log/*                                   
		#Search the directory '/ var / log' and subsequent directories for the string "Aug" 
		sed 's/stringa1/stringa2/g'                              
		#Example.txt replace "string1" in the example.txt file with "string2" 
		sed '/^$/d' example.txt                                  
		#Remove all blank lines from the example.txt file 
		sed '/ *             
		#/d; /^$/d'                                      
		#Example.txt remove all comments and blank lines from the example.txt file 
		echo 'esempio' | tr '[:lower:]' '[:upper:]'              
		#Merge upper and lower cell contents 
		sed -e '1d' result.txt                                   
		#Exclude the first line from the file example.txt 
		sed -n '/stringa1/p'                                     
		#View rows containing only the term "string1" 
		sed -e 's/ *$//' example.txt                             
		#Delete the last blank character in each line 
		sed -e 's/stringa1//g' example.txt                       
		#Remove only the word "string1" from the document and keep the rest 
		sed -n '1,5p;5q' example.txt                             
		#View from line 1 to line 5 
		sed -n '5p;5q' example.txt                               
		#View line 5 
		sed -e 's/00*/0/g' example.txt                           
		#Replace multiple zeros with a single zero 
		cat -n file1                                             
		#Number of lines indicating the file 
		cat example.txt | awk 'NR%2==1'                          
		#Delete all even lines in the example.txt file 
		echo a b c | awk '{print $1}'                            
		#View the first column of a row 
		echo a b c | awk '{print $1,$3}'                         
		#View the first and third columns of a row 
		paste file1 file2                                        
		#Merge the contents of two files or two columns 
		paste -d '+' file1 file2                                 
		#Merge the contents of two files or two columns,中间用"+"区分 
		sort file1 file2                                         
		#Sort the contents of two files 
		sort file1 file2 | uniq                                  
		#Take out the union of two files (only one duplicate line is reserved) 
		sort file1 file2 | uniq -u                               
		#Delete intersection, leave other lines 
		sort file1 file2 | uniq -d                               
		#Extract the intersection of two files (only files that exist in both files) 
		comm -1 file1 file2                                      
		#Comparing the contents of two files only removes the contents of 'file1' 
		comm -2 file1 file2                                      
		#Comparing the contents of two files only removes the contents of 'File2' 
		comm -3 file1 file2                                      
#Comparing the contents of two files only removes the common parts of two files

17. Character setting and file format conversion

dos2unix filedos.txt fileunix.txt                        
		#Converting a text file format from MSDOS to UNIX 
		unix2dos fileunix.txt filedos.txt                        
		#Converting a text file format from UNIX to MSDOS 
		recode ..HTML < page.txt > page.html                     
		#Convert a text file to HTML 
		recode -l | more                                         
#Show all allowed conversion formats

18. File system analysis

badblocks -v /dev/hda1                           
		#Check the bad block on disk hda1 
		fsck /dev/hda1                                   
		#Repair / check the integrity of Linux file system on hda1 disk 
		fsck.ext2 /dev/hda1                              
		#Repair / check the integrity of EXT2 file system on hda1 disk 
		e2fsck /dev/hda1                                 
		#Repair / check the integrity of EXT2 file system on hda1 disk 
		e2fsck -j /dev/hda1                              
		#Repair / check the integrity of ext3 file system on hda1 disk 
		fsck.ext3 /dev/hda1                              
		#Repair / check the integrity of ext3 file system on hda1 disk 
		fsck.vfat /dev/hda1                              
		#Repair / check the integrity of fat file system on hda1 disk 
		fsck.msdos /dev/hda1                             
		#Repair / check the integrity of DOS file system on hda1 disk 
		dosfsck /dev/hda1                                
#Repair / check the integrity of DOS file system on hda1 disk

19. Initialize a file system

mkfs /dev/hda1                               
		#Create a file system in the hda1 partition 
		mke2fs /dev/hda1                             
		#Create a Linux EXT2 file system in hda1 partition 
		mke2fs -j /dev/hda1                          
		#Create a Linux ext3 (log based) file system in the hda1 partition 
		mkfs -t vfat 32 -F /dev/hda1                 
		#Create a FAT32 file system 
		fdformat -n /dev/fd0                         
		#Format a diskette 
		mkswap /dev/hda3                             
#Create a swap file system

20. Swap file system

mkswap /dev/hda3                         
		#Create a swap file system 
		swapon /dev/hda3                         
		#Enable a new swap file system 
		swapon /dev/hda2 /dev/hdb3               
#Enable two swap partitions

21. backup

dump -0aj -f /tmp/home0.bak /home              
		#Make a full backup of the '/ home' directory 
		dump -1aj -f /tmp/home0.bak /home              
		#Make an interactive backup of the '/ home' directory 
		restore -if /tmp/home0.bak                     
		#Restore an interactive backup 
		rsync -rogpav --delete /home /tmp              
		#Synchronize directories on both sides 
		rsync -rogpav -e ssh --delete /home ip_address:/tmp              
		#Rsync through SSH channel 
		rsync -az -e ssh --delete ip_addr:/home/public /home/local              
		#Synchronize a remote directory to a local directory through SSH and compression 
		rsync -az -e ssh --delete /home/local ip_addr:/home/public              
		#Synchronize local directory to remote directory through SSH and compression 
		dd bs=1M if=/dev/hda | gzip | ssh [email protected]_addr 'dd of=hda.gz'              
		#Perform a backup operation of local disk on the remote host through SSH 
		DD if = / dev / SDA of = / TMP / file1 backup disk contents to a file 
		Tar - PUF backup.tar/home/user perform one pair of '/ home / user'              
		#Interactive backup operation of directory 
		( cd /tmp/local/ && tar c . ) | ssh -C [email protected]_addr 'cd /home/share/ && tar x -p'              
		#Copy a directory content in the remote directory through SSH 
		( tar c /home ) | ssh -C [email protected]_addr 'cd /home/backup-home && tar x -p'              
		#Copy a local directory in the remote directory through SSH 
		tar cf - . | (cd /tmp/backup ; tar xf - )              
		#Copy one directory to another locally, and keep the original permissions and links 

             
		#Find and copy all files ending in '. TXT' from one directory to another 
		find /home/user1 -name '*.txt' | xargs cp -av --target-directory=/home/backup/ --parents 

             
		#Find all files ending in '. Log' and make a bZIP package 
		find /var/log -name '*.log' | tar cv --files-from=- | bzip2 > log.tar.bz2 
		dd if=/dev/hda of=/dev/fd0 bs=512 count=1              
		#Make an action to copy the contents of MBR (master boot record) to floppy disk 
		dd if=/dev/fd0 of=/dev/hda bs=512 count=1              
#Recover MBR content from a backup that has been saved to a floppy disk

22. CD

mkisofs /dev/cdrom > cd.iso                                     
		#Create an ISO image file of a disc on disk 
		mkisofs /dev/cdrom | gzip > cd_iso.gz                           
		#Create a compressed disc ISO image file on disk 
		mkisofs -J -allow-leading-dots -R -V "Label CD" -iso-level 4 -o ./cd.iso data_cd              
		#Create an ISO image file of a directory 
		cdrecord -v dev=/dev/cdrom cd.iso                               
		#Burn an ISO image file 
		gzip -dc cd_iso.gz | cdrecord dev=/dev/cdrom -                  
		#Burn a compressed ISO image file 
		mount -o loop cd.iso /mnt/iso                                   
		#Mount an ISO image file 
		cd-paranoia -B                                                  
		#Transcribe audio track from a CD to WAV file 
		cd-paranoia -- "-3"                                             
		#Transcribe audio track from a CD to WAV file(参数-3) 
		cdrecord --scanbus                                              
		#Scan the bus to identify the SCSI channel 
		cdrecord -v gracetime=2 dev=/dev/cdrom -eject blank=fast -force              
		#Empty a CD that can be copied 
		dd if=/dev/hdc | md5sum                                         
#Check the md5sum code of a device, such as a CD