分享

wiki:basic

 丝广里 2017-07-09

Basic Commands for New Users

List the Contents of a Directory

To list the contents of a directory, open the terminal and type

ls

ls stands for list.

For more details, use

ls -l

-l stands for long.

To view all files, including hidden files use

ls -a

In Linux, hidden filenames start with a ”.”

You can combine -l and -a, like this

ls -al

Change Directory

To change to a directory within the one you are in, use

cd directory-name

To change to a directory in the directory in one you are in, use

cd directory-name/directory-name

To change to the root directory, use

cd /

To change to a directory in root, use

cd /directory-name

To change to the home directory, use

cd ~/

To change to a directory within the home directory, use

cd ~/directory-name

To change up to the directory containing the one you are in, use

cd ..

To change up two levels, use

cd ../..

Display the Contents of a File

To display the contents of a file, use

cat filename

This may be used to read text files.

As Root or Administrator

To have root or administrator permissions, use

sudo

before commands.

For example, to start the text editor as root or administrator, use

sudo editor

Stop an Application

To stop an application, use

killall app-name

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多