pwd command
In the Linux hierarchical directory structure, users can use the mkdir command to create a new directory under any authorized directory, or use the cd command to convert from one directory to another. However, there is no prompt to tell the user which directory they are currently in. To know the directory you are currently in, you can use the pwd command, which displays the entire path name.
Syntax: pwd
Description: This command displays the absolute path to the current working directory.
ls command
ls is the abbreviation of the English word list, and its function is to list the contents of the directory. This is one of the most commonly used commands by users because the user needs to view the contents of a certain directory from time to time. This command is similar to the dir command under DOS.
Syntax: ls [option] [directory or file]
For each directory, the command lists all subdirectories and files. For each file, ls will output its file name and other information required. By default, the output entries are sorted alphabetically. When the directory name or file name is not given, the information of the current directory is displayed.
The meaning of each option in the command is as follows:
- a Show all subdirectories and files in the specified directory, including hidden files.
- A Displays all subdirectories and files in the specified directory, including hidden files. But not listing "." and "..".
- b Display the non-displayable characters in the file name with octal escape characters.
- c Sorted by file modification time.
-C Divid it into multiple columns to display items.
- d If the parameter is a directory, only its name is displayed without the files below it. It is often used with the l option to get the directory details.
- f Do not sort. This option will invalidate the lts option and make the aU option valid.
- F Tag "/" after the directory name, "*" after the executable file, "@" after the symbolic link, "|" after the pipeline (or FIFO), and "=" after the socket file.
- i Show the i node number of the file in the first column of the output.
- l Display the file details in a long format. This option is most commonly used.
The information listed in each row is: File type and permissions Number of links File belongs to the owner File belongs to the group File size Time of creation or recent modification Name
For symbolic link files, the displayed file name is followed by "—>" and the reference file path name.
For device files, its "File Size" field displays the primary and secondary device numbers, not the file size.
The total number of blocks in the directory is displayed at the beginning of a long format list, containing indirect blocks.
- L If the specified name is a symbolic link file, the file pointed to by the link is displayed.
- m Output is in character stream format, the file is displayed across pages, separated by commas.
- n The output format is the same as the l option, except that in the output, the file owner and the dependent group are represented by the corresponding UID number and GID number, rather than the actual name.
- o The same as l option, just does not display owner information.
- p Add a "/" after the directory.
- q Replace the non-displayable characters in the file name with "?".
- r Display the output results in alphabetical order or in the earliest priority order.
- R recursively displays files in each subdirectories of the specified directory.
- s Give the number of blocks used for each directory entry, including indirect blocks.
- t Sorted by modification time (recent priority) rather than by name when displayed. If the file modification time is the same, it will be in dictionary order. The modification time depends on whether the c or u top is used. The default time stamp is the last time to modify.
- Sorted by the time the file was last accessed (most recent priority) rather than by name when it is displayed. The time of -t is changed to the time of the last visit.
- x Display information for each sorted item by row.
In the information displayed with the ls-l command, the beginning is a string composed of 10 characters, where the first character represents the file type, which can be one of the following types:
- Normal files
d Catalog
l Symbol link
b Block device file
c Character device file
The following 9 characters represent the access permissions of the file, divided into 3 groups, each with 3 digits.
The first group represents the permissions of the file owner, the second group represents the permissions of users in the same group, and the third group represents the permissions of other users. The three characters in each group represent the read, write and execute permissions to the file respectively.
Each permission is as follows:
r Read
w Write
x Execute. For directories, it means entry permission.
s When a file is executed, the UID or GID of the file is assigned to the UID (user ID) or GID (group ID) of the execution process.
t Set the flag bit (stayed in memory and not swapped out). If the file is a directory, the files in the directory can only be deleted by the superuser, directory owner, or file owner. If it is an executable file, a pointer to its body segment remains in memory after the file is executed. This way, when you execute it again, the system can load the file faster.
15:42 Add a comment Permalink Quote Announcement (0) Record it Others’ Experience
Permalink
/blog/cns!4D4B02D49A61242C!
Add a comment
A brief discussion on the direction and methods of Linux learning Since I am doing Linux training, I have a lot of contact with friends who are beginners of Linux and have a deep understanding of the problems encountered when starting Linux. I hope my friends will point out the following remarks:
First of all, it is explained that friends who want to learn Linux can forget Windows 2000, and at least forget the basic things such as drive letters, applications, etc. under Windows. Secondly, you must deeply understand that Linux and Windows are two different system platforms. You can compare and learn, but don’t just apply the Windows stuff to Linux learning directly.
Learning direction:
1. Desktop system
It is the Windows system after the system is installed. It is called Windows under Windows and X under Linux. In fact, it is just a different name (look at the desktop made by Hongqi. It is really like Windows needs to make it. It’s really dizzy. Although this helps the use of Linux desktop, it’s really not good for the promotion of Linux system)
Many beginners who have started Linux installing Linux, enter their X Windows desktop, are very excited and think that the job is done and Linux can do it by itself. This idea is terrible. If I tell you that the Linux X Windows environment is not a Linux system, it is just an application running under Linux (similar to running office2000 under Windows), what do you think?
Applications under Windows can hardly be installed and used directly under Linux systems. Those who learn programming should understand, so don’t find the Windows tool disk to install your RAR, QQ, realone and other common tools, you can’t install them.
You can try to install the latest drivers of your hardware, install common tools under Linux, and do some simple Linux Chineseization, and you will understand the difficulties of friends who often ask this question in the forum.
In short, learning desktop is not learning Linux systems.
2. Learn kernel source code. Like the Unix operating system, it is written in C language.
If you buy an authentic Linux system (not very expensive), it will come with one or two Linux source code disks. Linux programmers start from here, which is the starting point and the end point.
3. System Management
That is to manage Linux system environments: SHELL, graphics, system services, hardware drivers, etc.
System management Linux is similar to UNIX (I just said this after reading some Unix system management). Basically, it is done through commands ------>config files ------->script files.
This is recommended to start from here. Don’t just install XWindows. As long as you try to keep using this X Windows environment as often as possible, I believe that learning will be natural. (I feel that there is nothing to learn about it. As long as you have used the computer for more than 1 year, you should be able to operate it below)
4. Application Development
In Linux applications, Linux does have a certain gap compared to its competitor Windows. However, in high-end applications, the Linux market is getting bigger and bigger, such as:
Linux kernel development:
---PDA personal handheld computer;
----Special network equipment; firewall equipment, VPN equipment, etc. are written in Linux, domestically produced, and are now sold very well;
----hardware driver
Linux network programming:
----Php programming, establish dynamic sites;
----jsp programming,
----perl, cgi programming;
Development of databases under Linux system:
----my sql small and medium-sized database system;
---oracle database
--- DB2 database, IBM database system
5. Server field
When it comes to Linux, many people naturally think of building servers, but now in terms of network servers, Linux is indeed the first in market share;
Linux server field:
----Proxy server, using Linux's iptables function;
----Movie server, using Linux's samba service functions, file and print sharing server
----Game server, CS server, server built using the Linux version of CS in Linux system
----Customer archive server, Linux ftp server, commonly used are: wu-ftp, pro-ftp software established
---www server, using the apache server software under Linux
----ftp server, download the server, using wu-ftp, pro-ftp, vs-ftp software under Linux
----The mail server uses sendmail under Linux and qmail software
----DNS server, using bind software under Linux
----The database server uses mysql or oracle software
----Firewall, software firewall server, is built using Linux's iptables function
----Router, soft router, built using router software under Linux
---Dialling server, vpn server, etc.
6. System integration
Too wide scope and too much content. I believe that the Linux R&D centers established by IBM and others are mainly doing this.
15:41 Add a comment Permalink Quote announcement (0) Record it Other people’s experience
Permalink
/blog/cns!4D4B02D49A61242C!
Add a comment
Everything starts with the basics Linux Beginner Commands Chapter Provides help and explain commands you are familiar with or unfamiliar with
eg:man ls You can view the usage of ls related to
Note: Press the q key or ctrl+c to exit. In Linux, you can use ctrl+c to terminate the current program.
Check the directory or file's attributes* and list the files below any directory
eg: ls /usr/man
ls -l
Represents a directory, if it is a "-" means a file, if it is l, it means a connection file (link)
b. Indicates file or directory permissions. Use readable (r), writeable (w), and runable (x).
Copy the file
eg: cp filename1 filename2 //Copy filename1 into filename2
cp netseek/ //Click to the netseek directory and name it
Delete files and directories
eg: rm //Delete this file
Remove the directory or change the file name
eg: mv filename1 filename2 //Rename filename1 to filename2
mv ../ //Move to the previous directory
Change the current directory pwd view the full path of the current directory
eg: pwd //View the path of the current directory
cd netseek //Enter the netseek directory
cd//Exit the current directory
,more command
Display the content of a certain file. The difference between the two commands is: cat prints the content of the file all the time, while more displays it on the split screen
eg; cat> //You can paste the code into the file and press ctrl+d to save the code.
cat or more // you can view the content inside.
gcc-o 1 //It will be compiled into .exe file, and we can use this method to compile the code out
Command Permission Modification Usage: chmod 8-digit filename
eg: chmod u+x filenmame //I just want to run it for myself, others can only read
//u represents the file owner, g represents the group where the file file is located. o represents other people; r table can be read, w table can be written, x table can be run
chmod g+x filename //People in the same group come to execute
9. clear, date command clear: clear the screen, which is equivalent to cls under DOS; date: displays the current time.
Load a hardware device
Usage: mount [parameters] The device to be loaded Loading point
eg: mount /dev/cdrom
cd /mnt/cdrom //Enter into the CD directory
Switch to another person's identity without logging out
Usage: su -l user name (if the user name is default, switch to root state)
eg:su-l netseek (Switch to the user of netseek and you will be prompted to enter your password)
,whereis,which,id
//whoami: Confirm your identity.
//whereis: Query the directory where the command is located and the directory where the help document is located.
//which: Query the directory where the command is located (similar to whereis)
//id: Print out your own UID and GID. (UID: User ID unique ID. GID: User group identity unique ID. Each user can only have one unique UID and GID.)
eg: whoami //Show the username you logged in to yourself
whereis bin Shows the directory where bin is located, it will be displayed as: /usr/local/bin
which bin
13. grep, find grep: text content search; find: file or directory name and permission owner matching search
eg: grep success * /*Search all files in the current directory that contain success characters in all files in the current directory
Can kill a process that is in progress or is already in dest state
eg; ps ax
Passwords can be set
Commands used by users
eg: history //Can display the commands used by the user in the past
17.!! Execute the latest command
Order
eg: mkdir netseek //Create this directory of netseek
Decompression command
eg: tar -zxvf nmap-3. //Decompress this into the directory nmap-3.45
You can ask users to query some other users' information
eg: finger //View the user information of the user
finger root //View root’s information