In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to learn and understand Linux commands", the content is simple and easy to understand, organized clearly, I hope to help you solve doubts, let Xiaobian lead you to study and learn "how to learn and understand Linux commands" this article bar.
1. LS command
First, the ls command means List Directory Contents. Run it to list the contents of a folder.
The "ls -l" command lists the contents of a folder in long listing fashion.
The "ls -a" command lists everything in the folder, including the contents marked ". "Hidden files at the beginning.
Note: In Linux, files start with ". "It starts with hidden files, and every file, folder, device, or command is treated as a file. ls -l command output:
1.d (stands for yes directory).
2.rwxr-xr-x is the user or user group to which the file or directory belongs.
3. In the above example *** ravisaive represents file files belonging to user ravisaive
4. The second ravisaive in the above example represents the file file belonging to the user group ravisaive
5.4096 Represents a file size of 4096 bytes.
6. May 8 01:06 represents the date and time of a modification of the file ***.
7.*** A representative is the name of a file/folder
2. lsblk command
"lsblk" is a list of block devices. Block devices are displayed neatly in standard tree-like output format in addition to RAM.
The "lsblk -l" command displays block devices in list format (not tree format).
Note: lsblk is the most useful and easiest way to learn the name of a newly inserted USB device, especially if you are dealing with disk/block devices on the terminal.
3. md5sum command
"MD5sum" is the calculation and verification of MD5 message signatures. md5 checksum(often called hash) is used to match or verify the integrity of a file because the file may have been affected by transmission errors, disk errors, or malicious interference.
Note: Users can use officially provided and md5sum to generate signature information for match detection, but Md5sum is not as secure as sha1sum.
4. DD command
The "dd" command represents converting and copying files. It can be used to convert and copy files, most of the time it is used to copy iso files (or any other files) to a usb device (or any other device), so it can be used to make USB boot disks.
Note: in the example above, the usb device is sdb1 (verify it with lsblk or you will overwrite your disk or system), so be careful with the disk name.
5. uname command
The command "uname" is short for Unix Name. Displays machine name, operating system and kernel details.
Note: uname displays kernel categories, and details can be displayed with the uname -a command. From the above information, the uname -a command is detailed
★"Linux": system kernel name
★"tecmint": node name of the device
★"3.8.0-19-generic": kernel release version
★"#30-Ubuntu SMP": Kernel version
★"i686": Processor architecture
★"GNU/Linux": operating system name
6. history command
The "history" command is a history that shows the history of all commands executed in the terminal.
Note: Hold down CTRL+R to search for commands that have already been executed, and you can automatically complete commands when you write them.
7. sudo command
The "super do" command allows authorized users to execute superuser or other user commands. Specified by security policy in sudoers list.
Note: sudo allows users to borrow privileges from superuser, however another "su" command actually logs in as superuser, sudo is safer from a security perspective than su.
It is not recommended to use sudo or su for everyday use because it can lead to serious errors. There is a popular saying in the linux community:
8. mkdir command
The "mkdir"(Make directory) command creates a new directory under a named path. However, if the directory already exists, an error message "folder cannot be created, folder already exists" will be returned.
Note: Directories can only be created under directories where the user has write permissions. mkdir cannot create directory "tecmint" because files already exist, as mentioned earlier in linux, files, folders, scripts are treated as files.
9. touch command
The "touch" command updates the file access and modification times to the current time. The touch command creates a file only if it doesn't exist. If the file already exists, it updates the time and does not change the contents of the file.
Note: touch can be used to create files that do not exist in directories where the user has write permissions.
10. chmod command
The "chmod" command changes the mode bits of a file. chmod changes the file mode (permissions) of each given file, folder, script, etc. according to the requested mode.
There are 3 types of permissions in the file, if you give the file read-only permission, set it to '4'; write-only permission set it to' 2'; execute-only permission set it to 1; read-write permission, that is, 4+2=6, and so on.
Now you need to set up 3 user and user group permissions. *** * ** is the owner, then the group the user belongs to, and *** is the other user.
Here root's permissions are rwx (read, write and execute permissions),
The user group permission is r-x (only read and execute permission, no write permission),
-x for other users (execute only)
To change its permissions, provide read, write, and execute permissions to the owner, user group, and other users.
Note: This chmod command is one of the most useful commands for system administrators and users. If files are inaccessible or the wrong permissions are set for a user in a multi-user environment or server, this command will resolve it.
That's all for "How to learn and understand Linux commands". Thanks for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.