Lab-listing Files and directories

Source: Internet
Author: User

By performing this lab, students would learn how to navigate and manage files and directories.

In this lab, you'll perform the following tasks:

    1. List Files and directories
    2. Copy, move and delete files and directories

Part 1:files and directories

In this task you'll explore the concepts of files and directories.

On a Linux OS, data was stored in and files files was stored in directories . The used to folders describe directories.

Directories is actually files, too; The data that they hold is the names of the files that has been entered into the them, and along with the inode number (a UN Ique identifier number assigned to each file) for where the data is the file exists on the disk.

As a Linux user, you'll want to know how to manipulate these files and directories, including what to list files in a dir Ectory, copy, delete and move files.

Step 1

Type the following command to print the working directory:

pwd/home/zhangqiwei

The is the directory of that working directory your terminal window was currently "in". This is also called the current directory . This'll be important-running future commands as they would behave differently based on the directory is currently in.

When your first open a terminal window, you'll be placed in your home directory. This was a directory where you had full access and other users normally has no access by default. To see the path to your home directory, you can execute the following command to view the value of the home variable:

Echo $HOME/home/zhangqiwei

Step 2

You can use the cd command with a to path a directory to change your current directory. Type the following command to make the root directory your current working directory and verify with the pwd com Mand:

[Email protected] ~]$ CD/pwd/

To your home directory, the CD command can executed without a path. Your home directory and verify by typing the following commands:

[[Email protected]/pwd/home/zhangqiwei

Step 3

Use the echo command below to display some other examples of using the tilde as part of the path:

echo ~ Zhangqiwei ~root ~mail ~Nobody/home/zhangqiwei zhangqiwei/root/var/spool/mail/

Lab-listing Files and directories

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.