第7章-Linux--用户管理--英文-A-62.pptVIP

  • 32
  • 0
  • 约2.09万字
  • 约 70页
  • 2018-05-06 发布于福建
  • 举报
Changing Directories You use the cd (change directory) command to change directories: cd ~—Changes to your home directory cd /tmp—Changes to the directory /tmp On most Linux systems, your prompt will tell you what directory you’re in. If you ever explicitly need to know what directory you’re in, you can use the pwd command to identify the working directory for the current process. commands function cd Changes to your home directory cd ~ Changes to your home directory cd / Changes to root directory cd .. Changes to directory above cd /root Changes to your /root directory cd /home Changes to /home directory Making Directories You can use the mkdir (make directory) command to make directories. mkdir photos—Makes a directory called photos within the current direc mkdir -p this/that/theother—Makes the nested subdirectories named within the current directory. Removing Directories The command rmdir will remove a directory that is empty. Connecting Commands and Redirecting Input and Output Linux provides many small, simple commands that you can combine to perform complex tasks. Linux actually provides two different ways of specifying that the output of one command is the input to another: by using a pipe to connect the two commands by what is known as redirecting IO, which stands for redirecting input/output Pipe connecting the standard output from one command to the standard input of another. The pipe automatically ties the two commands together and sends the output of the first to the second as input. $ ls –al /etc | less $ ls –al /etc | lpr redirecting I/O The output of a file can also be redirected to a file, using the greater than sign (), which simply creates a file containing the output of the command, as in the following example: ls listing.out This command takes the output of the l s command and sends it to the file listing.out. Concatenating Files The command cat (concatenate) displays files to standard output. If you want to view the contents of a short text f

文档评论(0)

1亿VIP精品文档

相关文档