Some basic knowledge about Linux

Source: Internet
Author: User

I. Basic

1.linux all content is saved as a file, including hardware.

2.linux does not differentiate between extensions, by permissions. #但是, contract. SH script file. conf configuration file.

3.-rw-r--r--#第一位 (-file, D directory, l soft link file), followed by each three-bit group (U owner G-owned by O others), (R read W write X performed).

4.cd./xxx/xxx #从当前路径开始.

5. Common directory function:/root directory/home directory/root Super User home Directory

Two. Common commands

1.LS-LH = = ll
Ls-a Show hidden files

2.MKDIR-P Catalog #建目录
Touch Directory #建文档
PWD #查看当前位置

3.cd/#进入根目录
CD #进入家目录
cd-#进入上次目录
Cd.. #进入上级目录

4. Delete directory: rmdir empty directory
RM-RF/File name/

5.cp-r file name/directory name/changed file name #复制
MV Original file target directory #剪切, renamed

6.cat file name #打印文件内容
Edit mode: VI i:wq! (save): q! (Not Saved)

7.echo 1111 >> File #写入
Establish Link: ln-s original file (absolute path) soft link #相当于windows下的快捷方式
ln Original file Hard link
8.updatedb #更新数据库

Search command: Locate file name

Whereis ls (-m/-b)
which LS
Whatis ls

Find search scope search criteria     
   find/root/-name file name       & nbsp -iname (case insensitive)
   find/var/log/-mtime-10
   find-size 25k    &nbs p;     -A and  -O or
   find/etc/-size +20k-a-size-50k-exec ls-lh {} \;       #大于20k且小于50k的文件并执行ls-lh
   grep-v "string" File name     &nb sp;  -V Reverse  -I is case insensitive

9. View the command:
man-f command = Whatis command command level
Man level command Details
Apropos-k passwd
LS--help
Help CD get Internal command (Whereis cannot find the path)
Info

10. Compression command:. zip. gz. bz2

Zip A.zip a pressurized
Unzip A.zip Decompression


Gzip Hehe.txt
Gzip-c hehe.txt > hehe.gz compression without deleting the original file

Gzip-r W to add and decompress a directory
Gunzip-r W

bzip2 hehe
Bzip2-k hehe
BUNZIP2 hehe.bz2

Package compression: tar.gz tar.bz2:
TAR-ZCVF w.tar.gz W
TAR-ZXVF w.tar.gz ls

TAR-JCVF w.tar.bz2 W
TAR-JXVF w.tar.bz2-c d/

11. Shutdown and restart:
Shutdown-c: Cancels the previous shutdown command
-H: Shutdown
-R: Restart
& Background Enable
Logout logout = logoff under windows

12. Mount command (allocation letter):
Mount device file name (/dev/cdrom) mount point (/mnt/cdrom)
Uninstall: Umount device name or mount point
Vi/etc/fstab

VI hello.sh
#!bin/bash
echo "Hello World"
chmod 755 hello.sh (Give execute permission)
./hello.sh the hello.sh file in the current directory

Fdisk-l Viewing device file names
Mount-t vfat/dev/sdb1/mnt/usb/#对dvd的挂载

13. View User Login command: w
W.H.O.
Last
Lastlog


Some basic knowledge about Linux

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.