linux basis - the directory access commonly used commands

Directory path:

  1. Special directory:
    The current directory
    .. the parent directory
    [root @ Oldboy /] # cd / etc / sysconfig /
    [root @ Oldboy sysconfig] # pwd
    / etc / sysconfig
    [root @ Oldboy sysconfig] #
    [root @ Oldboy sysconfig] ../ .. CD #
    [@ Oldboy the root /] # pwd
    /

[root@oldboy /]# ls
abc dev lib mnt root server tmp
bin etc lib64 opt run srv usr
boot home media proc sbin sys var
[root@oldboy /]# cd ./mnt
[root@oldboy mnt]# pwd
/mnt

  1. Relative and absolute paths
    relative path: current environment
    [Network-scripts the root @ Oldboy]-ens33 the ifcfg CAT #
    [@ Oldboy the root-Network scripts] # CAT ./ifcfg-ens33

Absolute path: the only path
[root @ oldboy network-scripts] # cat / etc / sysconfig / network-scripts / ifcfg-ens33

  1. cd command
    cd command common usage:
    Indicates the user is in the current directory
    .. the parent directory represents
    ~ represents the current user's home directory

cd - // last switch in the same directory
cd ~ // switch to the current user's home directory
cd // switch to the current user's home directory
cd // switch the current directory is generally used in copying, moving, etc..
CD. // switch to the current directory's parent directory

Guess you like

Origin www.cnblogs.com/s-sx/p/11820352.html