Linux C learning day1

vm:
Start ubuntu system corresponding tools

Ubuntu Introduction
kernel Linux, is written in C, the code amount of 6 million
system designed for programmers, open source, free
Ubuntu has a cross-platform functionality, can be used with any CPU architecture ( x86, x64, ARM)
after recommendations are developed on the Ubuntu

Ubuntu using
control via the terminal operating system
on the terminal through a shell command control operating system



opened terminal
ctrl + alt + t

to update the software
sudo APT-GET install xxx



shell command:
GEC @ubuntu: ~ $
gec: username
Ubuntu: system name
~: gec user's directory, in fact - is a relative path to help us enter gec directory
$: permission
$: normal user privileges
#: superuser privileges


ordinary users to permanently switch superuser way:
sudo -s (not recommended)

super user to switch the way for the average user:
su GEC (general user name)

temporarily switch to super user (recommended)
sudo xxx (shell command)



shell command:
LS : View directory information
ls -l: lists the directory information and obtains the corresponding attribute

file attribute
-rwxrwxr-x 1 zyx zyx 8608 Aug 19 16:06 a.out

first letter:
-: normal file
d: directory file
c: character device file (driver file)
b: block device file (drivers)
the p-: pipe file between (interprocess communication)
S: network file
l: link file (to the file to an alias, facilitate our operations)

summary: everything is a file in Linux

rwxrwxr the -X-: file permissions

r: read permission
w: write access
x: authority running the operation

of the bit:
1: Indicates the authority
0: this indicates no permission to

the front three-letter represents the file permissions of the owner,
the middle three a permission letter on behalf of the group owning the file,
permissions to other users of the last three letters represent the system.

chmod xxx (permissions) file name
xxx octal number represents the authority,
the first authority on behalf of the owner of the file
permissions second representative file belongs to the group of
permissions to other users of the system represents the third
example:
modify hello.c under the ~ file permissions for the
user has read and execute permissions, no write permission
r - x 5
The group has performed write this file not have read permission
- wx 3
other users have read and write permissions to execute
rwx. 7
the chmod 537 hello.c
// run results
-rx-wxrwx 1 gec gec 73 Aug 19 16:06 hello. c

1: the number of links
gec: owned by user
gec: files user group belongs
Aug 19 16:06: file creation time
hello.c: file name

ls -a: show hidden files, but the more important files are not frequently used


special characters:
/: root directory systems, like Windows C drive, have restricted access
~: user Contents (user home directory), absence of rights restrictions
: current directory ./
..: parent directory ../

cd : enter a directory

touch: create a file

rm: delete the file

midir: create a directory

rm xxx: delete the directory
example: rm xxx (directory name) -rf forcibly remove

mv xc xxx (directory name): move the file to the xxx xc directory

mv xc xx.c: rename the file xc xx.c

cp: copy
Remember: do not copy the files to a directory that does not exist, this is the meaning of copies

cat: view the file contents
ctrl c quit

pwd: View file absolute path

 

 

Shared folder
in windows knock code, compile and execute in Ubuntu
1. Set up shared files folder in Ubuntu
click on the virtual machine (M) on the VM -> Settings -> Options -> Shared Folders -> set your own shared folders

2. Ubuntu into the shared folder
cd / mut / hgfs / xxx (file sharing set up their own folder)

Guess you like

Origin www.cnblogs.com/bangjie/p/11425831.html
Recommended