Linux C notes

Source: Internet
Author: User

Finally open a blog, after a busy exam week, forget the almost
Features of Linux 1. Multi-User 2. Multi-tasking 3. Multi-platform 4. Good user interface 5. Powerful network function 6. Safe, stable and efficient 7. Good portability 8. Open and free
Major releases of Linux: Fedora Core, Red Hat Linux,debian Linux and Red Flag Linux, etc.
Common commands for Linux
1. Shutdown (System shutdown, restart, and logout)
(1) Shut down the system
Shutdown-h now
Init 0
Telinit 0
(2) Restart
Shutdown-r now
Reboot
(3) write-off Logout

2. Files and directories
(1). Change the current directory CD
Cd/home Enter '/home ' directory '
Cd.. Return to the top level directory
Cd.. /.. Return to the top level two directory
CD into the personal home directory
CD ~ Enter the user's home directory
CD-Return to the last directory
(2) Show work path pwd
(3) Display directory or file information ls
ls to view the files in the directory
Ls-f viewing files in a directory
Ls-l displaying details of files and directories
Ls-a Show all files, including hidden files
LS *[0-9]* displays filenames and directory names that contain numbers
Ls-t sorting results by modified time, new catalog file in front
(4) tree structure showing files and directories starting with the root directory
Tree
Lstree
(5) Create a folder mkdir
mkdir dir1 Create a directory called ' Dir1 '
mkdir dir1 DIR2 Create two directories at a time
Mkdir-p/tmp/dir1/dir2 Create a directory tree
(6) Delete RM
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
(7) Moving MV
MV Dir1 New_dir Renaming/Moving a directory
(8) Copy CP
CP file1 file2 Copy a file
CP dir/*. Copy all files under a 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

(9) Modify the timestamp of a file or directory touch-t 0712250000 file1
(10) View file contents cat
(11) View file contents and reverse output TAC
(12) Viewing the contents of a File Page view less
(13) View non-text file od

3. File Search
Find/-name file1 from '/' to the root file system to search for files and directories
Find/-user User1 search for files and directories belonging to user ' User1 '
Find/home/user1-name \*.bin in directory '/home/user1 ' search for files with '. Bin '
Locate \*.ps looking for files ending with '. ps '-run the ' updatedb ' command first



GCC Common options
-E tells GCC to stop the compilation process after preprocessing
-C cppoutput or source file compiled into target code (. O)
-G generates standard debug information.
-ggdb generate a lot of debugging information that only GDB can recognize
-O Output_filename
-W turns off all warnings.
-Q lets GCC display each function encountered during compilation and provides profiling information about the time it takes to compile each function
-save-temps Save intermediate files generated during compilation


Linux C notes

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.