Linux 150 command file and Directory Operations Command CD PWD CP MV Touch

Source: Internet
Author: User

CD Switch Directory

CD Catalog

    1. [[Email protected] ~]# CD/
    2. [[email protected]/]# ls
    3. Application bin class Dev home lib64 media nfsbackup opt python sbin server sys usr
    4. Backup boot data etc lib Lost+found mnt oldboy proc root selinux srv tmp var
    5. [Email protected]/]# cd/tmp
    6. [[email protected] tmp]# ls
    7. Yum_save_tx-2017-10-12-23-03cskn4p.yumtx

PWD shows your current location showing your current working directory

Pwd

The path you are in

    1. [Email protected] tmp]# pwd
    2. /tmp
    3. [Email protected] tmp]# CD/USR
    4. [[Email protected] usr]# CD bin
    5. [Email protected] bin]# pwd
    6. /usr/bin
mv Move file or directory modify filename

MV File name Destination directory

    1. [[email protected] tmp]# ls
    2. 1.txt YUM_SAVE_TX-2017-10-12-23-03CSKN4P.YUMTX
    3. [Email protected] tmp]# MV 1.txt/root
    4. [Email protected] tmp]# Cd/root
    5. [[email protected] ~]# ls
    6. 1.txt anaconda-ks.cfg anaconda-ks.cfg_q Install.log install.log.syslog
    7. [Email protected] ~]#

Touch Create File

Touch file name

    1. [[email protected] tmp]# Touch 1.txt
    2. [[email protected] tmp]# ls
    3. 1.txt YUM_SAVE_TX-2017-10-12-23-03CSKN4P.YUMTX

File View Files Properties

File File name

    1. [email protected] tmp]# LL
    2. Total 4
    3. -rw-r--r--1 root root 0 Nov 21:15 1.txt
    4. -RW-------1 root root 1135 Oct 23:03 yum_save_tx-2017-10-12-23-03cskn4p.yumtx
    5. [[Email protected] tmp]# file yum_save_tx-2017-10-12-23-03cskn4p.yumtx
    6. Yum_save_tx-2017-10-12-23-03cskn4p.yumtx:ascii text
    7. [[Email protected] tmp]# file 1.txt
    8. 1.TXT:ASCLL text

ASCII file ASCII text text file

mkdir Creating a Directory

mkdir Directory Name

    1. [Email protected] tmp]# mkdir yyy
    2. [email protected] tmp]# LL
    3. Total 12
    4. -rw-r--r--1 root root 5 Nov 21:26 1.txt
    5. -RW-------1 root root 1135 Oct 23:03 yum_save_tx-2017-10-12-23-03cskn4p.yumtx
    6. Drwxr-xr-x 2 root root 4096 Nov 21:29 yyy

Linux 150 command file and Directory Operations Command CD PWD CP MV Touch

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.