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
We need your assistance to stay live
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 |
- Fedora 21 Scheduled For Release In October : For Fedora users, just keep calm and use Fedora 20 for now. Fedora Developers has announced that F...1 comment |
- 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 Server (Apache, MySQL or MariaDB, PHP) On Ubuntu 13.10 : Updated January 12, 2014 LAMP is a combination of operating system and open-source software stack. ...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 ...0 comments |
- Download Elementary OS 'Luna' Official Wallpapers : Hi Guys, Am a great lover of Elementary OS, so I like to move almost everywhere with some its beaut...0 comments |
- Fedora 21 Scheduled For Release In October
- Install Uget Download Manager In Ubuntu, Fedora, Debian
- Download Elementary OS ‘Luna’ Official Wallpapers
- Install Power Commands 0.1.5 On Ubuntu 14.04/13.10/12.10/12.04
- 5 Android Apps that’s Going to Make Running Your Business Less Stressful
- Puppet agent Install Using Script
- Install Corosync and Pacemaker On CentOS 6.5
- Install Fail2Ban On Ubuntu Server 13.04/13.10
- How To Install Google Chrome in Fedora 20, 19, 18
- How to surf using Tor Browser Bundle
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .