In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1.ls
This is equivalent to the dir command under Windows and can list the contents of the current window or under the specified window.
2.rm
This is equivalent to the del and rmdir commands under Windows, and can delete files and folders.
Common usage: rm-rf/home/ubuntu/.cache (delete / home/ubuntu/.cache this folder)
Taboo: rm-rf / * this command deletes all files under the root partition and removes motherboard firmware on some efi machines, causing the motherboard firmware to be lost and unable to boot (worse than when the operating system fails to boot).
3.chmod
Change file permissions, similar to the security tab for file properties under Windows.
Common usage: chmod-R 777 / home/ubuntu/example (change this directory and all files in it to 777 permissions (which means anyone can modify the content).
Taboo: chmod-R 777 / etc
Chmod-R 777 /
(root partition and / etc are critical parts of the system, changing permissions will cause the system to fail to boot)
4.apt 、 apt-get
This is similar to Win7/8/10 's dism command, which is the package manager of the Debian series, and allows you to install, update, and uninstall software. Most operations require root permission
Common usage: apt-get update (update software source cache)
Apt-getupgrade (Update system)
Apt-getdist-upgrade (update system version)
Apt-getinstall zhcon (install software called zhcon)
Apt-getremove zhcon (uninstall software called zhcon)
Taboo: uninstall key packages, such as coreutils
5.dpkg
Software installer.
Common usage: dpkg-I package path and name.
Note: some packages will report an error after installation, indicating a lack of dependencies. At this point, you need to type sudo apt-get-finstall to repair the dependency. (you can install gdebi if you want to save trouble, which is a graphics package installer and can automatically complete dependencies.)
6.tar
Tar compression and decompression command. Lzip package is required to compress and decompress tar.lz.
Common usage: tar-xf / home/ubuntu/coreutils-8.29.tar.xz (extract this package to the current directory)
Tar-xvf / home/ubuntu/coreutils-8.29.tar.xz (extract the package to the current directory and display the details)
Tar-xf / home/ubuntu/coreutils-8.29.tar.xz / home/ubuntu/gnu (extract the package to the / home/ubuntu/gnu directory)
Tar-cvjpf etc.tar.bz2 / etc (- c is to create a packaged file, and the corresponding-f is followed by the name of the created file, using the .tar.bz2 suffix, the-j flag is compressed by bzip2, followed by the specific Operand / etc directory)
Tar-cvzpf etc.tar.gz / etc (- c is to create a packaged file, and the corresponding-f is followed by the name of the created file, using the .tar.gz suffix, the-z flag is compressed by gzip, followed by the specific Operand / etc directory)
7.vi 、 nano
These are two editors. The latter is recommended if simple text editing is needed.
8.sudo 、 su
Sudo is to run this command in root, but with the user configuration of the current user.
Common usage: sudoapt-get update (update software source cache, this command requires root permission)
Sudo-s (switch to root permissions, but use the user configuration of the current user)
Su can do this, but loads the configuration of the specified user.
Common usage: su (switch to root user and load user configuration for that user)
Su123 (switch to 123 and load the user's configuration)
Su-c "apt-get update", switch to root user and update the software source cache.
9.fsck
Disk check repair command, you can check for errors in the repair file system. Similar to chkdsk under Windows. However, the "partition" you want to enter here is not the directory after the partition is mounted, but the identity of the partition in / dev.
Common usage: fsck/dev/sda1 (check and repair / dev/sda1 partition)
10.zhcon
This is a Chinese plug-in for tty, similar to the Tianhui Chinese character system in the DOS era.
Because Ubuntu tty will garbled in Chinese mode, it can be solved by using zhcon.
Common usage: zhcon--utf8 (run zhcon as utf-8, the parameter-- utf8 is usually required when running zhcon).
Zhcon may not be pre-installed, please manually enter sudoapt-get install zhcon to install.
11.make
Compile command. The specific parameters depend on your makefile configuration.
If you need to use multithreaded compilation, you can add-j to the parameter to compile.
For example, my processor is quad-core and eight-threaded, so I can type make-J8 to compile, which will be much faster.
12.gcc
GCC compiler, the specific parameters depend on your requirements.
13.dd
This command can populate the appropriate content to the file.
Common usage: ddif=/home/ubuntu/ubuntu.iso of=/dev/sdc (write the contents of ubuntu.iso to / dev/sdc)
Taboo: ddif=/dev/zero of=/dev/sda this command will clear the main hard drive, causing the system to fail to boot and making it difficult to recover data.
14.cfdisk
Disk management tool, you can manage disk partitions and raw format disk image files.
15.whereis
This is a query tool that can query specified files.
Common usage: whereisbash (query where the bash program is)
16.touch
Create an empty file
Common usage: touchupdate.sh (create an empty update.sh file)
17.alias
Sets the command alias.
Common usage: aliasdir = 'ls' (set dir to an alias for ls)
18.pkill
End the process, similar to the taskkill command under Windows
Common usage: pkillbash (ending the bash process)
19.uname
Displays information such as Linux version, system architecture, and so on.
Common usage: uname-r displays the Linux kernel version number.
Uname-ar displays all version information
Uname-m displays the current system architecture
20.sync
Write changes to disk. Because Linux has a deferred write feature (to enhance performance), content is not synchronized to disk immediately after some operations are performed.
To be on the safe side, for example, if your power supply is unstable and you may encounter a power outage, please enter the sync command regularly to prevent accidents.
In addition, the system automatically executes the sync command before shutdown and restart, so if you are about to shut down or restart, you do not need the sync command.
Common usage: sync synchronizes the current user's data
Run sync as root: synchronize all user data.
Summary
The above is a detailed explanation of the common instructions and usage of Ubuntu introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!
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.