Linux from getting started to running

Source: Internet
Author: User
Tags parent directory

Linux from getting started to running file type, path problemFile types under Linux All files everything is file

My understanding of everything is that there is no specific file type or suffix. exe. config in linux, this suffix can be understood as artificial for the type of file, but in Linux the system does not consider the file type, it will run directly.

For example, we create a hello.txt file with the echo ' Hello World ' under/app and then change the extension according to the extension under Windows

See what's going to happen.

[[email protected] app] # echo "echo Hello World" >hello.txt [[email protected] app] # ls hello.txt[root@localhost app] #  echo Hello world[root@localhost app]#[[email protected] app]#  . Hello.txtHello World

We tried to convert the TXT format to. SH and then run to find the results, which could be coincidental.

[[email protected] app] # MV Hello.txt hello.sh [[email protected] app] #  Hello World


We'll try to convert the. sh format to. mp3 And then run the discovery results.

This time, because we all know that MP3 is a music media format, according to the logic of Windows will definitely error

But running on Linux without error or display content

[[email protected] app] # MV hello.sh Hello.mp3 [[email protected] app] # ./hello.mp3Hello World


The same is true for converting MP3 to PNG.

[[email protected] app] # MV Hello.mp3 Hello.png [[email protected] app] #  Hello World


We're going to remove its extension with a bold idea.

It turns out it's still working.

[[email protected] app] # mv Hello.png Hello [[email protected] app] # ./helloHello World


In the end, I used the wrong way of naming.

And there's no effect on discovery.

[[email protected] app] # mv Hello Hel.fdshfujahjk213sda.sad [[email protected] app] #  Hello World


We can conclude that there is no extension under Linux, only file names, so-called extensions are just

The characters that people add to differentiate their files


? -: Normal file *
? D: Catalog File *
? B: Block device
? C: Character device
? L: Symbolic Link file *
? P: Piping File pipe
? S: Socket file sock

Path problem

Absolute path: from ROOT to target

Relative path: relative to parent directory

. For the current path

.. is the parent path, which is the ancestor path

Linux from getting started to running

Related Article

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.