Directories in UNIX or LINUX a really useful concept for new programmers. LINUX directories are like in windows they are folders. Links, Files and Directories are major components you need to learn. Linux or UNIX have case sensitive names.
Directories and Files
- Before, you first start to learn about directory-You can think it is a ‘Folder’ in windows. In Linux, the ‘/’ (slash) is called root directory.
- Under root directory all other directories like User or System directories are usually created.
File SystemA file is called Regular file and Plain file, normally created in directories. Each file has some extension with (.) dot, so that you can easily recognise the type of files.
#creating files >mydir vi sample.java #when you save the data your file is ready sample.java
Directory within other directoryYou can create another directory in a directory, which already created
File structure in LinuxIn the above structure, in the root directory, you can see both files,links and directories. You can create symbolic links like short links to quick use.
- Every directory by default you can see two dots(dot-dot)-‘..’, this tells the link for directory itself
- /.. tells root directory
- File name should not be more that 255 bytes in Linux systems
- Type ‘pwd’ to know present or current working directory
- Path, it denotes the where directory or file is located
- Example for absolute path name /home/mtk/.bashrc, /usr/include
- Example for relative path name /include/stdio.h
Ownership of Files
- Files have ownership. The ownership can be read, write and execute
- Major operations on file i/o are open(), read(), write(), close()
Important interview questionUNIX systems have no end-of-filecharacter; the end of a file is detected by a read that returns no data.
- Linux directories for new programmers really useful
- ksh script steps to create awesome way
- The best UNIX command for files
- How Crontab the best way in scheduling jobs simplified