8.23 Technical Documents

Shutdown (system shutdown, restart and Sign):
the shutdown -H now closed system
init 0 Close system
telinit 0 Close system
shutdown -h hours: minutes & shutdown of the system time
shutdown -c cancel shutdown of the system time
shutdown -r now reboot
reboot reboot
logout Logs

Files and directories:
cd / Home enter '/ home' directory '
cd .. go back one level
cd ../ .. Return two directory
cd go to home directory
cd ~ user1 go to home directory
cd - Back last directory where
pwd show the path of work
ls view files in a directory
ls -F view files in a directory
ls -l show details of files and directories
ls -a show hidden files
ls [0-9] to display files that contain numbers and directory names
tree displays a tree structure of files and directories starting from the root directory
lstree display files and directories starting from the root of the tree
mkdir dir1 create a 'dir1' directory is called '
mkdir dir1 dir2 create two directories simultaneously
mkdir - p / tmp / dir1 / dir2 create a directory tree
rm -f file1 delete called 'file1' file '
dir1' directory 'rmdir dir1 delete called'
RM -rf dir1 delete a 'dir1' and delete the directory named its contents
rm -rf dir1 dir2 remove two directories at the same time and their contents
mv dir1 new_dir rename / move a directory
cp file1 file2 copying a file
cp dir / *. Copy all files in a directory to the current working directory
cp -a / tmp / dir1. copy a directory within the current work directory
cp -a dir1 dir2 copy a directory
ln -s file1 lnk1 create a link to a file or directory the soft link
file1 lnk1 create a link to the file or directory physical link LN
Touch -t 0.71225 billion file1 modify a file or directory timestamp - (YYMMDDhhmm)
file file1 the Outputs at the MIME of the type of text at the file AS
iconv the -l lists known coding

File search:
Find / -name file1 from the '/' entered the root file system search file and directory
files and directories find / -user user1 search belongs to the user 'user1' of

find / hom large column  8.23 Technical Documentation e / user1 -name * .bin in the directory '/ home / user1' search for files that end with '.bin'

find / usr / bin -type f -atime +100 searched in the past 100 days has not been used to perform file

find / usr / bin -type f -mtime -10 search is created or modified files within 10 days

find / -name * .rpm -exec chmod 755 '{}'; search files ending in '.rpm' and define permissions

find / -xdev -name * .rpm search files ending in '.rpm', ignoring drive, a removable disk device, Czech Republic

Looking to locate * .ps '.ps' end of the document - first run 'updatedb' command
whereis halt show location of a binary file, source or man of

which halt show full path to a binary file or executable file

Backup:
dump [Options] to back up the file name of the original file or directory options:
-0 ~ 9 nine backup level
-f File name: specify the backup file name after the
-u: After a successful backup, the backup time recorded in / etc / dumpdates file
-v: backup process significantly more output
-j: .bz2 compressed file format
-W: display allowed dump partition board level backup time and backup
Example: dump -0uj -f / root / boot .bak.bz2 / boot
backup commands, perform a full backup, and backup compression and update time:
CAT / etc / dumpdates
view the backup files:
cp install.log / boot /
copy the log files to the boot partition:
dump -1uj - f /root/boot,bak1.bz2 / boot /
incremental backup / boot partition, and compression:
dump -W
backup time and backup partition query level:
backup files or directories, can only perform a full backup with 0 level, and do not supports incremental backups:
dump -0j /root/etc.dump.bz2 -f / etc /

Restore the backup:
Restore [mode option] [option]
There are four modes can not be mixed.
-C: change the backup data and compare actual data
-i: enters interactive mode, manually select the desired file recovery
-t: view mode, which is used to view data files have
to restore mode for data reduction: -r
option:
-f: Specifies the file name of the backup file

Guess you like

Origin www.cnblogs.com/liuzhongrong/p/12371538.html