Unix/Linux File Recognition. Did You Know?
Did you know that Unix and Linux has no concept of a file extension? What is a file name extension?
A .txt extension tells us that it is a TEXT file and .pdf extension tells us that it is a PDF file. By following this logic, you understand that a file name extension is the suffix that is added to the filename after the dot. Linux does not care for file extensions and I will demonstrate it with a simple example.
Open a new terminal and type “sudo vim print” like shown in Figure 1.
Now type the Python code as shown in Figure 2.
Save the file and run it like shown in Figure 3.
It is executed like a normal Python file (with .py extension) because the shebang line (#!/usr/python) tells the operating system which interpreter to use to execute the file.
What about other files? The first few bytes of a file identify the file type and the number of bytes is called a Magic Number. This Magic Number is used by Linux to identify the type of a file.
Did you know about hidden files in your home directory ?
Files that are hidden, contain configuration information and they are hidden because they should not be changed, unless you are an advanced user and very familiar with Unix-like environments. Hidden files begin with a dot (.) and they are not displayed when the ls command is executed.
You can list hidden files with the ls command followed by -a option, like shown in Figure 5.
You can display hidden files with the (CTRL+H) shortcut key when browsing with your file manager.
Did you know that Linux commands and files are case sensitive?
Figure 7 demonstrates that Linux commands are case sensitive, the ls command that is used to list file in the current directory is not the same with LS. The same thing with files; file1 is different from File1. Be careful because they refer to different files. Now that you know about hidden files, file extensions and the fact that Linux commands and files are case sensivitive it is time to share with your friends. Ask yourself this question, “Do they know?”.
Like us on Facebook
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- Setup DNS Server On openSUSE 13.1 : What is DNS Server? As you might know, DNS, Domain Name System, is a system that resolves Domain ...0 comments |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...1 comment |
- Configure Your Browser To Use Tor On Ubuntu/Debian/Linux Mint : Tor, The Onion Router, is a network of Virtual Tunnels that allows users to communicate securely and...1 comment |
- Twelve Vulnerabilities Have Been Fixed In Ubuntu 12.04, Time To Update : Canonical has released security updates for Ubuntu 12.04 LTS and advices to update your system as so...0 comments |
- Setup DNS Server On openSUSE 13.1
- TeamViewer 9 Final Has Been Released!
- Twelve Vulnerabilities Have Been Fixed In Ubuntu 12.04, Time To Update
- OpenLDAP Installation and Configuration in Ubuntu 12.10/13.04/13.10 And Debian 6/7
- Configure Your Browser To Use Tor On Ubuntu/Debian/Linux Mint
- Setup A Full Featured ITIL Management System Using Integria IMS On CentOS 6
- Install LibreOffice 4.1.3 in Elementary OS ‘Luna’
- How To Install Simple Scan in Crunchbang ‘Waldorf’
- Selene Media Encoder: Convert Audio, Video Files To Most Popular Formats
- Linux Kernel 3.12.2 Is Available For Download! Install / Upgrade Instructions
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .