Frequently asked questions about Internet interviewing (Linux command article)

Source: Internet
Author: User
Tags clear screen create directory disk usage

1. What is the symbolic representation of the absolute path? What is the current directory and top level directory used for? What does the home directory say? What are the commands for switching directories?
absolute Path:/; current directory:./; Upper directory:. /; home directory:/; switch directory: CD.
2. How do I view the current process? How do I exit? How do I view the current path?
View current process: PS; exit: Exit; current path: pwd.
3. How to clear the screen? How do I exit the current command? How do I sleep? How do I view the current user ID? What commands do you use to view specified help?
Clear screen: clear; Exit current command: CTRL + C;
sleep: First use #cat/sys/power/state to see which way to support;
then use echo Standby >/sys/power/state (or Mem,disk);
view current user Id:whoami; Help: Man.
4. What function does Ls command perform? Which parameters can be taken, what is the difference?
ls command: Displays the files and folders under the current directory;
parameter:-A All Files
- D Show only directories
- L Detailed information
- n list uid Huai gid
-R reverse order
- t Sort by Time
5. Create a soft link (shortcut), and a hard-link command.
Create a hard-link command: LN file filenew Deletes the original files and only reduces the number of links, which is not deleted until 0 o'clock.
Create soft Link command: Ln-s file filenew Delete the original files, delete them completely, and the link fails.
6. What are the commands for directory creation? What are the commands for creating files? What are the commands for copying files?
Create directory: mkdir;
create file: Vim,cat;
Copy file: CP.
7. What are the commands for modifying file permissions? What is the format?
command: chmod 777 file
8. What commands can I use to view the contents of a file?
VI, VIM, cat, more, head, tail
9. Feel free to write a file command? How to output a string with spaces, such as "Hello World" to the screen?
Random Write File command: cat;
screen output: Echo.
10. Which file is in which folder is the terminal? Which command is under which folder is the black hole file?
Terminal:/dev/ttyn, virtual terminal equipment.
black Hole File:/dev/null, using: cat/dev/null > File, emptying the contents of the files.
11. Which command is used to move files? Which command is used for renaming?
moving files: MV; Change of name: MV.
12. Which command is used to copy files? What if you need to copy the folder together? How do I need to have prompt function?
CP; plus-r recursive replication; the-f parameter is not added.
13. Which command is used to delete a file? What if I need to delete a file in the directory and directory? What are the commands for deleting empty folders?
rm; plus-r recursive delete; rmdir.
What kinds of wildcard characters can I use for Linux commands? What does each mean?
*-wildcards, which represent any character (0 to more)
?-wildcards, which represent one character
'-Quote symbols, two ' in the middle are the commands that can be executed first, and the returned results form a new command
[]-Middle is a character combination
15. What command is used to count the contents of a file? (line number, number of words, number of bytes)
WC command:
-C Count bytes.
-L COUNT the number of rows.
-W counts the number of words.
What is the use of the. grep command? How do I ignore the case? How do I find rows that do not contain the string?
function: Find, ignore case:-I; Find rows that do not contain the string:-V.
What are the different states of a process in Linux? What symbols are represented in the information displayed by PS?
R: Running;
S: Sleep;
T: detecting or stopping;
Z: Terminated, but the parent process failed to terminate it properly, becoming a "zombie" process.
18. How do I make a command run in the background?
Use & After the command.
19. How do I display all processes using PS? how do I use PS to view information for a specified process?
displays all processes using-a or-e, and uses the pipe to connect grep command.
20. Which command is dedicated to viewing background tasks?
jobs-l
21. What commands do I use to move the background task to the foreground? What commands do I have to perform in the background to stop a background task?
FG%jobnumber transferred to the front desk
BG%jobnumber continues the background task. You can use CTRL + Z to suspend a foreground task, and then use BG to move to the background to execute
22. What is the command to terminate the process? With what parameters?
kill, add signal and process number
23. How do I view all the signals supported by the system?
kill-l
24. What are the commands for searching for files? What is the format ?
whereis plus parameter and file name
Locate only add file name
Find direct search disk, slower.
25. See who is currently using the host with what command? What commands do you use to find your terminal information?
See who is using: w;
Find your terminal: Who-a?
26. What commands are used to view the list of used commands?
History
27. What commands do you use to view disk space usage? What about free space?
View disk usage space: df-h;
free space: df-h.
28. What commands are used to see if the network is connected?
Ping
29. What commands are used to view IP address and interface information?
ifconfig
30. What are the commands for viewing various environment variables?
Env
31. What commands do you use to specify a command prompt?
Linux modifies the environment variable PS1 (command line prompt), you can edit the/etc/profile file using VI
or use Export to modify PS1
32. Where do I find the executable file for the command? How do I set it up and add it?
/bin; Modify the/etc/profile file
33. What commands do I use to find the execution command?
type
34. How do I alias a command?
alias lm= ' ls-l | more '
Unalias LM

Frequently asked questions about Internet interviewing (Linux command article)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.