Common commands under Linux

vim is to open the vim editor. Other editors include vi (the function is not as powerful as vim), nano, emacs, etc. It feels that vim is the most powerful, followed by vi, and others are worse. I heard from our teacher that using the graphical interface itself will be laughed at by experts. If you open a gpedit or kwrite, it will be useless...
Common commands
ls, lists files in the current directory, ls -l lists detailed information, and ls -a lists hidden files.
cd, change directory. clear, the command to clear the screen. reset, reset the terminal.
startx, start the graphical interface. fdisk -l, view hard disk partitions.
ps aux, to list system processes. cat, display text. tac, displays text in reverse order.
od, display text in binary format. wc, determine the size of the file, the number of lines and characters, and so on.
aspell, check the file for spelling errors. less, paging to read files. more, similar to less, but not as functional as less.
reboot, reboot the system. poweroff, shutdown. Halt is also shutdown, but it needs to manually cut off the power supply, which is not recommended. shutdown -h now, shut down immediately, the following now can be replaced with time, and the command to specify the shutdown time. It is said that a good system administrator should use this command. shutdown -r now, similar to the previous one, but restarting. sync, synchronizing hard disk data, should be used multiple times before restarting or shutting down.
locate, query file location, updatedb command should be used every so often to provide search scope. find, a powerful query command with many parameters. find / -name *, this is the meaning of query / under all files.
whereis, I use him to determine the location of the command, such as whereis ls.
sudo, use root privileges in the case of ordinary accounts, but you need to modify the /etc/sudoers file.
mv, move files or rename. mv /etc/* /home/tom means to move all /etc files to the tom directory. mv ab, rename a to b. Of course, this is just an example, and the specific operation needs to be determined according to the specific situation.
cp, similar to mv, is also the same format, but it is not a move, but a copy. If you are copying a directory, you need to use the -r parameter, cp -r ***.
rm, this is the delete command, similar to cp, delete the directory and add -r, prompt to delete use -i
useradd, to add a new account. userdel, delete an account.
passwd, set a password for an account. There are many parameters to achieve other functions.
chown, change file ownership. Such as chown tom.tom file name, change the file to the group tom, and the owner is also tom.
chmod, change the permissions of the file, just say a simple modification, chmod 777 file name, the file will have all permissions.
chkconfig --list, used to observe the service status, chkconfig --level ? service name on/off, open or close the service,? Represents a run level.
init(1,2,3,4,5,6) is used to switch between 6 runlevels.
runlevel View the current run level.
bc, a calculator. date, displays the time. cal displays the calendar.
If it is redhat, there is also setup, which is used to set up some system-related, ntsysv, which is specially used to set up services, so that there is no need for chkconfig.
tr, the compression or replacement character. dh, calculate the size of the directory. df, which displays information about the file system.
free, displays the usage of memory cpu. top, dynamic observation process.
tar -czvf, create *.tar.gz compressed package, tar -xzvf, decompress this compressed package.
tar -cjvf, the created is *.tar.bz2, the decompression is tar -xjvf
rpm -ivh, install rpm package, rpm -e uninstall rpm package
who, observe the login. whoami, who am i, there are some differences between the two commands, but they are similar. id, used to view account information. w, also check the login status, more detailed.
echo, used to display environment variables, etc., for example echo $LANG.
history, displays the command history. mount hangs on the device. umount, to unmount the device. dmesg, displays boot information. yum, the command to use when updating.
ssh, ssh login. telnet, telnet login. There is also the ftp command.
gcc, g++, java, javac are all commands for programming. make, if there is a makefile, you can use it to compile.
All of the above are what I think I will type in the future. There are inevitably mistakes, and the order does not seem to be very good, please forgive me.
In addition, due to the problem of the installation package, not all commands may appear. If you need some functions, you need to install the corresponding package file.
 
 
 
 

Guess you like

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