Linux File System Operations Command

Source: Internet
Author: User
Tags echo command file copy set time disk usage file transfer protocol

Linux File System Operations Command

File System Operations Command:

1. Cat: You can display the contents of a file (often with more), or combine multiple files into one file.

2. CHGRP: Used to change the user group to which the file or directory belongs, the parameters of the command are separated by a space to change the file list of the genus Group, the file name supports wildcards, and if the user is not the owner of the file, the group that owns the file cannot be changed.

3. chmod: Used to change the access rights of a file or directory, this command is used in two ways: one is to use a graphical method, and the other is a digital setup method.

4. Chown: Used to assign the specified user or group to a specific owner. A user can be set to a user name or a user ID, and a group can be a group or group ID. A specific file is a space-separated list of files that can change permissions, and the file name supports wildcard characters.

5. Clear: Used to clear the terminal screen.

6. CMP: Used to compare the size of two files.

7. CP: (copy) can copy files or directories to other directories, just like the Copy command under DOS, the function is very powerful. When using the CP command, you only need to specify the source file name or destination directory.

8. Cut: Used to remove portions of the file.

9. diff: Used to find out the differences between the two files.

Du: Used to display the size of the remaining space on the disk.

One. File: The type used to display the file.

Find: Used to search for files in the directory and perform the specified actions.

Head: View only the first few lines of the file without having to browse the entire file.

LN: You can create a link between files, in effect assigning a file an alias to access it.

Less: usage is similar to more, you can view more than one screen of the file content, the difference is less in addition to the space bar can be displayed down the file, you can also use the arrow keys to scroll through the file, to end the browsing, as long as the less prompt ":" Press Q.

Locate: can be used to find files and to search faster than the Find command.

. LS (list): Used to display a list of files and subdirectories in the current directory.

mkdir (Make directory): Create subdirectories.

MORE: Used to display more than one screen of the file, in order to avoid the file content display instantly disappear, you can use the more command to let the file display full screen when the pause, press any key to continue to display the contents of the next screen.

Rmkdir (remove directory): Used to delete "empty" subdirectories or useless directory files.

(move): You can move files and directories to another location, or change the names of files and directories.

Pico: You can specify how text is edited.

. PWD (Print working directory): Displays the directory where the user is currently located.

RM: Used to delete obsolete or useless files in the system, you can delete files or directories in the directory itself, and for linked files, the original files remain unchanged.

Sort: Automatically categorize text files.

Stat: Used to display the status of a file or file system.

Strings: Displays the string to be printed in the file.

Tail: End of output file.

Touch: Changes the timestamp of the file.

Umask: Used to start the bash shell.

Uniq: Removes duplicate lines of text from the categorized file.

VI: Start the VI text editor.

A. WC: Displays the number of bytes, word combination text lines in the file.

Whereis: Find the location of files such as the original program, binary program or user manual in a specific directory.

Man: You can use this command if you want to know more about a command.

DD: Copies a file.

PNS. DF: View disk space usage for a file system.

Edquoat: Sets the disk space limit for users and user groups, which is the quota in Windows systems.

Fdformat: Format the floppy disk.

Max. FDISK: Perform a disk partition under Linux.

MKFS: Build a Linux file system.

Mkswap: Create a Linux swap partition.

Mount: mount a file system.

Quota: Limits and displays the disk space available to the user.

Swapon,swapoff: Enables or cancels exchange pages for devices and files.

Quotaon,quotaoff: Enables or cancels the quota limit.

Umount: Cancellation of file system equipment.

System administration Commands

1. Finger: Query user information, also can view the default user environment.

2. FTP: The user interface of the standard file Transfer Protocol is the simplest and most effective way to transfer files over a network.

3. Host: For DNS queries.

4. Hostname: Used to display or set the host name of the system.

5. Ifconfig: Used to configure the NIC interface. (You can use the down or up parameter to disable or enable a NIC interface)

6. Mail: Send and receive messages.

7. Netstat: Displays network connections, routing tables, and network interface information, and users can know that those network connections are currently running.

8. Ping: This command is used to test whether the computer and other computers on the network are connected.

9. Rlogin: Remote login command, which is similar to the Telnet command, allowing the user to initiate an interactive session of the remote system.

The remote file Copy command, which is used to copy files between computers, has two formats, one for copying file files, and the other for copying files or directories to other file directories, RCP:RCP.

One. Route: This command is used to display or set the IP routing table.

Tcpdump: This command is used to test network traffic.

Talk: This command can be used for a timely conversation with a network user, but the information of both systems must be added to the respective/etc/hosts file to identify each other.

Telnet: This command is used to log on to a remote computer over a network as if it were a local computer.

The Wall:wall (write all) command can be used to send messages to users who log on to the local computer. When sending a message, you can either enter the message you want to send directly or send the file as a message.

wget: This command is used to download files from the Internet in a Linux environment, supports HTTP and FTP protocols, supports proxy server and breakpoint continuous transmission, can recursively host directories on remote hosts, finds compliant files and downloads to local hard drives. The wget command can be run in the background, intercepting and ignoring the hantfup signal, so the user can continue running after exiting the login.

The &,BG:&,BG command is a background execution command, sometimes the user executes a program that may take a lot of time, and if it is placed in the foreground, it may not be possible to continue other operations, preferably in the background.

The FG:FG command is the foreground execution command, and if the user has a program running in the background, the program can be moved from the background to the foreground by the FG command.

Jobs: This command is used to display a list of tasks that are being performed in the background. The Bg,fg,jobs command belongs to the Bash command,

Kill: This command terminates a program, for example: #[[email protected] Root]kill 3793

PS: This command is used to display the status of the program.

Top: This command is used to display the current CPU process.

At Batch ATP ATRM: These commands are used to sort, check, or delete tasks that run in the background.

Linux user-related commands:

1. passwd command: Change the user password.

Format: passwd [user name]

2. Su command: Can allow a normal user to have Superuser or other user's rights, also can let super advocate as ordinary user's identity to do something.

Format: su[option [?] [User Account]

Note: If no user account is specified, the system default is Superuser root. The meanings of the options in this command are:

-C: Ends when a command is executed.

-: The purpose of adding this minus sign is to make the environment variable the same as the user you want to convert.

-M: Leave the environment variable unchanged.

Linux System administration Commands:

1. Wall command: Send the message to all users logged in.

2. Write command: Sends a message to a user in the system.

Format: Write user account [terminal name]

3. MESG command: Sets whether other users are allowed to send messages to themselves using the Write command.

If you are allowed to enter a command: MESG y

If the input command is not allowed: MESG N

4. Sync command: Used to shut down the Linux system. Sync is forcing the data in memory to be written back to the hard drive to avoid data loss.

5. Shutdown command: Can safely shut down or restart Linux it prompts a warning message to all logged-on users on the system before the system shuts down.

Format: Shutdown [options] [TIME] [warning message]

Meaning of the options in the command:

-K: does not really shut down, but only sends a warning message to all users.

-R: Restart immediately after shutting down the machine.

-H: Do not restart after shutting down the machine.

-F Fast shutdown, skip fsck when restarting.

-N: Fast shutdown without the INIT program.

-C: Cancels an already running shutdown.

6. Free command: View current system memory usage, which shows the remaining and used physical memory and swap memory in the system, as well as shared memory and buffers used by the core.

Format: Free [-B |-K |-m]

The meanings of the various options in the command:

-B: Displayed in bytes.

-K: Displayed in K-byte units.

-M: displayed in megabytes.

7. Uptime command: Shows how long the system has been running, which in turn displays the following information: The current time, how long the system has been running, how many users are currently logged in, the average load of the system in the past 1 minutes, 5 minutes, and 15 minutes.

8. DF Command: Check the disk space consumption of the file system.

Format: DF [option]

Description: The DF command displays the use of all file systems for I nodes and disk blocks.

The meanings of the various options in the command:

-A: Displays disk usage for all file systems, including 0 blocks of file systems.

-K: Displayed in K-byte units.

-I: Displays the I node information, not the disk block.

-T: Displays disk space usage for each of the specified types of file systems.

-X: Lists disk space usage for a file system that is not a specified type.

-T: Displays the file system type.

9. Du command: Displays the usage of disk space. The size of the disk that the statistics catalog (or file) occupies.

Format: du [options] [Names ...]

Description: This command goes through each subdirectory of the specified directory and shows how the directory occupies the file system data block (1024 bytes). If no names is given, the current directory is counted.

The meanings of the various options in the command:

-S: Only the total number of data blocks that are occupied for each names parameter is given.

-A: Recursively displays the number of blocks of data in each file in the specified directory and in the Descendants directory. If you do not specify-s and do not specify-a, the number of disk blocks for each directory in names and the subdirectories in it are displayed.

-B: The disk space usage is listed in bytes (the system defaults to K bytes).

-K: Lists the usage of disk space in 1024-byte units.

-C: Finally add a total (system default setting).

-L: Calculates all file sizes, and computes multiple times for hard-linked files.

-X: Skipping directories on different file systems is not counted.

DD Command: Copies the specified input file into the specified output file, and can be formatted for conversion during the copy process.

Format: DD [options]

The meanings of the various options in the command:

if = input file (or device name).

of = output file (or device name).

IBS = bytes reads the bytes byte at a time, and the number of bytes read into the buffer.

Skip = Blocks skips the ibs*blocks block that reads into the beginning of the buffer.

Obs = bytes writes the bytes byte at a time, and the number of bytes written to the buffer.

BS = bytes Sets the number of bytes in the read/write buffer (equal to the set IBS and OBS).

CBS = Byte converts bytes bytes at a time.

Count = Blocks only copies the input block blocks.

CONV = Ascⅱ Converts the EBCDIC code to Ascⅱ.

Conv = EBCDIC converts Ascⅱ code to EBCDIC code.

CONV = IBM IBM converts Ascⅱ code to alternate EBCDIC code.

CONV = Block Converts the change bit to a fixed character.

CONV = Ublock Converts the fixed bit into a change bit.

CONV = UCase Converts the letter from lowercase to uppercase.

CONV = LCase converts letters from uppercase to lowercase.

CONV = Notrunc does not truncate the output file.

CONV = swab swaps each pair of input bytes.

CONV = NoError error is not stopped processing.

Conv = sync puts the size of each input record to the size of the IBS (filled with nul).

One. Fdformat command: Low-level format floppy disk.

Formatting: Format [-n] Device

Note:-N floppy disk is not tested after formatting.

echo Command: Display a piece of text on the display, generally play a hint.

Format: Echo [-n] String

Cal Command: Displays the calendar for a month of the year.

Format: cal [Options] [month [year]]

The meanings of the various options in the command:

-j: shows that each day of a given month is the days of the year (from January 1).

-y: Displays the calendar for the whole year.

Date command: Displays and sets the system day and time.

Format: Date [options] display time format (start with +, followed by format)

Date [options] set time format

The meanings of the various options in the command:

The. Clear command: Clears the information on the screen.

Basic Commands for VI:

1. Move the cursor:

Ctrl + B: roll up one screen

Ctrl + F: Scroll down one screen

Ctrl + D: roll down half screen

Ctrl + u: Roll up half screen

G: Move to the end of the file

W: Move to the beginning of the next word

B: Jump to the beginning of the first word

2. Delete

X: Delete the character following the current cursor

#x: Deletes the # characters following the current cursor. For example, 5x means delete 5 characters.

DD: Deletes the current cursor in the row

#dd: Deletes the # line after the current cursor is located. For example, 5DD means that the 5 rows of the deleted word cursor are counted.

: L, #d: For example,: 1,12d deletes text that is 1 to 12 of its own.

X: Delete the left character of the current cursor

D: Delete to the end of the line

3. Change

CW: Change the word at the cursor to the end of this word

C#w: For example, c3w represents a change of 3 words

cc: Modify Line

C: Replace to end of line

4. Replace

R: Replaces the character at the cursor

R: Replace character until ESC is pressed

5. Copying

YW: Copy the word-to-tail buffer at the cursor

P: Paste the data from the buffer.

YY: Copy cursor line to buffer <

    • This article is from: Linux Learning Tutorial Network

Linux File System Operations Command

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.