terminal linux command

1.cd directory name; enter the current directory.

 

2.ls ; view the files and directories in the current folder -a represents all directories and files

 

3. sudo stands for user authority. When a user needs to temporarily obtain all permissions, it can be used to obtain it.

Example: sudo vi .profile

This can open the .profile file with vi and can modify it. If there is no sudo, it can only be seen and cannot be modified.

 

4.mkdir directory name; create a directory.

 

5.rmdir directory name; delete a directory.

rm filename; delete a file;

rm -r directory name; delete all files and directories in the current directory.

 

6. Open the file in the terminal. You can use an editor such as vi. If you open the file with gedit, it is opened in the form of a file, which is convenient for changing the file.

 

7. Modification of file and directory permissions chmod. 0 means no permission, 1 means executable permission, 2 means writable permission, 4 means readable permission, and then add them together. Form numbers from 0 to 7. To modify the permissions of files and directories.

For example: $ chmod 644 mm.txt

The file owner (u) inin has read and write permissions
and the file owner is in the same group. User (g) has read permission
. Others (o) have read permission. 

 

8. When installing software on the terminal, sometimes there are many problems, such as: insufficient user rights and insufficient dependencies. In this case, you can try this;

For example: sudo apt-get install software name-gd;

This way to achieve global installation, and load dependencies.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326606886&siteId=291194637