This is the 17th day of my participation in the August Challenge

Here are my study notes for learning Linux from the ground up, which will be updated later.

Record their own technology growth, also hope to share with you, welcome to follow ~

This is a study note for Linux for Developers @[TOC]

Ubuntu

$sudo, where su refers to administrator mode, sudo refers to administrator mode operation

Every once in a while, or when the system software version is not enough, enter sudoapt− getInstall to install apt− getInstallPackagename to install a package. Sudo apt-get install apt-get install packagename install apt-get install packagename Sudoapt − getInstall install apt− getInstallPackagename Install a package. Enter sudo apt-get upgrade to update the installed package

$sudo apt-get install XXX $sudo apt-get install XXX

$mkdir /home/ayuan/newfile indicates that a new folder is generated

CTRL + C, can directly enter the next line, this line directly abandoned, very suitable for input a line of errors, do not delete directly skip.

Cat filename To view a file, you need to enter the file or enter the file directory in advance

centos7

To access root or obtain root permission, enter su

Sudo systemctl start GDM Restarts the GUI

Yum upgrade-y only upgrades all packages, not software and system kernel

Yum groupinstall GNOME Desktop is installed

Set the default startup mode of the centos system as user root

Target // Set the command mode to systemctl set-default graphical. Target // Set the command mode to graphical

Create a C program on Linux and run it

To create a folder, run CD (same as Windows) to access it

[root@localhost ayuan]# cat aa.c% c% create an empty file, touch + filename + suffix [root@localhost ayuan]# cat aa.c% cat [root@localhost ayuan]# vi aa.c %vi+ filename + suffix to open the file, type in lower case: I (short for INSERT) to write code into it. How do I save it after I write it? The file will be locked. Then enter :wq to save the file and exit. [root@localhost ayuan]# GCC aa.c -o aa % GCC + c program name + -o + generated executable program name, this is a little confusing, GCC is to compile the c file, -o is in the current directory, generated executable aa, Exe [root@localhost ayuan]#./aa % enter./aa to execute the program. Output "Hello your Linux"Copy the code

Ifconfig Queries network information

Reference: blog.csdn.net/nanfeibuyi/…

Linux basic operations, common shell commands, common vi commands, and MAN help

One, a brief introduction

This section describes basic Linux operations, common shell commands, common vi editor commands, and man help.

2. Basic Linux operations

1. Press Ctrl+Alt+ T or double-click Terminal on the desktop to bring up the pseudo Terminal (cli).

Hyperterminal:

​ Ctrl+Alt+F6: tty6

​ Ctrl+Alt+F5 tty5

Ctrl+Alt+F4 Specifies the shared path between the host and the VM

​ Ctrl+Alt+F3 tty3

Ctrl+Alt+F1 Returns to the normal screen

2, Liang @ ubuntu: ~ $ls

Liang: user name.

Ubuntu: host name;

~: home directory (home directory of the current logged-in user), /home/liang

$: Command prompt (a flag)

Ls: lists the files in the current directory

3. Enable the VM to obtain the mouse: Ctrl+G; Make the host computer get the mouse: Ctrl+Alt

4. List all files in the current directory ls-la. The -l option is listed in a detailed list. The -a option indicates all files (including hidden files).

5. In the terminal window, press Ctrl+C to forcibly stop the current command or program.

6, shutdown command: in the terminal window, enter the command: poweroff

Introduction to shell commands

Common file operations:

1. Edit the file name (or create a new file and edit it with VI)

2, copy file A file B file (copy a file, B is a copy of the file (copy). (Both files are in the current path, you can specify paths respectively.)

-r copy the contents of directory A (including all files in it) to directory B, (-r recursive copy)

4, new file touch file name (file does not exist to create a new, exists to update the latest new modification time)

5, move file MV a file b directory (move file A to b directory)

6. Rename mv file A file B file (rename a file b file)

7, delete file rm a file

Rm a directory -r (delete a directory, including files in it)

The command function The sample note
alias Alias the command Alias c = ‘clear’ Alias clear as c
cat Display text content cat file Displays the contents of file
cd Change the current path cd /etc Go to /etc
chmod Example Modify file access permissions chmod 644 file Change the permission of file to 644
chown Changing the file owner chown foo file Change the owner of file to foo
clear Clear the screen clear Clear the screen
cp Copy files 1: cp file1 file22: cp dir1.0/ dir2.0/ -r 1: copy file1 to file22: copy dir1.0/ to dir2.0/
df View file system information df -h The file system information is displayed
diff Compare the similarities and differences between the two documents 1: diff file1 file2 -uN 2: diff dir1/ dir2/ -urN 1: compares file1 and file22: compares dir1/ and dir2/
dpkg Manually Installing software Packages dpkg -i example.deb Install example. Deb
echo Display string Echo “hello!” Displays “hello!”
find Find files The find / -name “* c” Find all the.c files in/below
grep Find string The grep “ABC”. / * – rwHn ./* find the string “ABC”
ifconfig View or modify the network ifconfig eth0 Check the network information of eth0
kill Send a signal kill -s SIGKILL 1234 Signal SIGKILL to process 1234
ln Creating a link file 1: ln apple a2: ln apple a -s 1: alias Apple to A2: create a symbolic link a to Apple
ls Listing file information ls Lists (current directory) file information
man Find Help information man ls Find help with the ls command
mount Mount or unmount partitions mount /dev/x /mnt Mount /dev/x to/MNT
more Information is displayed in a split screen ps -ef | more The ps-EF information is displayed in a split screen
less With more similar less a.txt Display the contents of the A.txt file
head Displays the first few lines of the file more a.txt Displays the first 10 lines of a.txt
tail Displays the last lines of the file tail a.txt Displays the last 10 lines of a.txt
mkdir Create a directory mkdir dir/ Create a new directory dir/
mv Move or rename files 1: mv file1 file2 2: mv file dir/ 1: change the name of file1 to file22: move file to dir/
pwd Display current path pwd Display current path
ps View system process information Ps – EF or PS AJx View system process information
rm Delete the file 1: rm file2: rm dir/ -r 1: delete file2: delete dir/ recursively
sort The sorting sort file Sort the file and print to the screen
tar Archive or release compression or decompression 1: tar cjf a.tar.bz2 *2: tar xjf a.tar.bz2 3: tar czf a.tar.gz *4: tar xzf a.tar.gz 1: compress all files as. Bz22: decompress. Bz2 file 3: compress all files as. Gz4: decompress
uniq Remove adjacent duplicate lines uniq file Removes adjacent duplicate lines from file
wc counter wc a Count lines, words, and characters of A
which Find the path which ls The path where the ls command resides is displayed
touch Modify the timestamp of a file, or create a file touch a.txt A. time stamp is modified if it exists and created if it does not exist

Now that you’ve seen this, why not give it a thumbs up