LS-List Directory contents
-A list of all files -d Specifies directory information -F for directory additions/ identifiers -H Enhanced readability -L column mode display -R reverse order display -S Sort by size -T by modified time
File-Determine the type of files
Less-Browse file contents
Manipulating Files and directories
CP Copy files/directories
-a copy of files, directories, and their properties -I need to prompt if overwrite occurs -R recursively copies the contents of the file, which is used when copying the directory -youonly copy files that do not exist in the target directory -V display of detailed command operation information
MV Move/rename files/directories
-I prompt user before overwriting an already existing file -u move only nonexistent file, or file content new file -V display detailed operation information
mkdir Creating a Directory
RM Delete files/directories
-I delete before prompt -r Recursive delete file, generally delete directory when used -f Ignore nonexistent file -V display detailed operation information
Note: Execute the LS before executing RM and see which files are deleted
LN creates a hard link or symbolic link
Symbolic Link:lnfile link hard link:ln -S item link, item can be a file or a directory
Hard Links:
By default, each file has a hard link.
A hard link cannot associate a file other than the file system in which it resides.
Hard links cannot be associated with a directory
Symbolic Links:
Equivalent to a shortcut in Windows
Type description Command types
The four-form of the command: an alias for the executable inside the shell's own command shell function command [email protected]-rev-1-0: ~$ TypelslsIs 'ls--color=auto'the alias[Email protected]1-0:~$ type showrtshowrt is 'SH/home/sherry/workplace/usefull/SH/showtime.SH'the alias[Email protected]1-0:~$ type CDCD is shell built-in [email protected]-rev-1-0: ~$ type Start-all.SHStart-all.SHIt's/opt/hadoop-.1.2.1/bin/start-all.SH
Which shows the program executed by the command
[Email protected] 1-0whichman/usr/bin/Mans
Man Query Command manual
Apropops displays a series of appropriate commands
Info Display command Information
Whatis A concise description of the display command
Alias create command Alias
Happy Linux command line