Linux wrap up day01 02/03/2018

1. Connect to the instructor interface

Top left corner Application–>Internet–>VNC
2. Screenshot
PrtSc

3. Take notes
gedit

4. The command about virtual machine operation
rht-vmctl start desktop
opens the virtual machine
rht-vmctl view desktop
displays the virtual machine
rht-vmctl reset desktop
resets the virtual machine
rht-vmctl poweroff desktop
closes the virtual machine

5. Log in to the root account
Create a new account Username: root
Password: redhat

6. Set shortcut keys
Steps :
1. Open the settings page
2. Click on keyboard properties
3. Click on custom shortcuts in shortcuts
4. Click on the plus sign to add the names and properties of the
shortcut keys 5. Click the properties behind the shortcut key name to set it for your shortcut keys


7. The command gnome-terminal to open the shell

8. The command to switch users
su -l username The password is required to switch from a low-
level user to an advanced user.
Return to the upper-level user.
1) If you use logout directly, an error will be reported. It is
recommended to use exit to exit the shell. Use logout to return to the upper-level user
. shell
3) ctrl+d same as above

9. Commands about the host name
1) hostname: view the host name
2) hostname: new host name -> modify the host name

10.[root@ruanruan Desktop]#
root: the user running bash
@: separator
ruanruan: the host name of the host where bash is located
Desktop: the directory where bash is currently opened
#: the prompt for user permissions $ normal user

11. About the help command
whatis command
command –help

12. About the date command
date +%Y-%m-%d Real year-month-day is equivalent to date +%F
date -d -3year Displays the
date three years later -d +3day Displays the
date three days later month day hour minute year. second change date default date

13. The command to monitor the passwd status of the student
watch -n 1 passwd -S student
-n 1 : 1 means that the time is changed to 2 to monitor once every 2 seconds

14. The command of passwd
1.-d delete the password -w change the warning period -n set the shortest validity period -S check the status Example: passwd -w 1 -n 2 student
2. Modify the password passwd student

15. Commands about files
. File name set hidden file
ls view file
ls -a view all files (including hidden files)
gedit file name open gedit
cat file name output the text file to the shell
more day01
less day01
head day01 view the first 10 lines The content of
tail day01 View the content of the last 10 lines
head -n 5 View the content of the first 5 lines
tail -n 5 View the content of the last 5 lines
vim day01 Enter vim mode
Press i to enter edit mode
Press ESC to exit and then press: wq to launch w to write into q launch

16. Command
history
history -c about history call to delete history

17. About the directory of linux
/represents the root directory
/bin stores most system commands
/boot stores files required for booting
/dev stores device files
/etc stores configuration files
/home stores user accounts
/lib Stores system program files
/mnt Commonly used The mount point is
/opt The third-party program installation directory
/proc The file that records the status
/sbin The special directory of the super administrator
/root The administrator directory
/tmp The temporary file
/usr Contains some important content
/var Stores the system definition table

18. File path
Absolute path: the actual location of the file
For example: /etc/passwd
relative path is equivalent to the location of the file in the current directory
For example a.txt
difference: there is/relatively not in front of the absolute path

19. Common commands about paths
pwd Display the absolute path of the current working directory
cd directory –> switch to the specified directory
cd .. –> return to the previous directory
cd – –> return to the last entered directory
cd ~ Return to the current user’s home Directory
~wuhongyu Return to the home directory of the specified user (wuhongyu)
20. Some commands for file management

        文件                   目录
增加    touch 文件名  [路径]     mkdir 目录路径    -p 递归建立目录

删除    rm -fr 文件名            rm -fr 目录路径       rm -fr * 递归删除所有

修改    vim,gedit            (增删file or dir)

查看    cat,head,tail,less,more  ls

复制    cp file... 目录名        cp -r dir... 目录名   -r表示复制目录

移动    mv file... 目录名        mv -r dir... 目录名

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325860078&siteId=291194637