Home >Operation and Maintenance >Linux Operation and Maintenance >What are the basic file commands commonly used in Linux?

What are the basic file commands commonly used in Linux?

WBOY
WBOYforward
2023-05-23 11:34:061095browse

Help command

man man ls

help Get help information for viewing the shell’s built-in commands (cd)

Commonly used convenient construction

ctrl c Stop the process

ctrl l Clear the screen (clear) Completely clear the screen (reset)

File directory class

pwd: Display absolute path

ls【 Options]: Display the contents of all directories under the current file

Options: -a All files including hidden files

-l Long data list (equivalent to ll)

cd Path: Switch path

mkdir [Option] File name: Create a new folder

           Option: -p can create multi-layer directories

rmdir File name: Delete one Empty folder

touch File name: Create an empty file

cp [Option] Original file Destination file: Copy file operation

Option: -r Recursively copy the entire Folder

rm【Option】 File name: Delete file

Option: -r Recursively delete all contents of the directory

-f Force the deletion operation

                                                                                                                                                                                                                                        ## Turn page] [enter: next line]

                                                                                                                                                                                                                                                                                           Substring (searching up for the specified string)

echo: Output the content to the console

head [Option]: Display the file header information

Option: -n 5 Display 5 lines

tail [Option]: Display information at the end of the file

Option: -f Track all updates to the document in real time

Output redirection> Append> >

1) ls -al > File: Write the contents in the list to the file (overwrite)

echo Contents>> File Append the contents to the file

Soft connection

Establish a soft connection: ln -s It turns out that now

Delete the soft connection: rm -rf soft connection name rm -rf soft connection name/[real file directory It will also be deleted]

history View history command

date Display the current time

date %Y%m%d Display year, month and day %H %M %S hours, minutes and seconds

date -d '1 days ago': Display the time of the previous day

date -d '-1 days ago': Display the time of tomorrow

Set the system time

date -s "Standard format of time YY-MM-dd hh:mm:ss"

cal View calendar

The above is the detailed content of What are the basic file commands commonly used in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete