C Language Training first day

Source: Internet
Author: User
Tags create directory

"1" Open Terminal 1---CTRL + AIT + t//new open a terminal
2---CTRL + SHIFT + n//with open terminal
3---CTRL + SHIFT + t//with "2" Linux @ Ubuntu on open Terminal: ~ $

User name hostname path command prompt ~//home directory = = "/home/linux/
Root directory, the origin of all files under Linux

$//General user Rights
#//Super User privileges

"3" ls
View files under the current path

"4" CD
Path switching

cd//Direct Switch Home directory
CD///switch directly to the root directory
CD directory name//switch to the specified directory
Cd.. Switch to the previous level directory
CD-//switch to the previous catalog

"4" Su
Switch User's commands
SU root//Switch Super User
exit//Exit User

"5" passwd
sudo//Getting temporary Administrator privileges
sudo passwd root//Modify the root user's password

"6" mkdir
mkdir directory Name//create directory
RmDir directory name//delete empty directory

"7" Touch
Touch 1.txt//Create a file

"8" rm
RM 1.txt//Deleting files
RM Directory name-rf//Delete directory

"9" ls
ls-l//Displays the details of the file under the current path as a list
ls-a//View all files (including hidden files)


D rwx rwx r-x 8 linux linux 4096 Mar 12:02 DIR
Type rights link number user name Group name file size time file name


"10" File type (7 types)
The thought of all documents (BCD-LSP)
b//Block device files
c//Character device files
d//Directory
-//Common Files
l//Link File
s//Socket File
p//Pipeline File

"11" File permissions
RWX rwx R-x

r//Readable permissions
w//Writable Permissions
x//Executable Permissions

First group: User's own permissions
Second group: Permissions for members of the same group
Group Three: Other user rights without a relationship

"12"
.. Upper-level path
.//Current path


"13" Echo
echo "Hello"//to Terminal (standard output) output string
echo "ddd0" >>3.txt >> redirect Output

"14" VIM (editor)

1---VI 3.txt
2---Command mode (ESC)
yy//replication
dd//Cut (delete a row)
p//paste
u//Revocation
ctrl+r//Anti-Revocation
gg//cursor moves to the first line of the file
g//cursor moves to the end of the file

Noh Noh Find highlight Cancel


3---Input mode (command mode and input mode)
i//start inserting data from the cursor position
a//inserting data from behind the cursor position
i//inserting data from the first non-whitespace character in the cursor column
a//starting with the cursor at the very back of the line to add data
o//adds a column under the cursor column and enters input mode
o//adds a column above the cursor column and enters input mode

4---Bottom row mode (ESC:)
w//Save
q//exit
wq//Save exit

W! Force Save
q!//forced exit

VSP 1.txt//left and right split screen display
SP 1.txt//Sub-screen display

%s/hello/1234/g//Replace All "Hello" files with "1234"
7,14s/hello/hello/g//Replace the "Hello" in the file 7-14 line with "Hello"
Noh

"15" Cat

Cat 1.txt//Print the contents of the file to the terminal

"16" CP
CP 1.txt filename//File backup
CP 1.txt dirname//Copying files to a different directory

"17" MV
MV 1.txt.. Move a file to the top-level path
MV 2.txt DirName

"18" GCC
1---gcc 1.c//generates a binary a.out by default
./a.out//executing an executable file


2---gcc 1.c-o hello//specifies the output of a hello executable file
./hello


3---Four step full compilation process

Preprocessing: Major macro substitution and the inclusion of a header file to expand
GCC-E Hello.c-o hello.i

Compile: Compile to generate assembly file, check syntax for errors
Gcc-s Hello.i-o Hello.s

Compilation: Compiling assembly files to generate target files (binary files)
Gcc-c Hello.s-o hello.o

Links: link library functions, generating executables
GCC Hello.o-o Hello

4---Two-step compilation process

Compilation: Compiling assembly files to generate target files (binary files)
Gcc-c Hello.c-o hello.o

Links: link library functions, generating executables
GCC Hello.o-o Hello


"19" Numeric representation

Man ascii//view ASCII code table

' 0 ' a ' ~ ' z ' a ' z ' \ n ' Space

48 65~90 97~ 122 10 32


' + ' (end of string flag)
0

difference between uppercase and lowercase characters: 32


"20" Code trace debugging

__LINE__//number of lines where the code is located
The function where the __function__//code resides
The file where the __file__//code resides

C Language Training first day

Related Article

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.